Help - Search - Members - Calendar
Full Version: Ambiance Occlusion Mini Tutorial
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Tutorials and Demonstrations > Featured Tutorials > Classic Threads
ypoissant
About Ambiance Occlusion (AO for short).

There are two options in the object's properties that are related to AO:
  • Options -> Receive shadows : When ON will also receive AO shadows and when OFF will not receive AO shadows.
  • Options -> Cast Occlusion : THis is a new option. When ON the object will cast AO. This is usefull for when an object, like the walls of a room must cast shadows but we don't want it to cast AO because it would darken the whole scene. Same idea when using a skydome.
Most of the controls pertainint to AO and IBL are in the Choreography properties. They are located under the Global Ambiance property: Choices are "None", "Global Color" and "Image Based Lighting". The additional Global Ambiance properties are:
  • Ambiance Intensity goes from 0% to 1000%. It is available for Global Color and IBL. It sets the intensity of the ambiance illumination in the scene.
  • Ambiance Occlusion goes from 0% to 200% with optimal value being 100%. It computes the proportion of the space that are onoccluded by other objects or self-occluded in the scene. The result is a sort of soft shadow that ony affects the ambiance illumination in the scene. It can be used with any type of Global Ambiance types. Increasing this property from 0% to 100% gradually darkens the AO. 100% is the correct setting. Going higher than 100% forces the AO by leaking it into other part of the scene.
When "Global Color" is selected, the ambiance works like the traditional ambiance setting. Then, the Global Ambiance group of properties have one additional Property:
  • Ambiance Color : This adds a constant global illumination of the selected color in the scene.
When "Image Based Lighting" is selected, the ambiance illumination is computed from an environment map, preferably and HDRI map. Then the Global Ambiance group of properties have those additional properties :
  • Environment Map is the image that is to be used as the environment for the IBL.
  • Mapping Type allows specifying the type of environment mapping that is used in the image file.
    • The default is "Lattitude-Longitude", which is the traditional mapping used for environment mapping in A:M. Also known as "panorama" or "Spherical" mapping.
    • "Light Probe", the mapping type used by Paul Debevec for in his probe files.
    • "Mirrored Sphere" would correspond directly to a photograph of a reflective sphere.
    • "Cube Map (Cross)" Is an alternative mapping format that is used by Paul Debevec for his environments.
  • "Exposure" allows adjusting the environment map exposure. After hunting for HDRI environment maps on the web, I found out that there is a huge discrepancy in the available exposures. There is no standards. So except for the probes from Debevec, most of the other that I found had to be either overexposed or underexposed. Sometimes up to 10 f-stops.
  • "Azimuth" allows orienting the environment around the Y axis.
  • "Elevation" allows orienting the environment aroiund the rotated X axis.
The choreography right-click context menu allows to explicitly launch the IBL basis calculations and is only usefull when doing IBL properties tweaks and doing progressive renders. IBL basis will be automatically calculated when doing render to files.

Finally, There is are two additional properties in the Render pannel:
  • Ambiance Occlusion an ON/OFF property alows to include or exclude the AO while doing the final render. This property have a sub-property:
  • Occlusion Samplings allows to decrease or increase the number of samplings for AO. Very small values, like 15 or 20% is sufficient for most scenes. Less samples = faster AO calculations.
Also, a new ImageIO plugins is available which can read HDR files. Those are files used by Debevec for his light probes which are feely available. Additional Light Probes or HDRI environment maps in HDR format can be found on the Internet. OpenEXR is also an HDRI capable format.
MattWBradbury
Ahh, I didn't know about the IBL calculations in the choreography. The tutorial will really help. I had no clue of what the Azimuth or the Elevation even did. Thanks Yves.

--Added January 29, 2006.
This is an animation done with newton physics and global color.
pdaley
Thanks Yves.
Paul Forwood
Yes, thanks, Yves!
ypoissant
How to use Ambiant Occlusion.

Note : All images are 1.8 gamma corrected. All AO sampling were set to 15% except the AO only one which was set to 25%.

