Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
UV shifting in alpha mask #456491
11/24/15 20:46
11/24/15 20:46
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
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

Last edited by NeoJones; 11/24/15 21:01.

Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: UV shifting in alpha mask [Re: NeoJones] #456493
11/24/15 23:23
11/24/15 23:23

M
Malice
Unregistered
Malice
Unregistered
M



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-

Last edited by Malice; 11/25/15 00:04.
Re: UV shifting in alpha mask [Re: ] #456494
11/25/15 00:07
11/25/15 00:07

M
Malice
Unregistered
Malice
Unregistered
M



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-

Re: UV shifting in alpha mask [Re: ] #456495
11/25/15 00:10
11/25/15 00:10

M
Malice
Unregistered
Malice
Unregistered
M



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.

Last edited by Malice; 11/25/15 00:30.
Re: UV shifting in alpha mask [Re: ] #456496
11/25/15 10:10
11/25/15 10:10
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
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.


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: UV shifting in alpha mask [Re: NeoJones] #456497
11/25/15 10:17
11/25/15 10:17
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
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


Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D
Re: UV shifting in alpha mask [Re: NeoJones] #456498
11/25/15 10:50
11/25/15 10:50
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
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.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: UV shifting in alpha mask [Re: Superku] #456499
11/25/15 11:11
11/25/15 11:11
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline OP
Member
NeoJones  Offline OP
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
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

Last edited by NeoJones; 11/25/15 11:16.

Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1