I wanted to smooth the edges of the different colours and blend them into each other based on height. Perhaps there’s an easier way of doing this but I used a shader: https://www.babylonjs-playground.com/#ZH0IX6#7
Is there an easy way to have the shadows (and the specular highlights) work with this shader?
Would this be easier to accomplish in the node material editor?
Or perhaps a different solution altogether like modelling the vertices on contour lines instead of a regular grid?
After this I’m aiming to get a shimmering watery surface at the water level height of ~0.25 in case that influences any choice of solution.
Using a shadow depth wrapper won’t work because your fragment code doesn’t have light support. You would have to include all the required shader code to support lights in your shader.
It would be a lot easier to create a material plugin instead. That way, your code will be embedded in a standard / PBR material, and you won’t have anything to do to get shadow support.
Material Plugin looks really powerful! I don’t know if there’s an easier / better way of using the info.diffuse and shadow but this looks better: https://www.babylonjs-playground.com/#ZH0IX6#15