Here is a scene where only the ambiance is rendered :



This was rendered with the following settings:
Global plugin shaders (shaders found in the Render panel) :
- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : None
Chor Ambiance :
- Global Color
- Color : white
- Intensity : 100%
Ambiance Occlusion :
- 0%

And here is a scene where only the ambiance occlusion is rendered :



This was rendered with the following settings:
Global plugin shaders (shaders found in the Render panel) :
- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : Ambiance :
- Color : White
Chor Ambiance :
- Global Color
- Color : white
- Intensity : 0%
Ambiance Occlusion :
- 100%

Combining the two together gives this :



This was rendered with the following settings:
Global plugin shaders (shaders found in the Render panel) :
- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : None
Chor Ambiance :
- Global Color
- Color : white
- Intensity : 100%
Ambiance Occlusion :
- 100%

Modifying the Ambiance Color property to better match the floor color (to fake radiosity) could give something like this (I exagerated the ambiance color to drive the point) :



This was rendered with the following settings:
Global plugin shaders (shaders found in the Render panel) :
- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : None
Chor Ambiance :
- Global Color
- Color : 216, 157, 118
- Intensity : 200%
Ambiance Occlusion :
- 100%

And then adding two lights in the scene could give something like this :



This was rendered with the following settings:
Global plugin shaders (shaders found in the Render panel) :
- Diffuse Shader : None
- Specular Shader : None
- Ambiance Shader : None
Chor Ambiance :
- Global Color
- Color : 216, 157, 118
- Intensity : 200%
Ambiance Occlusion :
- 100%
Light2 :
- Color : 135, 142, 209
- Intensity : 15%
- Shadow Type : Z-Buffer
- Shadow Darkness : 80%
Light 1 :
- Color : 254, 200, 150
- Intensity : 200%
- Shadow Type : Ray traced, 5 rays
- Shadow Darkness : 70%
MMZ_TimeLord
I find it interesting that Spaceman's face and the Binocular's eyes are hidden until you added those two extra light sources. blink.gif
Zaryin
Does having an infinite space affect the render time? I tried to render my Ozmap which is just a plane floating in infinite space. I was rendering with 16 passes and I was at 15 miniutes and it still didn't get to 6% and finish the first pass.

I was using Global color with AI: 75% and AO: 100%. I was using the basic three light set-up. I was rendering at 922X392

EDIT: Turned down the sampling form 100% to 25% and it rendered each pass in about 5 and a half minutes. I'm going to turn it lower and see how it renders.

THanks Yves for the tut. If i didn't re-read it again I wouldn't have realized about the sampling.
MattWBradbury
I have 2 problems.
1. Some of my hdr files are loading into A:M upside down. I have no idea why it does this.
2. IBL uses the camera to set which axis the occlusion renders at. Meaning if I rotated the camera 180 degrees on the z axis the sky would not be on the bottom of the model but the top of the model.

Does anyone have any idea what could be causing these problems?
Julian
QUOTE(MMZ_TimeLord @ Jan 20 2006, 03:03 PM) *
I find it interesting that Spaceman's face and the Binocular's eyes are hidden until you added those two extra light sources. blink.gif

I see what's happening... it doesn't work through transparency. That is, since the entire object is set to cast occlusion, even transparent groups that don't normally cast shadows will cast occlusion. Yves, would it be possible to reduce the occlusion intensity of part of an object based on its transparency?

Actually, I've always thought it might be useful to be able to set individual groups within an object to be able to cast and receive shadows.

Obnomauk
QUOTE(ypoissant @ Jan 20 2006, 03:32 PM) *


- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : None



Where the heck does one find a Null Shader?


-David
cosmonaut
QUOTE(Obnomauk @ Jan 21 2006, 04:58 AM) *

QUOTE(ypoissant @ Jan 20 2006, 03:32 PM) *


- Diffuse Shader : Null Shader
- Specular Shader : Null Shader
- Ambiance Shader : None



Where the heck does one find a Null Shader?


-David


