About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Candle Light Question
Author Message
dmkap Offline
Member

Post: #1
Candle Light Question
Hey guys, first post here, and sorry if this has been asked before or if a tutorial covers it..

Would anyone be able to point me in a direction to create a "light point" that pulses / flickers like a candle? I want to make sure I'm not overlooking a built in feature of Esenthel maybe with the use of pallets before i go ahead and create something unique.

Any pointers or suggestions or tutorials that might cover this question of creating a light source that emulates a candle flicker would be very helpful.

thanks ahead of time.
04-24-2013 08:49 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #2
RE: Candle Light Question
The usual way of producing this is to create an algorithm that introduces some random variation in intensity over time. This combined with a decent candle flame animation or particle effect is usually sufficient to create the illusion.

I'm not aware of anything built into Esenthel to emulate this but I'm new to Esenthel too so I can't say for sure.
04-24-2013 09:50 PM
Find all posts by this user Quote this message in a reply
Ecco Offline
Member

Post: #3
RE: Candle Light Question
..im new kid here too, so i cant say for sure, but this is way I do it and it does very nice job and by changing values for 'flicker_delay', you will have different frequency of random flickering..additional tuning for your taste you can do by changing range for random values exposed '(rand() % .8, .1)'

void Flicker_My_Candle(float Original_R,float Original_G,float Original_B)

{
float glow=0.0,lum=0.0,flicker_delay=0.23;
float R,G,B;

glow = cos(system_time_in_millisecs) * flicker_delay;
lum = (abs(glow * sin(glow)) * 255) * (rand() % .8, .1);

R=Original_R+lum;
G=Original_G+(lum/2);
B=Original_B+lum;

//Here color your light with R,G,B
}
(This post was last modified: 04-25-2013 01:41 AM by Ecco.)
04-25-2013 01:41 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #4
RE: Candle Light Question
Take a look in Light.h. You would want to use LightSqr for this. Then just adjust color (and range too) using an algorithm like Ecco's to control them.
04-25-2013 01:57 AM
Find all posts by this user Quote this message in a reply
Post Reply