Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Directional Ambient Occlusion

9 REPLIES 9
Reply
Message 1 of 10
joie
1469 Views, 9 Replies

Directional Ambient Occlusion

Hi there,

Is it possible to make a "directional ambient occlusion" like the one you can achieve with VRay's dirt map?.

Here you can see an example of what I mean:

http://www.peterguthrie.net/blog/2009/10/vray-dirt-tutorial

Simplifying, to make Ambient Occlusion to compute from a direction or axis.

If it can't be done, are there any plans for doing it?

Thanks in advance.

Tags (1)
Labels (1)
9 REPLIES 9
Message 2 of 10
lee_griggs
in reply to: joie

There is the Curvature shader. Zeno has a dusty shader too.

Lee Griggs
Arnold rendering specialist
AUTODESK
Message 3 of 10
zenop
in reply to: joie

Hey, I didn't check if this code compiles but 99% sure it should. I think this is what you're looking for. If you compile this shader (there's guides in the documentation on how to do this), you can use the axis vector to define a custom "direction" for the occlusion.

The code formatting on this help site is pretty terrible, so here's a link instead.. https://gist.github.com/zpelgrims/f68b54c5db037506d39979f44d6e6823

Message 4 of 10
joie
in reply to: joie

Thank you all.

I would like not to rely on third party shaders or plugins to do that.

The curvature shader does not do anything related to this, it just put white or black depending on normal angle, not occlusion. The dusty shader is great, but, again, it is not directional occlusion, like Pelgrims' approach.

I really hope this will be added to Arnold if it wants to do any competition to VRay in architectural visualization bussiness. It is a must.

Cheers.

Message 5 of 10
maxtarpini
in reply to: joie

It's really not a must for anything at all 🙂

Message 6 of 10
joie
in reply to: joie

Without this shader, How would you approach vertical dirt leaks?, with this shader it is really easy since you can mask areas below projecting meshes.

Message 7 of 10
madsd
in reply to: joie

Directional AO can be done as illustrated here:3197-gg.png

You link a 3 channel vector ( I use OSL here ) to the normal of the AO shader.

You can see here, I have total control over all aspects while "filtering out" the undesired directions and run on the .z = 3rd spinner on the vector.

You can then use it to drive a mask or introduce other things.

I am using 3ds max, but node rig should be identical in Maya.


Small video illustrating control of direction and spread.
https://i.imgur.com/yTipCxU.gif

Message 8 of 10
benson.poon
in reply to: joie

I want to do the same as what you did in MtoA.

Unfortunately, it doesn't work.

>_<

Message 9 of 10
CiroCardoso3v
in reply to: benson.poon

Have you tried Mads' solution?

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 10 of 10
rachid_1
in reply to: benson.poon

Hi
Just connect SetVector.OutColor to aiAmbientOcclusion.NormalCamera not Normal!

if you "kick -info ambient_occlusion" you can see "VECTOR normal", but there is nothing about "NormalCamera" witch is pesent in aiAmbientOcclusionTemplate.py located in(...\MtoA\maya2023\scripts\mtoa\ui\ae) and that what make the conflit!
For some unknown reason ADSK has reversed the original "Normal" in "aiAmbientOcclusion shader" with "NormalCamera"! and that not the case in HtoA or C4dtoA.
to avoid this issue between Normal and NormalCamera, I have edited the file aiAmbientOcclusionTemplate.py
and "NEaiAmbientOcclusionTemplate.xml" located in (...\MtoA\maya2023\scripts\mtoa\ui\templates)
so that way when you expand aiAmbientOcclusion you get NormalCamera instead of Normal, but stil show up Normal in the UI.

 

directionalAO.jpg

Copy aiAmbientOcclusionTemplate.py to ....\MtoA\maya2023\scripts\mtoa\ui\ae
Copy NEaiAmbientOcclusionTemplate.xml to ...\MtoA\maya2023\scripts\mtoa\ui\templates

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report