Original Post
I have a shader issue that's been bugging me for a week now, I just can't figure out the problem. I've been following along with the examples in a book I'm reading on DirectX 9 and I tried to combine two of the examples but to no avail. I can't get super detailed now as I'm at work and the code in question's at home, but I do have one last guess as to what the problem is and would like an opinion. What I was trying to accomplish was to make the water in one of the demo applications undulate with a sine wave. I added an external time variable, gTime, to the awter shader and update this variable every frame in the main program. I also added the sine wave function from another demo from the book. And I change the y position of the vertex with the sine functions return. Something like this (semi-pseudocode): vertexVS(posL : POSITION0) { posL.y = sinefunction(posL.x, posL.z); } This should, in theory, cause the vertexes to move up and down the y-axis but what it does instead is create static waves there merely shake oddly back and forth on the x and z planes. The sine function is something like this (I may be getting parts wrong since I'm working from memory): d = (x*x + z*z); return a*sin(k*d + w*gTime + p); I've tried to make the two demo's code as equal as possible but one major difference is that the working sine wave demo uses just a normal primitives grid while the water plane is an optimized mesh. My question is: could the fact that the water plane is an optimized mesh cause this code to not work correctly? Thank you