• Advertisement
Sign in to follow this  

Reflections from area light sources

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

Hello everybody,
 
Starting a new topic for old thread:
 
First post here. It's not really a 'beginner's question', so I hope I'm not out of line posting this here. If I am, please suggest a different forum for this post.
 
I've been looking into reflections from area light sources of polygonal shape, and have found a method to achieve this, with a working implementation in glsl (which I'd be happy to share, if anyone's interested). I'm not working in the gaming industry, but I occasionally do some rendering stuff. Just that for the applications I'm working on the demands for real-time performance are not quite as extreme as I would imagine for a typical game, so I can afford a little bit heavier shaders. Thus, enter area light source reflections.
 
So,
 
I found the paper/video from siggraph mentioned in the thread above (some 4 months after the publication of the talk, I'm apparently not that proficient at 'googling' this 'internet' thing anymore). I'm curious if anyone has given the method a try, given the sparse information? The patent discussion worried me a bit, anyone knows the status on that?
 
Cheers,
G.
 

Share this post


Link to post
Share on other sites
Advertisement

I have never read that paper so far, yet I do have an implementation of "area lights" (which have solid performance, yet they are definitely not 100% accurate).

 

The basic idea goes as following - each single area light (whatever the shape is), can be de-composed to some basic primitive (for me basically rectangles were enough (e.g. quads); although I've decided to re-work some parts of this and support triangles directly). Now the ideas went and were implemented as following:

 

Implementing single rectangular untextured light - there are 2 light components that need to be calculated -> diffuse and specular.

For specular, I've used simple math - as I use deferred renderer, I have a position and normal of each pixel in scene, from here I calculate reflection vector and do a ray cast. If I get intersection than I can basically calculate the color using a BRDF-like function. Of course this yields a hard reflection, but one can always use multiple samples and randomness (based on surface roughness) to achieve rough-surfaces. Nevertheless with normal mapping it really looks good.

 

For diffuse, it has been a bit more tricky - now for small area lights you technically can calculate lambert against a center-point of  the light, and as an attenuation you calculate distance from closest point on rectangle (which is actually projecting point onto plane and then checking whether you are in bounds of rectangle or not). For larger area lights, again, multiple points (aka sampling) works good.

 

Now, the real challenges were 3 - changing shape of light, adding projective texture for light and using multiple lights.

 

First two things can be handled quite easily - you can project each point to the plane using some projection and use that for projective texturing (with clever mip-map selection based upon distance it looks really cool); changing shape of light is now straight forward - by changing texture (using alpha channel for me, but you could also use color-key). Dang, two things handled simply.

 

Last one is tricky - now if your number of lights is quite low you can brute force it. In case of high number of lights I go with BVH approach (e.g. build bounding volume hierarchy on top of that to increase ray cast performance).

 

There is yet one more thing to solve, your light (specular and diffuse) is visible through walls, etc. But with good shadowing algorithm this problem is can be dealt with quickly.

 

If you are particularly interested in some cases, I could provide some math with explanation (and possibly pseudo-code/code in case you want to implement it).

Share this post


Link to post
Share on other sites
I rather like the approach with projective texturing + mip-mapping, it makes sense and I can see how that will make for plausible reflections. Will have a stab at that, I think I'm equipped to make an implementation (number of lights is low).
 
Thanks a bunch!
G.

Share this post


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

  • Advertisement