Doing a ripple mesh deformer using the vertex shader
In this recipe, we will deform a planar mesh using the vertex shader. We know that the vertex shader is responsible for outputting the clip space position of the given object space vertex. In between this conversion, we can apply the modeling transformation to transform the given object space vertex to world space position.
For this recipe, we assume that the reader knows how to set up a simple triangle on screen using a vertex and fragment shader as detailed in the previous recipe. The code for this recipe is in the
How to do it…
We can implement a ripple shader using the following steps:
- Define the vertex shader that deforms the object space vertex ...