glsl area lights
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.
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.
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.
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.
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement