UV shifting in alpha mask

Posted By: NeoJones

UV shifting in alpha mask - 11/24/15 20:46

Hey guys,
does anybody know, how I can shift the uv in an alpha mask with smooth edges or do I need a shader for that?
I uploaded an example image, that show the effect what I mean:



The black area should be transparent, after setting the "translucent"-flag.

Regards, NJ
Posted By: Anonymous

Re: UV shifting in alpha mask - 11/24/15 23:23

You need a fixed function accessed through a shader for models. I would create a triangle model with 4 side, 2 being near 0 thick. Use one skin, the skin should be a white/ alpha noise singe image ... I.e. TGA white with the noise in the alpha channel. Last use the mtl_uvspeed / or / action fx_uvspeed from mtlFX.c

I will test moving a sprite skin without the shader as it may be possible with just the u and v members.

You are unable to change the uv members without fx_uvspeed(), You use fx_uvspeed can be called from within another action.. Sprites are fail for me, not sure why... uv memebrs should be usable without this stuff, seems total_ticks needs to be used not time_step;, Any way.

You will not be able to simply do it with a sprite.. That level of selective pixel manipulation of course would need a custom shader. However, A single sided flat triangle model and fx_uvspeed, and the trick for no_clipping will work well. One big note about the uvspeed fixed function, for me at least, it's a fps killer, if the object is not on screen, shut down the uvspeed.

Mal-
Posted By: Anonymous

Re: UV shifting in alpha mask - 11/25/15 00:07

But how to do it with a sprite...
Create a animated sprite.
examine any name+10(num).tga(format) animated sprite in the template folder. can be many frame. Then use Gimp 2 to create the shift in a each frame. Then just cycle the sprites frame member.

my.frame+=time_step;


Mal-
Posted By: Anonymous

Re: UV shifting in alpha mask - 11/25/15 00:10

You know, the users names change, but the questions are the same. Did you search the forum-search? Nothing in 2 years?

hit post from search
http://www.opserver.de/ubb7/ubbthreads.p...true#Post455108
http://www.opserver.de/ubb7/ubbthreads.p...true#Post437481
http://www.opserver.de/ubb7/ubbthreads.p...true#Post404496
of course looking through the manual for u or v , and or searching the offline for u v , you if
http://www.conitec.net/beta/uv.htm

Then there is your general idea, shifting the alpha channel, but only the part in the triangle not the whole channel..? How would you do that without a shade.
Posted By: NeoJones

Re: UV shifting in alpha mask - 11/25/15 10:10

Uhh... yes I searched for that in this forum, of course. Before posting it here, I always searching for it. But I dont found a solution for my problem.

Quote:
Create a animated sprite.

Yes, I've been thinking about it, but the effect would take too many frames. I need more than 400 frames with 256x512 px.
Sorry for my bad english.
Posted By: NeoJones

Re: UV shifting in alpha mask - 11/25/15 10:17

I know, there are other ways. For example, I can make a movie and render this on a sprite. But its very interesting to learn more about this - or how I can make such effects with uv shift or shaders or something else laugh
Posted By: Superku

Re: UV shifting in alpha mask - 11/25/15 10:50

Just do it with a shader.
Do at least the first 2 chapters of the shader tutorials first: http://www.conitec.net/shaders/
Understand a few basics like the texture coordinates (0..1, independent of your actual texture size), that a vertex shader is executed for each of a model's vertex and the pixel shader for each pixel of the model drawn to the screen (independent of the model's texture resolution).

Then you will come to the conclusion (by trial and error with an AUTORELOAD flag on the material) that you need to use 2 textures, 2 tex2D commands, one with shifted texture coordinates, one unshifted, where the latter's alpha channel determines the transparency and the former its texture.
Posted By: NeoJones

Re: UV shifting in alpha mask - 11/25/15 11:11

Thanks Superku! Iam a very big noob for shader programming, but I'll try it grin
I saw that HeelX programmed a shader script for uv shifting, but its not exactly what I need (its in the wiki). But I believe that its very useful, cause you can make many things with it laugh
© 2024 lite-C Forums