Jon Baker, Graphics Programming

    home

    writings

Weekend Project: HDRI Environment Maps in Daedalus

perlin2

  I was made aware of a really excellent resource, polyhaven, which provides a lot of really nice assets for 3d, for free. One of the types of resources they provide is a high bit depth EXR image that they call an HDRI - at time of writing, they have over 700 of them. This is a rectilinearly mapped image, which encodes the incoming irradiance from all directions for a point in space. This is a sample HDRI map:

relax1 relax2

  It's very similar to some different earth map projections, like the Gall-Peters projection or the Mercator projection. These work by having the angle about the polar axis mapped to image X, and the elevation above or below the equator on image Y.

perlin2

  It does create some distortion right at the poles, but you just have to work around it. This rectilinear mapping for the HDRIs is actually something I was already using in Daedalus, to cache the results from a sky model to a texture. This texture can be sampled and used as a light, when the rays escape to infinity.

relax1 relax2 relax1 relax2

  This model does come with some caveats. You sample it with a direction, like a cubemap - the position doesn't matter, because as I mentioned earlier, this really encodes the incoming irradiance for a particular point in space. Think, if you look towards the sun and see it occluded by a branch - you expect that you would be able to take a step to the right or left, in order to remove that obstacle between you, and see the sun again. This type of environment map has no way to represent this, what they call a parallax effect - it's like a skybox, at infinite distance. Same type of composite image stitched together from the data that the that the google maps streetview cars capture.

relax1 relax2 relax1 relax2

  With Daedalus, I'm actually able to render these myself. One of the cameras I have is a spherical projection, where you can render out this same type of map. But Daedalus can also write depth, too, so this parallax issue may be something interesting to experiment with and try to come up with a solution for.

perlin2

  I've been really quite impressed with the subtlety of the lighting that these HDRI environment maps have added to some of these renders. You can see just how much influence it has, looking at how it effects some of these shots with the same object, but different environment map.

  I also setup a picker to go through these, and also a function to pick a random one. I think this is a really nice thing to have, to be able to try some different things when laying out a scene.


Last updated 6/9/2024