Blend 2 textures

I want to blend 2 textures, basically overlay texture 2 on top of texture 1 and only those parts of texture 1 should be visible where texture 2 has black colour or the alpha is 0.
I know this can be done using shaders but not sure how to write them yet.

1 Like

You can do it with Mix Material - Mix Material | Babylon.js Documentation

3 Likes

but it requires 4 minimum diffuse textures, and i only have 2

Another option is to use Node Material like here - https://nme.babylonjs.com/#12YPTW#4

1 Like

If you only need to do it once, maybe it would be more ideal to use a dynamic texture?

Thanks Node Material is a great tool, I know how to do it in unity, but can not find a similar node to Blend, with override option. I want to achieve a similar effect in Babylon

Im still not convinced you need to do this on the GPU. Are they going to be updated more than once/realtime or is this something you can combine them into a single texture then set that as the albedo/diffuse?

one of them is going to be a video texture and one static @Pryme8

A procedural texure might be the way to go ?Node Material Procedural Textures | Babylon.js Documentation

1 Like