Real-time Ambient Maps (CryEngine)

Started by
25 comments, last by Dirge 17 years, 11 months ago
Hello again...

After approx 2 days of coding (i know i'm a little slow :) ), i finally finished the obscurance method as described in the 1st of the 4 papers i mentioned in a previous post.
Here is a video showing the technique in action. It's in wmv format. Size is 2.71MB and duration 46 secs.

I know that it's nothing fancy, but i wanted to test if it works like i expected. And it seems more or less ok. I mean there is a change in ambient color with respect to the light's position, and backfaces are getting some "bounced" light (this isn't really bounced light, but it fakes it).

In the video there is a room consisting of 62 triangles. The whole room is about 10 x 10 x 5 units, and it was subdivided into square patches of size 0.125 (approx 26688 patches total). The beta parameter from equation (7) was set to a high value (0.5) to exaggerate the back face lighting. Also light's intensity was set to a high value, in case to keep the original equations intact and being able to see the effect.

I didn't use lightmaps for the rendering. Instead i rendered the patches themselves. That's why it looks like point filtering! :)

What do you think? Is this a good approximation for ambient lighting? Suggestions/comments are welcome.

HellRaiZer
HellRaiZer
Advertisement
Looks cool, nice job for 2 days of work. Definitely too squarish/jaggy though, and most certainly not a real-time solution, but whatever, still cool. Why don't you submit it as an image of the day ;-)
"Artificial Intelligence: the art of making computers that behave like the ones in movies."www.CodeFortress.com
Quote:
Looks cool, nice job for 2 days of work.

Thanks. :)

Quote:
Definitely too squarish/jaggy though, and most certainly not a real-time solution, but whatever, still cool.

As i said i'm rendering the patches with constant obscurances for each one, so that's why it looks squarish/jaggy. This is the same results when you render radiosity illumination with patches. When i convert them to lightmaps (or more accurately obscurance maps) then i think it will look better due to bilinear/trilinear filtering.

As for the real-time part. Rendering cost is negible for the additional ambient term, if you have the maps. Of course the preprocess step is a little slow, but it can be optimized with some kind of tree (octree or bsp). What i'm trying to say is that it is 100% what you can safely call real-time. This is for static objects. I was rendering the patches (27000 of them) and still the fps was around 300! I think by using a texture it will be a little bit better :)

This holds true for static scenes. If you are talking about dynamic objects, then, yes, my implementation can't handle that in real-time :( But as you see in this the technique can handle dynamic objects very well in near real-time with object-to-object interactions.

Or, as an alternative, you can skip object to object obscurances (not so cool though). This way all objects with static geometry (either dynamic or static) can be preprocessed, because obscurance isn't dependent on any light. Of course for skinned models you can try something like nVidia's way on dynamic ao.

HellRaiZer

EDIT : One thing to mention about obscurance maps. As i said in the video there are about 27000 patches. This means that for this kind of resolution (which i think is good for ambient lighting), and with good packing, a 256x128 obscurance map is more than enough. So i don't think that texture memory can be an issue for this technique.
HellRaiZer
Quote:Original post by HellRaiZer
...


Sorry, didn't read the 1st paper - it is about having AO map for constant ambient term?
This is cool, but I think you need more complex geometry, to show the advantages of the technique.
Cornell box-type tests are really for color test, not obstruction one :)

P.S.: Good work, for 2 days! Respect!
Quote:
Sorry, didn't read the 1st paper - it is about having AO map for constant ambient term?

The equation for the ambient term is this (from the 1st paper) :

I_ambient = (I_ambient_const + b * Sum(I_light / r^2)) * k_ambient * obscurance


where :
I_ambient_const is what is saysb is a scaling factor in the range [0, 1]I_light is i-th light's intensityr is the distance from the light to the surfacek_ambient is the material's ambient reflectivity factor andobscurance is a number in the range [0, 1] where 0 means the surface is completely close (obscured) and 1 means the surface is completely open.


This is the ambient term alone. You can add to this whatever lighting function you want (per-vertex, dot3 diffuse, dot3 specular, etc.)

Quote:
This is cool, but I think you need more complex geometry, to show the advantages of the technique.
Cornell box-type tests are really for color test, not obstruction one :)

Unfortunatelly, i made the geometry as simple as possible just to test the technique. It took me about half an hour to do it (i'm no artist :) ). I'll try to make something better/more complex for when i convert patches to textures.
Also, one more reason i kept the geometry simple is because i don't know how the patch generator will handle more complex things, like rounded pillars, etc.

HellRaiZer
HellRaiZer
r u sure theyre actually using this technique in game?
looks great
http://media.pc.ign.com/media/694/694190/img_3533353.html

but ingame shots look a lot lower quality
http://media.pc.ign.com/media/694/694190/img_3533348.html
http://media.pc.ign.com/media/694/694190/img_3533360.html
Well, the game hasn't been released yet so, I'm not sure, but I have it from a good source that is an ingame feature. The second shot (which didn't show up for some reason) is a much better display. Search for more crysis pictures until you find the asian womans face shown in wireframe, bump, sss, and sss + bump. That really gives you a good feel for how subtle an effect it is but also how high impact a difference it makes.

I agree though, in those second set of shots those soldiers don't look like they have any kind of sss going on (face shadows too dark in relation to environment). The effect might be heavily light dependant though so who knows.
"Artificial Intelligence: the art of making computers that behave like the ones in movies."www.CodeFortress.com

This topic is closed to new replies.

Advertisement