Better yet, what the heck does it do?
MattWBradbury
It get's rid of shadows (like the dark side of the moon) and specular highlights. It's under the Plug-in shaders in your render options tab.
NancyGormezano
Thanks for the tut (& of course the new features), Yves - this really looks interesting & very very useful.
ypoissant
QUOTE(MattWBradbury @ Jan 20 2006, 07:47 PM) *

1. Some of my hdr files are loading into A:M upside down. I have no idea why it does this.

The HDR files header contains indicatord as to how to load a file : up side up or up side down, and left side left or left side right. Depending on who produced those HDR or how they were produced, those indicators might not be correct. I'll do some tests.
QUOTE
2. IBL uses the camera to set which axis the occlusion renders at. Meaning if I rotated the camera 180 degrees on the z axis the sky would not be on the bottom of the model but the top of the model.

The environment map orientation is not completed yet.


About "Null shader"

A Null shader cancels out some shading component. Using the Null Shader for diffuse will cancel the diffuse shading calculations. Similarly, using the NullShader for specularity will cancel the specular shading calculations. I developped those shaders for testing purposes but found out that they are usefull when lighting a scene to help figure how the lights are affecting the lighting in a scene. For instance, when trying to balance the ambiance component vs the diffuse component vs the specular component.

BTW, to null the ambiance properties that might be set on object or groups surfaces, simply use the Ambiance Shader and set the color to black.
Obnomauk
so null shader... PC only then?

-David
zandoriastudios
I couldn't find it on my PC... maybe not looking in the right menu :(
ypoissant
I downloaded the last alpha and installed it. It's there in my last install. THe name is NullShdr.shd. I also noted that the velvet.shd have a bad filename called velvetshv (without the dot).

Some of the shaders didn't make it on the Mac alpha. They should be there in the next alpha. I will open a new thread to describe the shaders.
MattWBradbury
Don't we have enough tools at our disposal?

Just kiding tongue.gif

Is there any way to bake Ambianc Occlusion onto the geometry for use like the old monte carlo radiosity?

...Thinking on it now, it is probably not such a good idea. I remember how messy radiosity looked just a few months ago when I was using v8.5. Probably best not to go in that direction.
MattWBradbury
Is there a way to use multiple lights with AO? I tried a few times to get more than one light to work and I've had no luck.
ypoissant
I'm not sure I understand the question. AO doesn't use any lights. As the name implies, AO is calculated for the ambiance component only. There are no light involved in the ambiance calculations. As far as I have experimented, you can place as many lights as you like in your scene but that will not affect the ambiance occlusion component itself.

Could you provide an example or an explanation of what you are trying to achieve?
MattWBradbury
An example would be a scene at dusk where I have a sun and a building with a lampoutside and I wanted to add purple Ambience Occlusion. Depending on which light I put in the choreography, the first one will be the only one that renders with AO on.
markeh
To the mediocre cg untrained eye guy like myself, would one notice a difference with IBL using HDR files as opposed to using your highest quality jpeg file? All I know about HDR at the moment is that it holds more luminance range. Also when I do a search on HDR, these are spheres reflecting the environment? Is there another link where I should be reading about HDRI first?
ypoissant
QUOTE(MattWBradbury @ Feb 1 2006, 01:20 PM) *

An example would be a scene at dusk where I have a sun and a building with a lampoutside and I wanted to add purple Ambience Occlusion. Depending on which light I put in the choreography, the first one will be the only one that renders with AO on.

I'm still not sure I understand the issue. I just did a quick test. A simple scene with several blocs, 3 lights and a blue AO and rendered. All the lights are illuminating the scene and casting shadows.
ypoissant
QUOTE(markeh @ Feb 1 2006, 01:55 PM) *

To the mediocre cg untrained eye guy like myself, would one notice a difference with IBL using HDR files as opposed to using your highest quality jpeg file?

Probably not.
QUOTE
All I know about HDR at the moment is that it holds more luminance range.

