I've recently started to learn shaders and I'm trying to write a shader that :
- Animates a mesh to simulate water waves ;
- Reuses the standard Unity shader so that I don't have to write all the complex lighting stuff myself.
The shader modifies the vertices in the first pass and that pass works as intended. The problem is that, when the subsequent passes are performed, i.e the Unity standard shader passes, these passes do not reuse the modified vertex coordinates !
![alt text][1]
As you can see on the picture, my first pass properly updates vertices, but the following passes ignore the updated values.
My question is, how can I make the following passes reuse the updated vertexes ? Do I have to modify every single pass of the unity standard shader to also update the vertices or is there some kind of magic command that I have not learned yet ?
Thanks ! [1]: /storage/temp/111040-capture.png
- Animates a mesh to simulate water waves ;
- Reuses the standard Unity shader so that I don't have to write all the complex lighting stuff myself.
The shader modifies the vertices in the first pass and that pass works as intended. The problem is that, when the subsequent passes are performed, i.e the Unity standard shader passes, these passes do not reuse the modified vertex coordinates !
![alt text][1]
As you can see on the picture, my first pass properly updates vertices, but the following passes ignore the updated values.
My question is, how can I make the following passes reuse the updated vertexes ? Do I have to modify every single pass of the unity standard shader to also update the vertices or is there some kind of magic command that I have not learned yet ?
Thanks ! [1]: /storage/temp/111040-capture.png