Sign in to follow this  
solenoidz

Animate texture coordinates along world space direction

Recommended Posts

solenoidz    591
Hi guys, I need an advice on this one. I'm trying to scroll a texture that scrolls from up to down in world space, no matter how the object is oriented. Let me give you a more proper example. Let's say I have a box. I need to animate the bump/specular texture on it's surface to make it appear like a wet surface. I can pretty much achieve that, but the problem is I don't know how to animate the texture coordinates according to the box orientation, so the water always looks like it's flowing from upstream down.If the triangle face is vertical, the water should flow faster, a horizontal ground face should get almost zero "water flow animation" I have a world space normal buffer already rendered, so I think I can skip the faces wich normal point downwards. I other words, how can I achieve something like this : Wet surfaces - Unreal engine used.
[media]http://www.youtube.com/watch?v=qosK4I32LMg#t=1m53s[/media]

Share this post


Link to post
Share on other sites
MJP    19754
Your tangent frame tells you the object-space direction in which your U and V are increasing. So if you convert your tangent frame to world-space, you know the world-space direction in which they increase.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this