Reputation: 147
I am doing a shader to "simulate" waves on a plane. Here is my subshader for doing the curves of the waves.
It works well, as you can see :
The problem is, the light reflection isn't applied on the modified verteces. It keeps reflecting light as if it was on a plane. How can I do to make it reflect on the waves and not on the plane.
**WHAT I TRIED : **
I tried to recalculate the normals of each verteces with the solution above :
This shader apply the circular wave subshader for positions of my vertices. And apply the same for the normals of the vertices. I consider that every normal should be 0, 0, 1 as they are all on the same Z coordinate but on different x and y. (does it make sense?) Then i asign the normals into the my vertex normal.
This gives this result which is not so bad but definitly isn't accurate (I think) on what it should render :
Am i missunderstanding something ? Is there a more simple way (or correct way) to do what I am trying to achieve?
Any help is welcomed !
Upvotes: 0
Views: 27