Transparent texture best practice

Hi there,
i’m trying to simulate a lighting exit sign, but i’m not satisfied of the result.
This is my PG: https://playground.babylonjs.com/#4177LT#3
To build the material i’ve used nme (you find the link on top of the PG): Babylon.js Node Material Editor

What i did is to use an opacity map to make transparency. The idea is to apply the texture only on one face using UV (like i did in the PG) and then use some highlight effect to meke it shining.
The problem is that the effect is too vanishing, i’d like to show also the colors of remaining cube faces, but even if i set the faceColors array, seems not to work. I play with bounding boxes, but i don’t like the result (see line from 34 to 37.

Any suggestion?
Thank’s and happy holidays

@Evgeni_Popov is the best for this :slight_smile:

I don’t really understand the effect you want to achieve…

It seems the other faces are green, is it not what you want?

Also, have you tried to use the glow layer instead of the highlight layer?

Testing with the glow layer:

1 Like

Thank’s, with glow layer seems much better.

Yes it is what i want, but in my PG they are not green, it’s only higlight green. If you turn off highlight all other faces are transparent, even if i set faceColors. this was my problem. But in your PG, with glow layer now are visibile.

Ah ok, you’ve changed also my nme.

Yes, I have changed it so that the green background of the diffuse texture is visible on the cube.

Ok, there’s only a thing a really don’t understand.
Why the faceColors array doesn’t override the cube faces colors?
In this PG i did something similar: https://playground.babylonjs.com/#HBRF92#36 and it works!
Where is the difference or where do i mistake?

That’s because you have to use the mesh.color block in your node material, which corresponds to the vertex color:

Ok, understood. So i can avoid using texture node and only the opacity map https://nme.babylonjs.com/#38IA14#3
I think the result is the same.

Thank’s :wink:

2 Likes