• Advertisement
Sign in to follow this  

Real-time global illumination (PRT lighting)

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

I've been considering implementing a real-time global illumination I have an indoor/outdoor scene (like a city model), the geometry is static. but I need the lights to be dynamic, and I don't care so much if the lights are low-frequecy and have very soft shadows. it has to be fast and just give decent results in both mixed indoor/outdoor scenes I've checked out SH PRT lighting, which I think is the most popular of all and easier to implement on D3D, but does that method have great limitations in indoor scnenes, does it support point lights in general ? is the PRT suitable for my purpose ? if it's not, is there any other method that can run pretty fast on current hardware ? thanks

Share this post


Link to post
Share on other sites
Advertisement
the only limitation of PRT is the static geometry i think. It should work for all kind of lights.

regards,
m4gnus

Share this post


Link to post
Share on other sites
thanks for the input
but I've heard from different sources, that SH is not very well suitable to indoor scenes and near-distant lights.
and I was checking out the dx-sdk for the functions of SH evaluation for different light sources, and there was :

D3DXSHEvalDirectionalLight
D3DXSHEvalSphericalLight - Approximates local spherical light sources. (Note that PRT only works with distance lighting environments.)
D3DXSHEvalConeLight
D3DXSHEvalHemisphereLight

is Spherical light actually a point light ?

there is also a paper here :
http://www.ati.com/developer/gdc/Oat-GDC04-SphericalHarmonicLighting.pdf
which addresses this problem and has a wierd method of indoor/outdoor lighting, by manually selecting blockers for each mesh in the scene, and grouping lights.
and I didn't really understand it's concept, because actually, every static object inside a room must cast shadows and lighting on to it's suroundings, no matter it's indoor or outdoor light, doesn't it ?

Share this post


Link to post
Share on other sites
SHL in its classic form does not support local lights. The point and spot lights are statistical approximations, and at short range they do not look particularly good. This, unfortunately, is an area which has not yet been adequately solved for current hardware.

What sort of dynamic lighting will there be? Attached to the viewer, switched on/off, swinging from a chain,...?

Share this post


Link to post
Share on other sites
You might look into "Ambient Occlusion". It really depends a lot on exactly what you trying to light, how fast things move, etc. In the end, you may be able to opt for a much simpler light model depending on the constraints you can impose on your environment

tj963

Share this post


Link to post
Share on other sites
Quote:
What sort of dynamic lighting will there be? Attached to the viewer, switched on/off, swinging from a chain,...?

every kind of dynamic like, the only limitation is that the scene is static, but the lights has to be fully dynamic in every way, and the quality does not need to be perfect afterall, in my case, performance is more important.
so what you mean is, SH lighting for indoors is not worth it at all ? even with a lesser quality ?

Quote:
you might look into "Ambient Occlusion".

thanks, could you comment on some differences between AO and SH ?
all I know as a newbie is, ambient occlusion does not represent light Interreflections, and we have to do direct lighting and shadowing on the entire scene for any number of lights, so it has a major performance drawback compared to SH , doesnt it ?

Share this post


Link to post
Share on other sites
Quote:
Original post by sepul
Quote:
you might look into "Ambient Occlusion".

thanks, could you comment on some differences between AO and SH ?
all I know as a newbie is, ambient occlusion does not represent light Interreflections, and we have to do direct lighting and shadowing on the entire scene for any number of lights, so it has a major performance drawback compared to SH , doesnt it ?


All I can say is that 'any number' could be an awful lot of lights, and the more lights you have the worse the performance, no matter what method you use.

I s this for a general purpose engine, or a specific type of game?

Share this post


Link to post
Share on other sites
Quote:
I s this for a general purpose engine, or a specific type of game?

it's actually urban kind of environment, for example a small city model with mixed indoor/outdoor scenes.

