Ambient Occlusion vs Dirtmap

Hi Everyone

I was wondering if anyone knows what the difference between AO theory and VRay’s dirtmap is. They seem to work differently and in several cases you can see the gradient on geometry where as with Ambient Occlusion Mray you dont.

Also it would be great if we could plugin the shader to a vray light, thereby allowing us to render out channels (diffuse reflection etc) with the dirtmap overlaid on top with out the need for any extra post work (cos am lazy)

This is the dirtmap version and you can make out the gradient

This is the Mray Ambient occlusion and it looks more like skylight but it works on interiors too

I dont think dirtmap works the same way as ambient occlusion in mental ray or maybe the renderman implementation, but is a different approach leading to the same solution.

On the other hand I could just be talking out of my … :slight_smile:

Colin

the same results should be achievable…it’s rather different default settings i guess..lower your radius in vraydirt to get the result look more like mr

Thorsten

The problem is if you lower the radius the on small detail it is fine but you lose it on the large structures like the balconies. On small scenes like a shot of some a table place set its fine but on larger architectural stuff not so hot.

Also with the ambient occluison you get the impression that there is light coming in from the sky’n stuff but on the dirtmap it is kinda like Dirtyreyes, gradient maps where the geometry meets. This why i think that the 2 shaders work in different ways to each other, not too different though.

Colin

AO and VrayDirt are two different things and is why it’s called VrayDirt and not VrayAO. Although they produce somewhat similar results (i.e increased shadow ares in crevices, recesses, etc) they way they acheive this is competely different. VRay Dirt uses an objects proximity to another object to determine where to place the dirt map. AO uses the surfaces ability (or inability) to see the sky or ambient light, thus what areas are occluded from ambient illumination determines the shading. AO in Vray terms is essential a single bounce environment light (which I don’t think is easily achieveable in Vray).

EDIT: What I said above is complete bubkis…basically open mouth and insert foot :sweat_smile: :sweat_smile: . I didn’t really understand the settings and was comparing it to my somewhat limited knowledge of AO. See below for some real explainations.

VRayDirt works more or less in the same way as MR ambient occlusion.

Galactus, you simply need a larger radius for the “dirt” effect. Also, if you are simulating AO, you need to set the distribution parameter to 1.0, as described in the help index.

Best regards,
Vlado

Woo Hoo!

Thanks Vlado, am off too experiment some more.

Colin

Wouldn’t a larger radius simply make the inside corners much darker than they would be by a regular ambient occlusion pass? If you compare the inside corners at the balconies on the previous images you’ll see that they would still recieve a lot of natural light. Another example is the underside of the stretched canopies are completely black (in the MR image) since they’re not receiving any direct skylight but the chairs below are still somewhat bright, which all seems correct for an AO pass. Is it possble to similutate a true AO pass using VrayDirt?

So far so good, here is my test result…

Dirtmap

More testing required for increased VRay knowledge :slight_smile:

Colin

My radius is set to 3000 and distribution is 1.0

this is gr8 stuff!
:shock:

dlparisi didnt vlado already say that vray dirt is a true AO pass. just that they dont call it that

The best way I’ve found to simulate AO with VrayDirt is to apply it to a Standard Material (Diffuse Map slot) and put the Self-Illumination to 100 (GI turned off). Hope that helps and I would like to ear Vlado opinion on this. Is this the best way to create an AO pass with Vray?

Or use a vray light material with a multiplier of 1 and then put the vraydirtmap in the map slot - same with the fast sss material.

:sweat_smile: :frowning: My apologies to all, it seems I didn’t realy understand the variables on the VrayDirt shader after all. As Vlado mentioned and Galactus demonstrated, increasing the radius drastically gives identical results to a regular AO pass. What really threw me off was that with a small radius the effect is very localized and appears to simply be a direct relationship of surface proximity and not a measure of whether or not a surface can “see” the ambient area. Good to know.

The radius works like this:

The vraydirtmap samples a point on the mesh, and from this point shoots out rays in a hemispheric direction. Depending on how far a ray travels, it returns a grayscale value. So, for instance, if the ray leaves the surface and the radius is set to 10m, and strikes a surface 1cm away, it will return ‘almost’ black (maybe like 254,254,254). If the ray encountered a surface 5m away (half the radius) it will return 50% gray. If the ray encountered a surface 10m away it will return white. (for these examples the occluded color=black and unoccluded color=white). If the ray doesn’t hit a surface after 10m, it will stop travelling and just return white. The final color of the point is the average value of all the samples (samples=number of subdivs).

The ray would have to travel an infinite distance to determine if the surface can ‘see’ the ambient area. So, for example an interior, you want the radius distance to be at least smaller than the direct distance between the floors/ceiling (if not smaller) to stop the rays and return white before striking the ceiling. For an exterior, you could probably figure out how large your scene bounding box is and set it to its diagonal length if you want to be sure you’re sampling the entire exterior.

Changing the distribution weights where the rays are shot towards the surface normal, at 0 it will send rays out equally around the sampled point.

Is this ray shooting method the reason why its so hard to get true black through the vray dirt then?

Galactus: I dont know if its what youre after, but try a mix material with vraydirt in the amount slot, then your bitmap in the white and either a darker version or a different one altogether in the other. I never use dirt as a seperate pass, its all done within my materials so Ive got more control over the radius/depth on specific objects. Works a dream on animations.

actually the whole ambient occlusion thing is kind of a wrong name. since all AO shaders calculate the relationship of distance, not the relationship of viewing ambient light. basically what your might be refering to is just an ambient pass with 1 bounce.

http://en.wikipedia.org/wiki/Ambient\_occlusion

perhaps the most straightforward way is to use the Monte Carlo method by casting rays from the point p and testing for intersection with other scene geometry (i.e., ray casting)

One thing that would be cool was to have another “Affect alpha” were the black (Occluded Color) appear as 1 in the alpha (as white) and the white (Unoccluded Color) appear as 0 in the alpha (as black). Long story short story, it would be cool to have the possibility to do an AO pass that had Alpha, like in MR (at least on XSI).

i think when you have an ao pass, while its b&w, you dond’t need to have an alpha. :?:

Well, depending on the layer mode (Screen, Multiply or whatever) if you have the alpha, you can control the intensity of the occluded color without affecting the areas of the unoccluded color. A director that worked with me, asked me that on a recent project, that’s why I’m asking.