occlusion() fails?

   2546   2   1
User Avatar
Member
288 posts
Joined: July 2005
Offline
I was trying to use occlusion() to make ambient occlusion with vex. I used to make occ in prman with occlusion(). In prman ,the occlusion() is the float, the vex, it is the vector, I think they are “nearly” the same.

I wanted to make the surface occlusion shader, with cf = occlusion(P,N); it didn't work as occlusion() in prman, it rendered all black, but I think it caculated the occlusion(), because it is not as fast as a plasitc shader.
^_^
User Avatar
Member
1390 posts
Joined: July 2005
Offline
ykcosmo
I was trying to use occlusion() to make ambient occlusion with vex. I used to make occ in prman with occlusion(). In prman ,the occlusion() is the float, the vex, it is the vector, I think they are “nearly” the same.

I wanted to make the surface occlusion shader, with cf = occlusion(P,N); it didn't work as occlusion() in prman, it rendered all black, but I think it caculated the occlusion(), because it is not as fast as a plasitc shader.


There are two versions of occlusion in VEX. The one you use returns colour:
vector occlusion(vector P, vector N)

second one returns float:
void occlusion(float coverage&, vector missed_direction&, vector P, vector N)


You see black render, because the first one needs a background color or an environmental map that is a source of “light” once ray won't hit a surface. Both are an optional parameter for occlusion() call as described here:

http://www.sidefx.com/docs/houdini9.5/vex/contexts/shading_contexts#rayopts [sidefx.com]

Check the code of VEX GI shader for example usage.

sy.
User Avatar
Member
288 posts
Joined: July 2005
Offline
…thank you very much!

and….. oh my god, the document went online….-.-!
^_^
  • Quick Links