I have a bit of a pickle trying to get the toon shader working on my model. I decided to try and hack this together in a playground here:
But as you can see, the model is pretty much black after I try to replace my emission material with the node material. Could someone explain what I do wrong here
Also, not sure if this is due to this particular node material being “old”, but touching the “Light Information” -node seems to crash the whole editor Take a look: https://nme.babylonjs.com/#81NNDY#126
Sorry for the spam, I have some other question as well. I updated the model since I forgot to add an texture for the body… And then there was some weird depth/transparency problems that I could not get fixed without setting:
cnm.needAlphaBlendingForMesh = () => false
But I do now know how to actually set this initially from the node material editor? Could someone advice me on this?
Here is the latest playground with the line that “fixes” the problem.
Hmm I took a look at the NME and there isn’t a way to set the transparencyMode (which setting to opaque would solve your problem), only alpha mode… any objections to just adding it here @PatrickRyan ?
And the reason we have to set the transparency mode is because of this material that does use alpha blending, so it ends up turning alpha blending for all the meshes I think (is that right @sebavan ?):
@Panuchka, what is happening is that your mesh has vertex color baked into every vertex. It is set to Color4(1, 1, 1, 1) which gives the vertices an alpha value. If the mesh has data for alpha or a node material has a value wired to alpha, the material will be considered to be in alpha blend mode.
The easiest way around this would be to remove the vertex color from your mesh. The other would be to explicitly set the Transparency Mode on your material which will override the automatic assignment based on mesh color alpha or nme alpha connection. You would do this with: