Hey guys!
I'm trying to create a flickering light on a mesh in UDK (and believe me, I made sure to trawl the nets; this is a pretty common newbie request), and I can't quite get it. Instead of merely getting it to pulse, I wanted it to mostly be on, then flicker off/on, and back to on again for a while. The math part of this is really hard to nail down - what I'm missing is the ability to get the light to "pause" whilst on, then flicker off and back on again.
Couple references:
[ame="
http://www.youtube.com/watch?v=_XBkCkq-eKA"]Flickering lights Experimental - YouTube[/ame] - The one at the beginning is a good example of what I want; a quick flicker while the light mainly stays 'on'.
[ame="
http://www.youtube.com/watch?v=CnnGYaqjW-A"]Einstürzende Neubauten Sabrina - YouTube[/ame] - The light right at the beginning is also a good example. Plus it's a kickass video and song.
Also, here is where I'm currently at:
I get the light staying on, with some quick pulses. Not ideal, but workable. If anyone's wondering, it's for a fluorescent light bulb mesh. Any help would be SUPER appreciated! You guys rock.
Replies
Suggestions:
Your main on,vs flicker period should have a ceil as sprunghunt mentions. This will effectively make the sine wave a square wave. On or off only.
For the flickering behavior try:
constantClamp[0-1](sin(3/x)*sin(5/(1-x)) (where X is 2*Frac(time * some speed value)) this gives a rather erratic flicker behaviour. The most interesting part of that function is for values between 0 and 2.. hence the multiplication)
If you take the max of your clamped long period sine, and the lower one, you'll get a flicker with sustained on periods. Depending on the frequency differences you won't always get the same flicker pattern either.