and as for the performance issues, what I thought I can do is, seperate outdoor/indoor areas in the editor, and compile PRT for outdoor scenes, and make occlusion maps for indoors, and do a seperate lighting.
the engine uses occlusion culling, and as the outdoors are more geometry intensive, I can use SH lighting for outdoors which is faster and more suitable, and do AO with conventional lighting for indoors, how about that ?

are there any other GI methods that can be applied, and not as expensive as Ambient occlusion ?

foretunately, I'm targeting for GF7+ generation cards, cuz the engine is not gonna be done anytime soon.

Share this post


Link to post
Share on other sites

You might want to look into this:

http://graphics.ucsd.edu/papers/plrt/

It's a PRT extension that appears to do a great job supporting dynamic lights in static environments. The preprocessing is pretty blasted expensive though. They compute a full GI solution for a giant grid of light positions, apply lots of fancy compression tricks to it, and then interpolate between stored SH coefficients at run-time. It's probably still a memory hog, despite the compression.

I haven't tried to play with it, but it seems like it's along the same lines as what you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by sepul
and make occlusion maps for indoors

You may also want to look at making radiosity lightmaps. They are cheap and look good, especially if you use a good generation tool. For example, in 3ds Max, you can generate the radiosity solution, and then do a Render-To-Texture on the lighting maps. Even better is using Mental Ray to do it, but that takes quite a while.

You can also do directional radiosity lightmapping, where you make three lightmaps, each on a different directional basis so you can do normal mapping as well. Check out the HL2 slides for info on that, if you are interested. Unfortunately, the convienient tools like Mental Ray don't support this, so you would need to write a plugin or something.

Share this post


Link to post
Share on other sites
Quote:
You may also want to look at making radiosity lightmaps.

they are static

Quote:
You can also do directional radiosity lightmapping, where you make three lightmaps, each on a different directional basis so you can do normal mapping as well

yeah, I've read about that, but they are static too

can 3dsmax bake ambient occlusion maps too ?

Quote:

You might want to look into this:
http://graphics.ucsd.edu/papers/plrt/

unforetunately that paper was hard for me to understand, guess I have to check back on it later.




Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ambient occlusion is free at runtime, it's only the precomputation step that's expensive.

Share this post


Link to post
Share on other sites
for complex scènes I wouldn't use PRT because it uses to much video memory. Simply the normalmapped static lightmaps for HL2, with a few dynamic lights casting shadows, would be the easiest and best looking solution if you ask me. It's rather cheap at runtime, and you get great results, so what do you want more :)

Regards,
Kenzo

Share this post


Link to post
Share on other sites
Quote:
Ambient occlusion is free at runtime, it's only the precomputation step that's expensive.

yeah, that's right, but you have to perform full light/shadow for each light in the scene.

for example you have couple of large batched static geometry, and number of lights in each of them, with AO and normal lighting, you have to light and shadow the batches for every frame and every light.
there are also some optimizations that could be done, like saving depth buffer for each light that doesn't move (for shadow mapping), and maybe use deferred shading as long as it doesn't need multipass rendering ?

Quote:
for complex scènes I wouldn't use PRT because it uses to much video memory.

yes, it requires alot of memory, but how about dividing the outdoors and indoors space, and compile PRT for outdoors only ? that will reduce the memory, and maybe we could tweak the number of weights (and PCA vectors) for vertices and reduce them without sacrificing the image quality.
with SH that you can draw the static scene, with one pass and pretty fast with all those fancy, SSS, interflections, soft shadows and other stuff, which is great for outdoor scenes, but I don't think that would be cool for indoors that has near local lights.

Share this post


Link to post
Share on other sites
Quote:
Original post by sepul
Quote:
You may also want to look at making radiosity lightmaps.

they are static

So are AO maps. However, it could be effective to use both:

- Use AO maps as a term for dynamic lights in the scene. This is cheap and makes them look better.

- Use radiosity lightmaps for static lights in the scene.

Quote:

can 3dsmax bake ambient occlusion maps too ?

Yes. Mental Ray is better at it though.

Share this post


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

  • Advertisement