PDA

View Full Version : Ambient Occlusion


Meet
09-14-2010, 09:11 AM
Hi There,

While working on ambient occlusion the code example given on the net are as follow

1:- float occlusion( point P, normal N, float samples, ... )
2:- float occlusion ( point P ; normal N ; float samples ; [parameterlist] )

I tried both but both are giving error as Identifier expected when
compiling for AIR.
And while compiling for Prman it compiles but not creating .slo file

Which syntax do I follow?

Can you please help me to sort this out?

:)

Obi
09-14-2010, 10:21 AM
As far as I can remember, in 3delight its working that way:

float SomethingName = occlusion (Ps, N, 32);

And than multiply the surface color with (1-SomethingName). Let me know if that worked. If not, than I'm sorry.:(

Meet
09-14-2010, 10:52 AM
As far as I can remember, in 3delight its working that way:

float SomethingName = occlusion (Ps, N, 32);

And than multiply the surface color with (1-SomethingName). Let me know if that worked. If not, than I'm sorry.:(

Hi ,
I tried that but not working for occlusion function. I don't know is this a syntax error or the number of parameters of the function. It is working fine with the gather loop.
Lets see, will let you know if I get some thing.

:)

ndeboar
09-14-2010, 11:18 PM
try this:


surface occlusion_SRF()
{
float _occl = occlusion (P,N,32);
Ci = 1 -(_occl); Oi = 1;
}

EDIT: By the way, both examples are correct. You can add extra parameters (eg maxdist, maxsolidangle), but you dont have to (they just default otherwise).

noizFACTORY
09-17-2010, 04:58 AM
Look under the shaders directory in Air's path and you'll find .sl files in the "src" directory. There are lots of examples (including occlusion shaders) you can study. And here's the all time favourite resource:
http://www.fundza.com/rman_shaders/ray/ambient_occlusion/occlude1.html

-Sachin

Meet
09-19-2010, 02:32 PM
Look under the shaders directory in Air's path and you'll find .sl files in the "src" directory. There are lots of examples (including occlusion shaders) you can study. And here's the all time favourite resource:
http://www.fundza.com/rman_shaders/ray/ambient_occlusion/occlude1.html

-Sachin

Hey,
thanks and sorry for the delay in reply, was working on the same as you suggested and got good help from shaders directory in Air's path.
It was just one parameter I missed was
output varying normal anyname = 0;
and this has to pass in the parameter list of the occlusion function after the coneangle parameter.

Thanks to all,
:)

CGTalk Moderation
09-19-2010, 02:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.