Jump to content
  • Advertisement
Sign in to follow this  
LordSputnik

OpenGL Candle Light

This topic is 3413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!