I went back and extended the SimpleMaterial sample to meet my needs. Works quite well so far, except that the ShadowGenerator sometimes does not generate a shadow. I asked another question today in this forum because it’s another topic.
@mattes3 Did you succeed in implementing a material for height dependant texturing with propper lightning/shadowing? I could use such a thing for my current project as well. I’ve played around with the worldmonger groundMaterial, but it lacks lightning/shadowing AFAICS.
Hi @holger,
yes, I succeeded in doing so. The shadows are cast on the terrain because I included the standard shader includes in my terrain shaders that I derived from the Worldmonger example. It worked pretty much out of the box because I used the SimpleMaterial class as a blueprint.
how are the standard shader includes included? I’m currently using the unmodified ground.fragment.fx and ground.vertex.fx shaders from worldmonger. Sorry, but I don’t fully understand I’m relatively new to this.
Any help appreciated!
You can find the included files pretty easily when you click “Find file” on Github and type some of the characters of the filename. Github will search the file for you.
Hi @mattes3,
thanks for the quick reply! As you suggested I’ve made a copy of the 3 simple* files and put them under the name groundMaterial into my project. Beside the renaming it needed no further modification to use them as a new material with a single texture for my terrain.
Now I need to make the neccessary modifications and patch the woldmonger code in. Please could you confirm if these steps are correct
modifying my new groundMaterial so it can handle the needed textures (ground, rock, sand, grass, snow, blend) and set the appropriate uniforms into the shaders
place the worldmonger fragment/vertex code at the right place (wherever that is ) into the shaders of the new groundMaterial to handle the height dependant texturing