Jump to content
  • Advertisement
Sign in to follow this  
lpcstr

Real time global illumination

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

Forgive me if I sound ignorant (I am) as I am very new to graphics programming, but wouldn't SSAO with HDR Image Based Lighting produce realistic ambient lighting? I figure SSAO would handle occlusion and IBL could handle things like indirect lighting and color bleeding. Could you use dynamic environment maps to achieve this?

Share this post


Link to post
Share on other sites
Advertisement
SSAO only handles very small-scale occlusion, and sometimes very poorly at that. Imagine standing in an alleyway between two large buildings: the area would be overall darkened due to the buildings but SSAO would only darken the creases where the buildings meet the ground. Capturing that large-scale occlusion is difficult and expensive if you want to do it all at runtime.

IBL is a broad term that encompasses a wide range of techniques that are based off a similar premise: using an image to light your scene. It doesn't intrinsically have any magic recipes for handling indirect lighting at runtime. With indirect lighting you basically start off with same problem you have with AO (you need large-scale visibility), compounded with the issues properly calculating the interreflected lighting terms. There's currently no silver-bullet solution for dealing with these issues...any solution that's not completely pre-baked will have significant limitations in terms of quality and/or performance.

Either way IBL, is definitely a great starting point for high-quality ambient lighting.

Share this post


Link to post
Share on other sites
If you want a quick solution, pre-baked maps are probably still the best way to go. You can use realtime lights with shadowMapping, and add a lightMap that contains the indirect part. However... it is static of course. You can use a Ambient Occlusion map instead, in combination with secundary pointlights. So for each lamp, add a second pointlight, multiply its result with the AO map. Not super accurate, but at least you have something for a relative cheap price.

Otherwise you can look into the Crytek papers (Light Propagating Volumes). But don't expect too much of it either. It tackles a lot of problems when it comes to scalability, and it doesn't require any precalculated data. But it still is a single-bounce technique, with pretty inaccurate results. In combination with SSAO / SSGI it can look pretty good though, see Crysis 2. But the real pain is that this technique is extremely difficult to implement. At least, I break my neck on their papers :) In super-short:

1.- Generate shadowMaps with additional data (like you do for normal direct lighting)
2.- Use those (small) shadowMaps to inject "virtual point lights" into a 3D texture (a grid). They actually use a cascaded (3) grids to cover the whole scene.
3.- Use the depth buffers from the camera and lights to inject geometry surface data into another set of grids. This will help you approximate indirect light collisions
4.- "Propagate" the VPL's from step2. This basically means you start spreading the light into the bounced directions over that grid, cell by cell. Repeat this X times. Use data from step 3 to (partially) block light so it won't travel through walls.
5.- Finally, use the resulting 3D textures from step 4 to apply on your scene. Each pixel you render can grab the light coming from several directions. They pack all this data with Spherical Harmonics by the way (and that's where I get stuck :P )


Or... you might want to think about using raytracing techniques in combination. Pretty advanced stuff, but not impossible. I'm not an expert on this, but gamedev member Villem Otte made quite some progress on that.

Share this post


Link to post
Share on other sites
There's also the Geomerics approach, where they pre-calculate form factors and visibility (using proxy geometry) at build time, then at runtime they point sample dynamic real time lighting and solve the system of equations to get radiosity. There's also disc/point-based GI developed/researched by Michael Bunnel.

Share this post


Link to post
Share on other sites

There's also the Geomerics approach, where they pre-calculate form factors and visibility (using proxy geometry) at build time, then at runtime they point sample dynamic real time lighting and solve the system of equations to get radiosity. There's also disc/point-based GI developed/researched by Michael Bunnel.


Lionhead did something similar, but added some neat things about the distribution and shape of their probes and etc.

Ultimately though the only "realtime" application I can think of is Crytek's spherical harmonic probe grid and possibly something Wolfgang Engel showed off briefly in a video but never explained. Either way those appear to be very limited in the range their light bounce can propagate, and for Crytek's it's even limited in how fast the bounce can propagate.

So while there's no great "realtime" solution yet, with next gen hardware and the right techniques that will change. I've been doing a fun thought experiment to see how you could get something like the Englighten/Lionhead approach to work with Crytek's localized grid. After all most really "dynamic" objects in games are usually small, and so you're probably only going to notice any bounce/occlusion from them at short range anyway. Combined with the semi precalculated approach of storing visibility (and adjusting whenever need be, like when a building is destroyed) it should produce some nice results.

Oh, and Bungie casually mentioned an engineer came up with something even better than spherical harmonics, at least memory wise, but never said if they were going to tell anyone anything about it.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!