Zeirus Posted February 5, 2015 Share Posted February 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 5, 2015 Share Posted February 5, 2015 There was a topic about this recently. Search the forum for animated textures and you should find it. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 5, 2015 Share Posted February 5, 2015 That doesn't even look like animation, I think it's just a scrolling texture. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Zeirus Posted February 5, 2015 Author Share Posted February 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
Zeirus Posted February 5, 2015 Author Share Posted February 5, 2015 There was a topic about this recently. Search the forum for animated textures and you should find it. Thank You. Maybe I found it (but it is a different procedure from the one I meant) Need help with animated textures Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 5, 2015 Share Posted February 5, 2015 If it's scrolling only (no real animation): You could simply add the current time (multiplied by a speed factor) to the y-texture-coordinate in the shader. (Maybe you need to do a modulo-calculation as well but I don't think, that is necessary). 1 Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 5, 2015 Share Posted February 5, 2015 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) 1 1 Quote Link to comment Share on other sites More sharing options...
Zeirus Posted February 6, 2015 Author Share Posted February 6, 2015 ... ... (The uniform will automatically be filled with its correct value) Thank You, Ma-Shell! This is precisely the procedure that was looking for! Quote Link to comment Share on other sites More sharing options...
dennis Posted February 8, 2015 Share Posted February 8, 2015 Sounds usefull, where to start making shaders anyway? Could someone please help me with that Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 8, 2015 Share Posted February 8, 2015 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/ 1 Quote Link to comment Share on other sites More sharing options...
shadmar Posted February 8, 2015 Share Posted February 8, 2015 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. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
dennis Posted February 8, 2015 Share Posted February 8, 2015 Thanks! Sounds hard to learn, but i'll give it a try Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.