Skip to main content
gamedev.net
🔒 Locked

Candle Light

Started by LordSputnik 0 replies 1.7k views
Original Post
LordSputnik
LordSputnik
Well, after reading most of the lighting section of the Red Book, I was thinking about the best way to acheive the flicker of a candle light, and I've come up with a method, but I'm not sure if it's the best one... I've searched around a bit, but I can't find much on it. I'm quite new to OpenGL lighting, so if it would involve complex shaders, I don't have a clue. :) Ok, so, I'd make a light, in the position of the candle. Then, each frame I'd alter the position ever so slightly, and vary the brightness of the diffuse and specular light emmitted from the candle, using two random numbers generated within a specific range as the position and light intensity offsets. If there's a much better way of doing this, which there probably is, don't hesitate to tell me! :D - Sput [Edited by - LordSputnik on May 20, 2009 3:05:03 AM]
zedz
zedz
heres what I think the best method is

your candle gets drawn as a particle system right?
simply find the average pos (~middle) of all the particles place the lights center there, u can also vary the lights brightness based on the number of particles (u might wanna lerp this value though)

this is what I do with fire/fireballs etc + looks perfect

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.