Horde3D http://www.horde3d.org/forums/ |
|
Texture "animation" http://www.horde3d.org/forums/viewtopic.php?f=2&t=1271 |
Page 1 of 1 |
Author: | reloadead [ 12.10.2010, 17:04 ] |
Post subject: | Texture "animation" |
hey guys, For the project I'm working we want to have some sort of water effect (flowing water) and in a previous project we used the UVs to "animate" a water effect (together displacing the normal map, it gave a pretty cool result). Anyway, as I noticed I don't have directly acces to the UVs in horde, but I can (from what I see) in shader, I reckon I would try to do it in that, but I got a few question first before I dive into that: First of all, Am I on the right track with using a shader for that? I'm new to shaders, but as someone who is interested in special effect and graphics programming I really want to know more about it. Second, reading through the pipeline doc, I think I would need to use the attribute vec2 texCoords0 and attribute vec2 texCoords1 for that. But how does this work? How can I write the new positions to this? Any tips on this would be awesome ![]() |
Author: | phoenix64 [ 12.10.2010, 17:21 ] |
Post subject: | Re: Texture "animation" |
You rather want to set an additional uniform (e.g. uniform float animTime;) for that instead of working with the attribs (which you mostly cannot do anyways), rather compute the whole anim in the shader if poosible. |
Author: | Rauy [ 12.10.2010, 17:49 ] |
Post subject: | Re: Texture "animation" |
Hello, You do not write to the texCoord0/1 attribute, you get the current vertex' texture coords through these attributes, which are static and come from your water mesh. Then in the vertex shader you disturb these texture coords (and the normals, if needed) and give these new values to the fragment shader via some user-defined varying variables, which get interpolated across the triangles. Or you just pass them through in the vertex shader and do the animation in the fragment shader, which should give more detail. Anyway, I would suggest, you read some tutorial on shader (or specifically GLSL) programming first. And yes, shaders are exactly the right way to do this kind of effects, as most effects are achieved through some specififc shader, especially in Horde3D. |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |