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.
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
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.
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.
Directional AO can be done as illustrated here:
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
I want to do the same as what you did in MtoA.
Unfortunately, it doesn't work.
>_<
Have you tried Mads' solution?
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.
Copy aiAmbientOcclusionTemplate.py to ....\MtoA\maya2023\scripts\mtoa\ui\ae
Copy NEaiAmbientOcclusionTemplate.xml to ...\MtoA\maya2023\scripts\mtoa\ui\templates