View Full Version : Occlusion and Ambient Occlusion
Scott212 09-20-2004, 03:49 AM I'm used to doing occlusion passes but not familiar with the newly popular "Ambient Occlusion". If they do, how do these differ?
|
|
Jozvex
09-20-2004, 05:28 AM
Hi, I recently answerd a similar question (which was just what is Ambient Occlusion and can Mental Ray do it) and here's what I said:
"Yes, Mental Ray can do Ambient Occlusion through using the Dirtmap shader by Daniel Rind. There are also Ambient Occlusion scripts like RayDiffuse for the Maya Software renderer, but I'm a Mental Ray-aholic so I recommend the Dirtmap shader approach.
Ambient Occlusion is different to GI in that it doesn't do colour bleeding and is not a physical simulation of light bouncing around. Ambient Occlusion does two things:
1. The 'Ambient' part looks at your scene environment (colour, texture or HDRI image for example) and applies some ambient shading to your object based on what it finds.
2. The 'Occlusion' part darkens your object in areas that would be occluded if environmental light from all around the scene shone at your object. So cracks/creases and places that are close to another object (such as a floor plane) will be darkened by however much you choose.
Final Gather can certainly achieve an Ambient Occlusion effect if the model is lit only by the environment colour/map and not by normal lights. However using an AO shader such as Dirtmap is way better because it's fast, easy to control and can easily be made artifact-free (even during animation, which is harder and slower to achieve through FG).
You can get the Dirtmap shader here from Daniel Rind's website:
http://animus.brinkster.net/stuff/p...lg_dirtmap.html
When installing new Mental Ray shaders, the zipped package will often contain XSI files or C++ source files, but the only things you need to worry about are:
*.mel files which just go into your normal user scripts folder.
*.xpm files which are Maya icons, that go into your user prefs > icons folder.
*.mi files which are like the Mental Ray interface to the shader which go into your:
'C:\Program Files\Alias\Maya6.0\Mental Ray\Include' folder.
*.dll files which contain the actual shader code and go into your:
'C:\Program Files\Alias\Maya6.0\Mental Ray\Lib' folder.
Sometime's there'll also be *.fti files which are special Maya icon files that display in the Hypershade window instead of the default "Mental Ray Shader" picture. They go into your:
'C:\Program Files\Alias\Icons' folder.
After you've placed all those files into the right locations, there's one last thing you have to do, which is edit your:
'C:\Program Files\Alias\Maya6.0\Mental Ray\Maya.rayrc' file in a text editor. For each shader you install you need to add two lines to that file. In the file you'll see lines like:
link "{MAYABASE}/lib/base.{DSO}"
link "{MAYABASE}/lib/mayabase.{DSO}"
link "{MAYABASE}/lib/physics.{DSO}"
link "{MAYABASE}/lib/contour.{DSO}"
mi "{MAYABASE}/include/base.mi"
mi "{MAYABASE}/include/mayabase.mi"
mi "{MAYABASE}/include/physics.mi"
mi "{MAYABASE}/include/contour.mi"
Those are the lines that load Mental Ray shaders. What you need to do is add two new lines to load the Dirtmap shader, like this:
link "{MAYABASE}/lib/base.{DSO}"
link "{MAYABASE}/lib/mayabase.{DSO}"
link "{MAYABASE}/lib/physics.{DSO}"
link "{MAYABASE}/lib/contour.{DSO}"
link "{MAYABASE}/lib/Dirtmap.{DSO}"
mi "{MAYABASE}/include/base.mi"
mi "{MAYABASE}/include/mayabase.mi"
mi "{MAYABASE}/include/physics.mi"
mi "{MAYABASE}/include/contour.mi"
mi "{MAYABASE}/include/Dirtmap.mi"
Then save that file, restart or open Maya and your new Dirtmap shader should appear in the Mental Ray shaders tab under Materials!
You can use the Dirtmap shader as a full base shader like a Lambert, which is good for creating a seperate Ambient Occlusion pass, or your can for example apply it to the ambient slot of a regular shader.
I personally like to plug a Dirtmap node into an 'RGB to HSV' node, then connect the V (value) of that node into the diffuse attribute of my shader.
But it's a very flexible shader. Phew, I think that covers it all!"
Is that enough info?
DiGiman
09-20-2004, 08:34 PM
Jozvex,
just so we're clear, how would you go about making an ambient occlusion pass, rather than an occlusion only pass. I typically create a white lambert shader, plug in the dirtmap, and apply to the whole scene. This gives me a b/w render of the occlusion in the shot. How do i get the ambient part.
The link above didn't work, this appears to though.
http://animus.brinkster.net/stuff/plg_dirtmap/plg_dirtmap.html
Btw thx for that little step by step of the miSSS in the other thread, got me started ;-)
Jozvex
09-20-2004, 11:22 PM
Well, I'd do what you just said (except I tend to use Surface Shaders, or apply the Dirtmap diretly to the object) and then on the Dirtmap, just tick the 'Use Environment' option.
That way it'll use your environment colour or IBL image for ambient lighting. You can use the 'Use Environment' and 'Probe Geometry' options independantly of each other, so if you wanted to you could render out just an ambient pass, then just an occlusion pass for more control.
I think that should give the right results.
:thumbsup:
playmesumch00ns
09-21-2004, 08:49 AM
A slight calrification of terminology:
The terms "ambient occlusion" and "occlusion" are used interchangeably as "occlusion" is just a contraction of "ambient occlusion".
An ambient occlusion pass should be black and white only, otherwise it's an IBL pass.
The term "ambient occlusion" is still important for making the distinction between "ambient occlusion" and "reflection occlusion". Ambient occlusion is a measure of how much of the environment a surface point can "see" in all directions. Reflection occlusion is a measure of how much of the environment a surface point can see in the reflection direction only.
Jozvex
09-21-2004, 11:46 AM
Ok, that's actually what I once thought but somebody 'corrected' me in another thread saying that ambient occlusion took the colours from the environment (eg like IBL). It makes sense though, how can you just have occlusion by itself, there has to be a context.
It's when you start bringing in the whole bent normals thing that I really start losing the plot, haha.
lazzhar
09-21-2004, 12:47 PM
Maybe someone could explain to us how to render the Bent Normals ? I've got that SIGRAPH paper about rendering Ambient/Reflection Occlusion by ILM and they showed how they did render airplanes in that movie (sorry forgot the name) in Renderman.
So I tryed to render that Bent Normal using the dirtmap shader-while it has this option- but Andrew said that the bent normal pass wasnt correct and that this pass couldnt rendered without using IBL.
Anyone tryed?
Jozvex
09-21-2004, 12:57 PM
The new (yet vanished) misss_occlusion shader can do it.
And in a shader pack called 'toLight' there's a shader just called 'occlusion', from this website that can do it too I think:
http://www.thereisnoluck.com/tolight_index.htm
playmesumch00ns
09-21-2004, 02:32 PM
Bent normals only make sense if you're doing IBL.
With simple diffuse environment mapping you just look up the colour in the environment map using the surface normal. If you then multiply this IBL colour by your occlusion value you get something that's fairly close to full-blown IBL, but a lot quicker.
You can improve the result slightly by using "bent normals". Instead of using the surface normal to look up the environment map, you use the "average unoccluded direction", which you calculate whle calculating the occlusion.
This is essentially the direction that "most of the light" comes from the environment to reach the surface, and it corrects subtle problems like the surface taking colour from a part of the environment that is blocked to it,
Jozvex
09-22-2004, 12:13 AM
Thanks for that explanation!
:)
CGTalk Moderation
01-19-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.