That is pretty much what it is. HDRI is an image format that can record a much wider luminance range than ordinary image files. The 3 main visual consequences of that are:

  • HDRI can be used as a sort of light source in a scene. That is what IBL does.
  • A very dark reflective surface can still produce very bright relfections.
  • Bright spots in the environment are not washed out with soft reflection.

QUOTE
Also when I do a search on HDR, these are spheres reflecting the environment?

That is because the more interesting use of HDRI is as a High Dynamic Range environment maps. But HDRI can also be used for storing renders that will require post-processing since those images can be manipulated almost without quality degradation.
QUOTE
Is there another link where I should be reading about HDRI first?

There is not much popularization literature about HDRI unfortunately. The available documentation is scientific/research papers. Paul Debevec is the initiator of this research field.
MattWBradbury
My problem, as it turns out, is not with AO. I can no longer render more than one light in any choreography. Also, whenever my brother and I model something, light will only come from the origin rather than from the camera in the modeling window. So v13 alpha still has some bugs.
ypoissant
QUOTE(MattWBradbury @ Feb 1 2006, 06:08 PM) *

My problem, as it turns out, is not with AO. I can no longer render more than one light in any choreography. Also, whenever my brother and I model something, light will only come from the origin rather than from the camera in the modeling window. So v13 alpha still has some bugs.

I cannot reproduce any of those two issues you are reporting here. As yopu can see above, My choreography renders all 3 lights and in my modeling window, the light comes from front (there is no camera in the modeling window).
MattWBradbury
Oh, I meant the isometric vantage points in the modeling window.

It is a problem with my version of alpha among other things like: cross images do not work for my IBL, I have to change the image type for IBL and change it back in order for IBL to work prperly, latitude longitude IBL images render a dark area at the edges of the image, my hdr files load upside down but render right side up for IBL, I can only have one working light in a choreography, some models loaded from v12 have incorrect gammas, property traingles appear on render options that arn't turned on so you have to click on them twice to get them to disapear, and light emmites from only the center of the modeling window. Should I report these issues?
cfree68f
Yves,

YOU ROCK!!!

ZachBG
QUOTE(cfree68f @ Feb 2 2006, 04:26 AM) *

IBR Ambient Occlusion using a HDR image for the lighting and one spot. Takes a little getting used to the setup but its really cool.


That's really purty. Is that with the default sampling of 30%? Multipass? And what was the HDR image (link if possible)?
ypoissant
QUOTE(MattWBradbury @ Feb 2 2006, 03:17 AM) *

Should I report these issues?

Definitely yes. Each issue in a different report with detailed description, a screen grab that shows the problem and a complete project file.
ypoissant
QUOTE(cfree68f @ Feb 2 2006, 04:26 AM) *

One thing I noticed was that the HDR images come in flipped vertically? Is that by design?

I will have to investigate that further. From the tests I did, they loaded correctly but I didn't test a large variety of hdr files. The HDR file format have 2 flags that tells how to load the file. one flag for upside-down vs upside-up and one flag for leftside-right vs leftside-left. But there is no way for the user to manipulate those flags in HDRShop which is main application producing and manipulating HDR environment maps. So my guess is that HDRShop always places the same flags no matter how the image is actually stored.
QUOTE
Oh.. one more thing. I noticed an artifact on the ground. Not sure if its from shadow maps (my guess) or the Ambient Occlusion. I'll try one without the light tomorrow and see.

There is a known issue where the ground is intersecting itself. That might be the same issue.
cfree68f
Actually Zach... I can't find the link again. But if you google light probe or image based lighting or hdri.. you'll find tons of them. You'll probably wan't hdri shop to deal with them. The Ambient Occlusion sample on this particular image was set at 20 percent. 16 pass multipass. 1 spot with a 512x512 shadow. 100 percent intensity on the AO intensity setting.

ypoissant
QUOTE(cfree68f @ Feb 2 2006, 11:27 AM) *

I assume the image is mapped at default from the camera. Is that true?

