Hi all !
My current project is about studying methods and algorithm for real-time global illumination. The main goal is to adapt theory from actual research and integration into next-gen video game engine.
So I have started to read a lot of research papers, thesis, publications, but none can be really applied to real-time or fulfill video games requirements. For now, the best I have is the PRT/SH stuff and also irradiance volume.
But before adapting and developping this, I would like to know if any of you have already try to implement such kind of methods before.
I also know next-gen games already used advanced lighting technics, like Halo, Crysis or Unreal3, or even middleware like Lightsprint, Fantasylab or Geometrics... but there are no way to know how they did...
Thanks for those who have already studied / implemented such stuff for their tips and tricks.
Global illumination vs Real time
Started by Shirakana, Feb 12 2008 02:52 PM
5 replies to this topic
#1
Posted 12 February 2008 - 02:52 PM
#2
Posted 12 February 2008 - 03:53 PM
I've implemented realtime global illumination into my game engine, but the whole engine is based on hybrid rasterizing/raytracing rendering approach (and I'm planning just raytracing in future, cause there are many issues rasterization/raytracing rendering). It's based on radiosity equation, which is described in mathematical formula here - http://en.wikipedia.org/wiki/Radiosity and shooting rays - so it's pure raytracing method. Anyway raytracing is damn slow even on todays hardware (you have to use parallelism, very often use assembler for performance hard parts, you don't have to use OOP, etc. - so it can be in realtime in the end, even fast for standart resolution 1024*768), but the biggest downgrade is, that you need to know lot of math and it's difficult to programme that. (One of the best tutorials with description are there on devmaster, I started on them few years ago).
#3
Posted 13 February 2008 - 09:19 AM
Thanks Vilem, I've read some research papers about RT using GPU but I think none are suitable and fast enough for video games yet.
#4
Posted 13 February 2008 - 01:20 PM
I tried the irradiance volume thing some time ago. It looked ok, but I wouldn't wanna use it in a game yet. I took some shots of it:
"Stupid bug! You go squish now!!" - Homer Simpson
#5
Posted 13 February 2008 - 01:38 PM
Yop, raytraced global illumination isn't fast enough to run on todays mainstream CPUs in realtime, i'm trying to implement fast raytracing using CPU into my engine (it works, but still not best framerates on dual and quad core CPUs - with lower quality GI!!!). Anyway there is a way how to compute GI in realtime using rasterization! (raytracing is way too, but it's very hard way). ATI demo showed how to compute that in realtime using power of newer high end hardware. So lets look how GI works - every patch is accepting illumination from a)-sun and b)-every-another-patch. So we can write recursive function to copute radiosity in real time. First you have to create patches (they can be F.e. pixels) and now take so-called hemicube from that patch and compute average illumination (first time scene is lit only by direct light and it needs to be shadowed!!!), you must do this for every patch. Pseudo code:
Pros:
- Easier to implement
- Runs in realtime on todays high-end hardware
Cons:
- Not physically correct
- Quality highly dependent on patches size (patch size=pixel size would be best, but that would really kill your fillrate)
- Quality is dependent on samples this like - low quality = 1 sample, medium quality = 4 samples, high quality = 16 samples, etc. (so quality is increased like logarythmical spline).
- Well, pixel operations and their speed is increasing more faster, than fillrate on card, and this needs less pixel operations more fillrate...
Anyway that runs good for static objects, radiosity for dynamic objects can be achieved much more quickier, use just low res cubemap as diffuse reflection on object.
At last this method would give you just diffuse-reflection, for specular reflection you'd need to use F.e. caustics mapping (ask google about that). I personally use raytracing and hard-way to implement it to be fast enough, so I haven't problems with GI (well, but that can handle just GI at the moment on current CPUs - it's still not the most optimised code yet, I'll keep working on that), I can handle diffuse reflection and specular reflection too ... but it's not fast enough for video games (It just can't run on mainstream and it runs on high end with low-quality GI).
for(i = 0; i < numberOfSamples; i++)
{
for(every patch)
{
renderHemicube;
calculateAverageIllumination;
setPatchColorAsAverageIllumination;
}
}
The more samples you'd have, the higher quality you get. Anyway this calculate you direct+indirect illumination, but it'd kill your fillrate, so there's need for optimisation. You have to create some kind of tree and update only patches that needs to be updated. This could give you some decent quality radiosity.Pros:
- Easier to implement
- Runs in realtime on todays high-end hardware
Cons:
- Not physically correct
- Quality highly dependent on patches size (patch size=pixel size would be best, but that would really kill your fillrate)
- Quality is dependent on samples this like - low quality = 1 sample, medium quality = 4 samples, high quality = 16 samples, etc. (so quality is increased like logarythmical spline).
- Well, pixel operations and their speed is increasing more faster, than fillrate on card, and this needs less pixel operations more fillrate...
Anyway that runs good for static objects, radiosity for dynamic objects can be achieved much more quickier, use just low res cubemap as diffuse reflection on object.
At last this method would give you just diffuse-reflection, for specular reflection you'd need to use F.e. caustics mapping (ask google about that). I personally use raytracing and hard-way to implement it to be fast enough, so I haven't problems with GI (well, but that can handle just GI at the moment on current CPUs - it's still not the most optimised code yet, I'll keep working on that), I can handle diffuse reflection and specular reflection too ... but it's not fast enough for video games (It just can't run on mainstream and it runs on high end with low-quality GI).
#6
Posted 14 February 2008 - 02:38 PM
Thanks for explanation
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












