bagginsbill opened this issue on Apr 23, 2008 · 2832 posts
bagginsbill posted Wed, 15 October 2008 at 12:35 PM
Similar, but not the same. You know me - constantly improving.
Here's the AO calculation I'm using now. It works like this:
The N node calculates the dot-product of the surface normal with the vector value you type in, which gives you a value between -1 and 1 indicating how well the normal lines up with the given vector. I want to know how much it is pointing up, so I want the vector [0, 1, 0]. However, I need to multiply the vector by 3 because of how Poser converts vectors to scalars.
The next step is to re-scale the dotproduct using .5 + .5 * N(0, 3, 0). Now my value goes from 0 (pointing straight down) to 1 (pointing straight up). Any horizontal surface will generate .5.
The next step is to blend that with WHITE (really the number 1) using PM:YBias as the factor. This lets me adjust the strength of the YBias effect. If PM:YBias = 0, then the ybias has no effect (always produces 1). If I use PM:YBias = .4, then the ybias calculator will decrease the AO effect by up to 40% in the case that the surface points straight down, and 20% for horizontal surface normals.
Blender math is really amazingly useful. The math of a Blender node is:
(1 - Blending) * Value_1 + Blending * Value_2
For this case the inputs are:
(1 - .4) * 1 + .4 * dotproduct
= .6 + .4 * dotproduct
So now I multiply the dotproduct with the overal PM:AO Strength parameter. That drives another Blender which mixes WHITE (1) with the actual AO node.
Putting it all together, the PM:AO Strength will uniformly modulate AO influence, and the PM:AO YBias will non-uniformaly modulate AO influence, in proportion to how much the surface is pointing down.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)