How to make mesh material fire like traffic light

Hello guys,
I have function Blink() and stopBlink() and I can activate blink between red and black.
I want my red color fire like trafic light
any function ?

Best regards

Anes

You could simply lerp the color or use an animation:

https://playground.babylonjs.com/#H09KGB

@sebavan I animate my blink button, the problem is that my button is red so I want when I blink it the red sunshine more like trafic lights like this, the green light fire

I am sorry I do not understand what you are trying to achieve :frowning:

If it is the glow effect, you could take a look at the glow layer in the doc.

I got you fam. Give me a second.

UPDATE
ok here is the base for a test example:
https://playground.babylonjs.com/#47F0FH

Ill get it blinking for you now.

UPDATE2
https://playground.babylonjs.com/#47F0FH#1
Now to add the glow layer.
https://playground.babylonjs.com/#47F0FH#2

:slight_smile: BJS is awesome… that took all of like 15 mins which included me getting up to reheat my coffee…

4 Likes

@Pryme8 thank u so much it helps me but I have a problem :stuck_out_tongue:

I import three meshes from blender (they have the same material).
when I use mesh.material.emissiveColor= BABYLON.Color3.Red() I see that the 3 meshes blinks in the same time, I thought that because of object in JS passing by reference, so I recreate new material of each of my imported meshes (new materials) in order to avoid that they blink in the same time.
is this the best solution ?

thank you

can you make a demo scene?

I bet its because they are instances or clones. Or it might be that they are a single mesh? Im not sure id have to see what you got going on.

1 Like