Jump to content
  • Advertisement
Sign in to follow this  
ArKano22

glsl area lights

This topic is 3211 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

Has anyone implemented efficient rectangular area lights with glsl? (by efficient i mean not just a grid of point lights) I need them for a scene where some cubes emit coloured light from one of their faces.I have a half-cooked approximate implementation but i do not want to reinvent the wheel if possible, so any advice on this is greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
This is usually handled with global illumination, or a ray casting renderer. Baked to a light map if needed to be drawn in real time.

Share this post


Link to post
Share on other sites
Quote:
Original post by bzroom
This is usually handled with global illumination, or a ray casting renderer. Baked to a light map if needed to be drawn in real time.


Yeah, but i need it to be completely dynamic and realtime, just like a point or spot light. I recently saw a post about bezier path lights, another kind of light useful for various effects, and i wonder if anyone has an area light implemented.

Share this post


Link to post
Share on other sites
That bezier light is rather broken. Using the same method for an area light would have the same pitfalls (obviously :)).


There's only one way to approximate the light contribution of a continuous surface like that, and that's sampling. A ray caster samples, multiple lights is a form of sampling. You'll have to accept some level of granularity there's no way to get an exact solution.

Share this post


Link to post
Share on other sites
You could just do it like a shadow map where the cube side is your projection surface. I think there was an example of this in the nvidia sdk10.

Share this post


Link to post
Share on other sites
thanks for the info, but sampling multiple lights is too slow for my budget :P.

I´m implementing it, well, not a true area light, just an approximation based off a spotlight. Right now it is a disc shaped area light, when i get it to be rectangular i´ll post both here for people to use them if they want.

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!