MixMaterial and Shader

Hello! Just wondering what options do I have if I want to apply a vertex & fragment shaders to a terrain using MixMaterial? Is it even possible or do I have to figure out some other way?

You mean you want to add extra code to the vertex/fragment shaders of MixMaterial?

There is no way to do that currently, you will have to create a new ShaderMaterial by copying/pasting the code from MixMaterial and adding your own code.

1 Like

Another option would be to use the Node Material Babylon.js Node Material Editor (babylonjs.com), it’s not too much work to add the mixing functionality on it

Tried to make some sort of Node Material that would mix the textures similarly as in MixMaterial.

Any ideas how do you combine these two outputs in a way that the black pixels would be opaque and the rest of the mixmap2 texture overrides the first ones textures? Now it kinda blends together in a nasty way.
@carolhmj @Evgeni_Popov

I guess this works, it’s slapping the textures together in almost similar fashion:

3 Likes

Another example here - https://nme.babylonjs.com/#12YPTW#4

1 Like