So one of the technological hurdles I needed to make this game was the ability to change the texture of the ground mesh based on height. This post got me started and led me to my first successful prototypes of digging and terrain deformation/texturing. While the results made me giggle with delight, I've only dealt with half the issue...digging. A new challenge still awaits solution...and that is 'piling' new dirt on top of the terrain and texturing it 'differently' than something that has been 'dug'.
If the user piled dirt on top of grass, my current technique could deal with it just fine...I could simply create the rule that anything 'above' the height of the baseline grass would be textured with dirt. But....imagine if I were to leave that logic alone....and a user dug down to a certain level (say bedrock) and then began piling dirt there. The current texturing algorithm would dutifully apply the dirt texture...then bare earth.,..and eventually grass where the user was adding earth!! NOT what we wanted. So...my current plan is to create another uniform (array variable) that indicates that a particular vertice is 'dirty' (pardon the pun) and to NOT apply the normal texture blending algorithm...but instead texture as dirt REGARDLESS of height. This array would be updated whenever the terrain was deformed (dug or piled). That's next on my experimentation list...to ensure the technique works and looks reasonable.