Fast Multi Channel Ambient Occlusion
First, Welcome VRay to OSL World !
To celebrate Chaosgroup VRay entering the OSL world, with it's 3.0 version, here is a Three Ambient Occlusion for the price of One !
This shader is an Ambient Occlusion, but it does what a lot of you already do by hand: put 3 different AO, each on a different color channel.
Then, you just have to sepparate RGB channels with you favorite compositing software. The main advantage of this shader is that it optimaze rendering time by do not triple shading.
There is two versions of the shader :
TriGAOVr.osl : it's 100% Vray 3.0 compliant version !
TriGAO.osl : this version is for renderer implementing the 'getmessage' OSL functionnality, like Cycles or SpectraStudio.
It is about 30% faster, as it tracing just one ray for the three AO. It has a smoother AO gradient, needing less AntiAlias.
Small Documentation :
AO Angle : Occlusion search angle in RADIAN, 1.0 = 180° AO search.
Maxdistance : Limit of distance of occluding object.
The smallest it is, the smallest scene detail are highlithed by AO.
If there is Green and Blue AO, Maxdistance is for RED only.
GreenAODistance : Limit of distance of occluding object for GREEN channel.
BlueAODistance : Limit of distance of occluding object for BLUE channel.
OverSampling : multiply the number AO ray rendered.
doing 5 render samples with 10 OverSampling AO rays is faster than doing 50 render sampling with no Oversampmling.
The TriGAO.osl version has no checkbox for Green and Blue AO. Disable them with 0.0 value.
The TriGAOVr.osl has a BoostExposure control to compensate Render Exposure Control.
For Vray, or any renderer, you can download TriGAOVr.osl here.
Or TriGAOVr.oso, ready to use, version here.
For Cycles and other renderers using 'getmessage', download the TriGAO.osl version here.