Animate a light's cookie cutter?

Is there any way to animate the cookie texture on a directional light? Either by using a string of different textures or by just scrolling a single texture? If not, if I animate the position of a directional light (not it’s angle) will this essentially do the same thing?

Moving the directional light does this.

On top of that you can import a .mov file to make a small looping texture animation:
http://unity3d.com/Documentation/ScriptReference/Texture2D.frame.html

You can change the cookie itself by just assigning a different texture to light.cookie. So you’d have, say, an array of the textures and then assign one of them based on time or whatever.

Scrolling the cookie: yes, in the case of directional light this is done by changing the light’s position.

Wow, that was a fast reply! :smile:

What I’m thinking about is an underwater scene and how I’ll re-create the “caustic effects”. What I’d like to do is use a tileable texture for the cookie and be able to flip through a sequence of frames. I’m guessing that I can tile a quicktime movie, just like any other texture, right?

Would be nice to create a soft, real-time shadow also, but I’m a bit concerned about framerates…

For GooBall, we used a small looping quicktime caustic movie as a cookie for the underwater levels (+ lots of glow particles)

The scroll cloud lights in the gooball desert levels were just a tiling sky images attached to a scrolling directional light.

Both gave a lot of life to something that would otherwise have been very static.

Thanks for the help, I got it working in no time, jeez that was easy! :smile: