Page 1 of 5

Ambient Occlusion Demo

Posted: Mon Jul 21, 2008 8:16 am
by dlangdev
Here is another demo showing Ambient Occlusion.

Here's how to do it:

1) Fire up Blender and set up the model.

2) Create a texture under the texture tab. If you skip this one, no render to texture will happen, make sure you do this correctly.

3) Put the seams to the model.

4) Unwrap the model.

5) Go to Bake tab and select Ambient Occlusion.

6) Hit Bake button.

7) Wait...

8. Wait...

9) Wait...

10) Save texture to jpg file.

11) Fire up IrrEdit and load the mesh model

12) First texture, load the ambient occlusion texture.

13) Second texture, load any colormap.

14) Set material type to lightmap.

15) Hit ctrl-F9 to view model.

16) Enjoy your ambient occlusion model.


no blur:

Image

with blurring:

Image

Image

Posted: Mon Jul 21, 2008 1:35 pm
by Yoran
Looks very nice

Posted: Mon Jul 21, 2008 7:02 pm
by dlangdev
thanks.

the next step is figure out a way of blending the colormap, ambient map, and the normal map using fixed functionality first. That's the first test. The second test is setting up the shader so these three can be blended.

if anyone has done this before please let me know as i'd like to study and learn from it.

shown below is the normal map output from zbrush.

Image

Image

Posted: Mon Jul 21, 2008 9:58 pm
by dlangdev
after looking around the code, it looks like the only way to blend them using fixed functionality is use the parallax map material attribute, but i have to blend the colormap and ambientmap externally, then bring it in as one file.

for shaders, i will have to setup four textures (just in case i need one more) and modulate them inside the pixel shader.

please confirm if they make sense.

thanks a lot.

Posted: Wed Jul 23, 2008 10:07 am
by dlangdev
here's the update.

the ambientmap and colormap were blended using multiply in photoshop, before loading it to irredit. what is shown below is simpy the model with colormap+ambientmap rolled into one map.

i'm trying to speed up asset creation at one model per day. so far, i can only produce a simple low-poly model per three days.

Image

Posted: Wed Jul 23, 2008 10:22 am
by JP
What's the difference between this ambient occlusion and lightmaps? it looks the same to me...

Posted: Wed Jul 23, 2008 10:24 am
by dlangdev
lightmaps have light source, while ambient occlusion is done using disks.

see chapter 14 of gpu gems 2. free copy here http://developer.nvidia.com/object/gpu_gems_2_home.html

Posted: Wed Jul 23, 2008 11:46 am
by Virion
it isn't seamless?

Posted: Wed Jul 23, 2008 7:14 pm
by dlangdev
yep, it's not seamless, true. i'm still studying where to place the seams, how they get modded in uv space and finally stitched to final form. that's another skillset i will probably have to learn as i go forward with this garage project.

Posted: Wed Jul 23, 2008 7:44 pm
by BlindSide
Real time ambient occlusion:
Image

:D

Posted: Wed Jul 23, 2008 7:51 pm
by dlangdev
man, that is cool, wish i could use the code for testing my model/scene. it would really help my research study.

by the way, i might spend some time playing around panda3d as they have some features i need to study on. for example, environment cube mapping and other nifty features. also, they seem to have some nice thingy for ambient occlusion as well. anyway, i'm still learning and doing at the same time.

Posted: Wed Jul 23, 2008 8:22 pm
by dlangdev
it looks like it is possible to port the chapter 14 code over. but that would require time for me, which i don't want to do right now. maybe later as i'm trying to set up a test scene for the server code.

ref: http://http.download.nvidia.com/develop ... Index.html

Posted: Thu Jul 24, 2008 10:01 am
by dlangdev
progress: one model added to asset.

Image

Image

Posted: Thu Jul 24, 2008 10:14 am
by JP
Notice that the lightmap is incorrect when you rotate the model? The lighting appears the same for all the tombstones (or whatever they are), regardless of their rotation.

Posted: Thu Jul 24, 2008 10:17 am
by dlangdev
no lightmaps are applied here as i'm still building up the asset.

perhaps when i get enough props, i will set it up in giles[s].

for now, it's mostly going to be ambient occlusion and colormap.

when it's done, i'm hoping it would like this one.

Image