Hey Sean,
Thanks to you I have made quite a lot of progress in rendering my own mesh.
I have manged to render a rectangular mesh and apply the water material on it.
Then by using another image as an alpha map I am able to discard certain fragments.
See the attached images.
While creating the mesh I am supplying DEM data as a texture so that I can look
up the texture in the vertex shader and carry out vertex displacement so that my mesh
conforms to the surface of the globe where the same DEM data has been applied as terrain.
This works but is very inefficient as DEM data can be very large in size and I don't see why I need to resend data
that is already part of the globe.
I have been looking into Cesiums implementation of ground primitives using Shadow Volumes and other approaches such as Ray Casting
to make the mesh conform to the surface of the terrain.
Shadow volumes is not usable as I require my mesh to have actual geometry as In I should be able to see the mesh and Terrain as separate
entities and provide a certain offset between mesh and terrain.
Ray casting to render fragments I just don't understand.
Is there any way I can drape my mesh on the surface of the globe without explicitly offsetting each vertex based on the DEM data?