You mean the IBL environment map? It is oriented according to the choreography world. The center of the environment map is facing the choreography Z axis.
QUOTE
Does the Azimuth setting rotate the image around the object in a 360 degree type setting?

Yes.
QUOTE
Cranking up the Ambient intensity and the exposure on the HDR image seems to have the same effect. Is that true?

Yes. They basically have the same effect. But "Exposure" is a photography term. If you increase exposure by 1, you double the light intensity.
QUOTE
It seems that the floor should be set to not render for ambient Occlusion. That gives the full map? I know some HDR images have black on the bottom in order to only consider sky lighting. Is it a true statement that the floor should never be considered in a Ambient occlusion render unless the floor is a table or some other object that would cast an ambient shadow?

There are no hard rules. It depends on what you want to achieve and the particular scene. It is true that HDR environment maps already contains illumination coming from the ground so excluding the ground from casting AO is a good idea but I wouldn't state that as a rule because some probes have very bright grounds and that may not be what you want.
cfree68f
.
nixie
Colin,
Is the 'frame' object' hovering just above the ground plane? Iv not played with ao an awful lot, but id think it could be that which causes the hard shadow. As for the reflection, its very subtle. Great new feature though.

Nixie
cfree68f
.
ypoissant
Colin,

I cannot view the video. I don't know why because I have the latest flash player installed but all I see is a rectangle that flashes between black and white at a rate of around 8 cycles per seconds. Could you post a QuickTime?
cfree68f
Hey Yves,

Unfortunately I did it at work and I can't seem to log onto my machine at work at the moment. I'll update the video with a QT tomorrow.

C
KenH
QUOTE
3. Noticed it took a looooooooong time to save the project the first time around but after that it saved quickly.


Yes I get that too. I used to get it a while ago also. I'm getting other bugs that were squashed as well. It's like a reversion to a previous revision.

BTW I never thought I'd say this about a hag...."I love her!" biggrin.gif That's a great look for TWO. It's like you have SSS in there. If possible could you upload the project file so we can do all the characters like that?
cfree68f
.
cfree68f
.
ypoissant
QUOTE(cfree68f @ Feb 2 2006, 05:22 PM) *

1. had to flip it vertically as well...

I will change the HDR code. After examining several HDR files, most of them came from HDRShop which always indicates a negative Y. Since I can assume the user was viewing the image in upward direction in HDRShop, then I must also assume that a negative Y means the image should be loaded in reverse direction as it is now.
QUOTE
If you look at this video (ibl test video) You'll notice that the frame object has some sort of reflection on its side. But it has no reflectivity setting. In fact I turned off reflections in the global setting.

I see it too. I don't know why though.
QUOTE
I'm guessing that its ambient bounce off the sphere?

Ambiance does not bounces. It is not like radiosity. There is no bouncing or reflections. I'm clueless.
QUOTE
In addition the edges of the shadow on the floor around the frame are hard. I just noticed this.. not sure if its correct or not.

Yes. It is correct.
MattWBradbury
Try doing the same test without the sphere. Did you use an Image for IBL or did you use global color? I would be more interested in figuring out why the sides of the block change intesity over the animation.

The stationary blotch could be due to the compression of the video.

Yves, the majority of the problems that I've encountered with v13 alpha (other than issues with HDR files) are resolved when I close the project and reopen it.
MattWBradbury
Here's what my rotating cube did. The color of the cube stayed the same for all visible parts of it.
cfree68f
Mine was image based lighting using the Uffizi HDRI... and I'm sure the stationary blotch isnt a compression artifact as its there on the raw file.

The variable side shading is most likely the Image based ligthing and Its possible that the stationary blotch is as well, but thats a pretty detailed light sample considering a flat surface.

I'll try it without the sphere and see if its still there. No biggy.. just curious.

C
Dark_Jedi
where on the program do u find the way to change the settings to make rendering look better (shown on first page)
patrick_j_clarke
PWS in the Chor area...

- pjc
Dark_Jedi
im sorry im nto quite sure what pws means. and im guessing chor is choreography
nimblepix
project workspace
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.