Jump to content
  • Advertisement
Sign in to follow this  

Faking Area/Volume Lights

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

[Rather long post follows]

There was a post here recently about (almost certainly faked) area lights in Deus Ex 3 that rekindled my interest in incorporating area lights into a real-time renderer.
The upcoming real-time global illumination methods should do this more or less for free (at least the good ones), so I doubt there's much need for specialized techniques, but -- well: I spend the last few days wasting my spare time with this stuff and I wanted to show off some pictures at least. ;)

Here are some screenshots and a little demo of what I got so far:

This is the demo.
It still has some problems, but overall I think it's ok. Some of the problems are:
- Too much dithering
- Boundaries between VPL clusters are visible
- Volumes get clamped too soon
- Window not resizeable
(It's my first ClickOnce installer, so I'm not sure it works correctly. Also: read the readme!)

For those interested in details, I implemented the following three techniques:

1. Place point light at closest point on light surface

Find closest point on light shape in shader and light as if a point light source was there.

- Need a fast way to find closest point
- Can be seriously off from a radiometric point of view, preserves only the rough shape of the reflection
- Ok for (mostly) diffuse surfaces, glossy surfaces reveal the fake quickly
- Ok for the narrow range of distances where a single point/ambient light is not yet usable and a 'real' area light is not necessary.
- Light must have single color

2. Precompute irradiance volume

Compute an irradiance volume 'around' the light, project irradiance into a low-order SH basis (I use just 2nd order), pack into 3d texture, look up in shader.

- Real area/volume light for diffuse surfaces (apart from visibility)
- Emitted Radiance can vary on surface / in volume (e.g. with texture)
- Hard to fake glossy reflection
- Limited interactivity (only rotation, translation, and scaling the intensity are straightforward)

3. VPL cluster

An Instant Radiosity like approach where you place many VPLs on the surface / in the volume of the light.
Do reduce shading costs these are clustered with some perceptual error metric (which I haven't found yet).
The shader then selects a cluster depending on the distance of the point being shaded.

- Basically all points from the irradiance volume technique, but
- It can handle glossy surfaces to some extent (but it quickly gets too expensive)
- Single VPLs can get visible on glossy or very close surfaces.

And finally I also have three questions:
Question1: Does anybody know a good (perceptual) metric for clustering VPLs?
Question2: Does anybody know a good way to fake a glossy reflection with an irradiance volume?
Question3: Has anybody ever bothered to support dynamic area lights in a game? Or is it generally considered not worth the effort?

Share this post

Link to post
Share on other sites

Have you thought about using Light Propagation Volumes (ala Cryengine3) for this? That is, have a small number of "cascades" of radiance cache volumes that slide around with the camera, and render your emitters into those (perhaps by rendering a dense set of surface points). For glossy reflection, cast rays through the LPV (ouch).

Share this post

Link to post
Share on other sites

Have you thought about using Light Propagation Volumes (ala Cryengine3) for this?

Yes, they are on my list. And I guess they will beat the other techniques when it comes to practicality, but it would be interesting to see how you have to adjust the parameters to get a particular quality level when they are used mainly for direct illumination (brighter and a bit higher frequencies than indirect).

Share this post

Link to post
Share on other sites
Glad to see my little post was beneficial to other people. Maybe I can offer some input.

Question 2:
Well, I know you can get a decent specular approximation if you use an Ambient Cube basis instead of Spherical Harmonics. If you have concerns about storage costs, you can use an approximation developed by Monolith Productions. Their's just has directional intensities instead of colors, with one color per Ambient Cube cell. For more info, check out their Gamefest presentation about Lighting Volumes.

For some good visual examples of this tech in action, check out this blog. This entry, in particular, has images of the specular approximation in action.

Share this post

Link to post
Share on other sites
Thanks for the links.


check out this blog

This blog has one more follower since today. :)


Gamefest presentation about Lighting Volumes

Actually I implemented the trick with the reflection vector from the gamefest presentation, but I couldn't get it 'glossy enough' for close and bright area lights.
I think ultimately the problem is that I look up an IRradiance value and not a radiance value. And to make it worse it gets 'blurred' a second time when it is projected into SH.
Maybe the ambient cube will really help with that, I have to try it.

What I'm doing now is something like they mentioned in this presentation:
Just do Blinn-Phong for a directional/point light with the direction/source of highest irradiance.
Compared with the technique above this has the opposite problem.
It lets surfaces appear too glossy (in a way it reduces the area light to a point light), but overall it just 'feels' better.

Irradiance volume:

VPL cluster:

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!