I am trying to create a two tone shader following the Create Your Own Toon Shader youtube video from Nick from BabylonJS team.
To test shaders and debug I created this simple playground with a spotlight rotating around the sphere.
It uses the ParseFromSnippetAsync so we can easily load some NME shaders to illustrate what I am not understanding or getting right here.
Before loading a nodeMaterial the lighting appears normal or lets say “default” if not realistic. But when I am building the shader it quickly flips for lack of a better description. One would assume that the ambient color not be colored first and then specular highlights on the back of the sphere, away from the light? SI am new to this so its probably somthing obvious I dont understand.
// Final version of BJS shader from guide
The completed shader #81NNDY#2 can be used to illustrate the issue, but the problem appears for me as soon as I have gotten the N Dot L and feed it into the fragment shader the issue is there.
// Start of shader
Can someone smarter than me point out what I am missing?