5
$\begingroup$

I'm working on implementing Bruneton's cloud rendering paper, which requires one to render a pair of depth maps, similar to how shadow mapping works. In this case, my light source is the sun (or possibly the moon), which I represent in my rendering engine as a normalized vector pointing in the direction of the sun or moon, which is essentially located at infinity from the current camera position.

Since the light source doesn't have a traditional "position," I'm having a little trouble determining how best to create the viewpoint transformations for the source.

Since I would also essentially use the same transformation for sun/moon shadowing, it'd kill two birds with one stone.

So my question is thus: How can I generate a view transform for generating depth maps of area light sources located at infinity?

$\endgroup$
4
$\begingroup$

Instead of using a perspective projection you would use a orthographic projection.

Then the trick is to position the bounding box to in front of the normal camera.

An additional option is to add a skew/shear operation so it maps the light direction to the vertical and keeps the horizontal ground plane horizontal.

This avoids leaving a large dead zone underground near the light source.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.