Jump to content

Piping Water Flux (Anim Texture)


Zeirus
 Share

Recommended Posts

 

Hello. I would like to apply the same effect to the pipes created in Leadwerks, however, changing in real time the flow direction and pause it when necessary (start/stop/inverse flux command). There is already a LUA script dedicated to this task? Thanks in advance for reply

Link to comment
Share on other sites

That doesn't even look like animation, I think it's just a scrolling texture.

 

Yes, it's true ... it's a texture that moves ... but, although simple, it gives an effect "animated" to flow. However, if there is a more accurate term to define this "scrolling" mention it as well, please smile.png

Link to comment
Share on other sites

i.e. In the vertex-shader: at the beginning (where all the uniforms are declared) add:

uniform float currenttime;

then search for the line

ex_texcoords0 = vertex_texcoords0;

and add below that:

ex_texcoords0.y -= currenttime*0.0005;

 

(The uniform will automatically be filled with its correct value)

  • Thanks 1
  • Upvote 1
Link to comment
Share on other sites

Learning to program shaders is a real useful thing.

For a start, you should have some fundamental knowledge about the basics of vector-maths (dot-product, cross-product, length, vector*matrix,...).

Once you got that, you should make yourself familiar with the "programmable function pipeline" to learn, which kinds of shaders exist and what they do. (You will mainly focus on vertex- and fragment-shaders but there also exist three more (control, evaluation and geometry), which you should only mess with, once you got yourself comfortable with the former two.

Then you should look at some existing shaders and try making little changes to them. You can't imagine, how satisfying it is to get your first wobbling teapot by moving a vertex along its normal with the sinus of the time ;). There are tons of good tutorials out there, but I think, it's important to keep messing around.

 

I found that this site helped me a lot: https://coolcodea.wordpress.com/category/shaders/page/5/

  • Upvote 1
Link to comment
Share on other sites

There are tons of good tutorials out there, but I think, it's important to keep messing around.

 

This was my approach a long time ago. When you know what makes'em tick, move on to more advanced stuff (you'll need some math knowledge), but mess around is fun.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...