Previous | Next --- Slide 31 of 52
Back to Lecture Thumbnails
sponge

Why are the directions where cos(theta) the greatest the ones that contribute the most? I am struggling to visualize this..

triangle

When theta is 0, cos(theta) is 1 (which is the maximum). When theta is 90, cos(theta) is 0. This means that cos(theta) is the greatest when we are pointing straight up in the normal direction. This will be the brightest area. Intuitively this makes sense because the distance should be the shortest, whereas for other angles, we would be going farther away so the brightness would decrease?

ceviri

It's the irradiance thing (if you slant the ray relative to the surface the power gets spread over a larger area so you have less irradiance), I think.

Azure

The original uniform sampler is

(c1, c2) => (r cos(2pi c2), r sin(2pi c2), c1) where r = sqrt(1-c1^2).

To implement this biased sampling, I think all you need to do is affect the distribution sampling of c1, to turn it from uniform sampling to cosine-weighted sampling.

int (cos(theta)) = sin(theta), inverting gives arcsin(x) from [0, 1] -> [0, pi/2]

So then to obtain c1 you'd take c1 = cos(arcsin(x)) where x is pulled uniformly from [0, 1].

So putting it together,

(x, c2) => (r cos(2pi c2), r sin(2pi c2), cos(arcsin(x)))

where r = sqrt(1 - cos^2(arcsin x)), and x, c2 uniformly sampled from the unit square.

barath

if we weigh by the cos factor, I am not sure why we get cos/PI instead of cos/2PI