I’m working with NME for the first time. Trying to build a simple low-poly Ocean Shader. I found the following two introductory tutorials, that I have tried to follow:
Vertex Shader: Node Material Editor: Vertex Shader - YouTube
Fragment Shader: Node Material Editor: Lights and Textures - YouTube
I have been able to follow the vertex shader without issue and can get a working sine wave. However, am really struggling to get a basic Fragment Output consistent across the NME & scene.
This is my node setup & material preview:
In my scene however, it renders white, with the occasional blue/black triangle. The mesh I am rendering on is a plane that was subdivided and then had it’s faces triangulated.
My scene lighting does contain a HDR that I added with the following code, and I can only think that the node setup is struggling with the HDR for some reason?
const hdr = new BABYLON.HDRCubeTexture("/assets/hdr/sample.hdr", scene, 512);
scene.environmentTexture = hdr;
If I use the default material, then I do get a nice output, but I’m hoping to use the node editor in order to give myself more control over the waves (via vertex output).
All help truly appreciated. Thank you