P-152: Virtual World Concept Update 110: Custom Materials and Shaders
After a few slight issues, I have managed to get a custom material mapped to my terrain. This allows me to specify a custom shader, which I intend to use to implement “texture splatting”, which is basically a way to blend multiple textures together in a smooth, organic way, without leaving visible edges.
This should allow me to texture the terrain based on the height value of each pixel, and implement normal maps, lighting, shading, and various other advanced techniques.
The main change that I had to make to get this to work was to change my material definitions to custommaterial definitions in code. The rest was fairly simple. I was actually able to follow one of my old tutorials from HERE. I had forgotten a lot of the steps involved with custom materials and shaders, and that tutorial was very helpful. I just needed to add the line “#include “hlslStructs.h”” to the beginning of the vertex shader, this wasn’t needed previously.
These images were taken after applying a basic “red shader” (and then changing the colour values) to the terrain.





