Jump to content

Bake That Occlusion ! shader


Recommended Posts

Hi guys ,

Im in the process of building a baking tool for occlusion. I wanted to bend the shipping occlusion vop to my will :) . Of course when baking out a UV set you need to make sure face forward is turned off . My inner code is somewhat of a hack

vector $myP = $isconnected_P  ? $P: P;
vector $myN = $isconnected_N  ? $N : normalize(frontface(N, I));

if($facefwd) $myN = vop_frontface($myN);

$occlusion = occlusion($myP, $myN, "bias", $bias,
		"maxdist", $maxdist, "samples", $samples,
		"scope", $scope, "categories", $categories,
		"environment", $envmap, "envobject", $envobj,
		"envtint", $envtint, "background", $bgcolor , "angle" , radians($coneAngle), "filter " , "point");

I just wondered if this approach to hacking the vop code looks good or is my code causing issues with longer rendertimes

I've mostly got the occlusion baking tool working fine , but seems to take an age to run the render from the execute to finished frame

Render Time: 7.987u 0.358s 54.70r

Memory: 174.78 MB of 192.69 MB arena size. VM Size: 518.44 M

Thoughts ?



Edited by rob
Link to comment
Share on other sites

Not sure what inputs are going to the inline vop, but why the frontface() calls?

Also, unless you have a reason not to, I'd look at the second version of occlusion() which returns a float.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...