Post details: Three Blinking Lights

Three Blinking Lights

Xpresso, Tips & Tricks, Textures, Procedural - by:
December 15th, 2007

It's the time of the year to do another Blinking Lights setup. I made this one for an online client and I will explain how its done.

xmasblink

[More:]

This method of blinking works on the luminosity and glow channels of textures.
So lets start with 3 identical textures.
Drag them into the xpresso editor like this. And open the Enable Glow and Enable Luminosity ports.

drag-texture

Now add a user-data slider in reals from 1 to 100 (not 0). This user-data will set the speed of the blinking in frames per light.

Blink-user-data

OK? Lets start with the xpresso thing that does the work.
We need a Time node set to Frame. Then a Math node set to divide. Connect the Time(frame) and the Speed(user data) to the divide.
Then add a Math node set to Modulo with a value of 3 (the number of lights) and set it to output in INTEGERS (This is crucial).
Then add 3 compare nodes set to == , the first has a value of 0, the second of 1 and the third of 2.
(side note: if you want more than 3 lights set the modulo to the value of the number of lights, make more textures and more compare nodes)

Now connect the output of the 3 compare nodes to the Enable Glow/Luminosity of the texture nodes.
blink-xpresso

That is it, make as many instances of the object containing the texture as you want.

and enjoy!

xmasblink

3 response(s) to Three Blinking Lights

  1. Dmm [Visitor] says:

    Hehe in the 2nd picture you make the orange *drag and drop*arrow from "MATERIAL[Light B]" to "Light A".... but its cool :P

  2. base80 [Member] says:

    The material is actually called LightA, B and C. So no error there.

  3. c2 [Visitor] says:

    Merci Base80 pour ton site
    et Joyeux Noël à toi aussi!!!

Leave a comment

URLs, email, AIM and ICQs will be converted automatically.




authimage

Options:
(Line breaks become <br />)
(Set cookies for name, email & url)