Node material editor

Hi,
I am using node material editor to create a custom mesh.
I have vertex color(input variable) and body color(passed as uniform) for a mesh.
I want to use body color if vertex color is (0,0,0,1.0).
Which block to use if we need to use conditional statements. ?
Material::useVertexColor () is used at the mesh level. Is there similar to that at vertex level.

https://nme.babylonjs.com/#EPY8BV#33

Thanks and Regards
Gopinath Vellingir

Hi.

I am not sure if this helps you but you can use Lerp as conditional block.

You create float and set it as boolean. False (0) will pass left value, True (1) will pass right value. You can control this Float value inside your code later to switch between inputs.

image

4 Likes

Hi @nogalo ,
I tried that its working fine.
Is it possible to have a condition like vertex Color is 0,0,0 or if its null, then I can assign body color.

Thanks.

There’s no conditions in the NME, so you have to be creative to emulate them.

For eg: Babylon.js Node Material Editor

If you set vertexColor to (0,0,0,0) you will get a red color for the output, else it will be green.

2 Likes

@Evgeni_Popov
Thanks. that’s cool. I’ll follow this way.