View Single Post
# 4 03-02-2013 , 04:57 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Just for the sake of posting something here in years I though I'd present another way of doing this. This gives you a little bit of control over the flickering. The $fFreq controls the speed of the flickering. $fMinIntensity is the threshold value the noise function has to exceed in order to turn the light on at all. $fMaxIntenxity does what it says on the tin. Another plus side is that you'll get always the same results.

Code:
float $fFreq = 15.0;
float $fMinIntensity = 0.5;
float $fMaxIntenxity = 1.0;

float $fIntensity = $fMaxIntenxity * .5 * (1 + noise(time * $fFreq));
if($fIntensity > $fMinIntensity)
	pointLightShape1.intensity = $fIntensity;
else
	pointLightShape1.intensity = 0.0;


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!