mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.75k stars 407 forks source link

How to add 360 degree image as background of the model #394

Closed huynhtruc0309 closed 5 months ago

huynhtruc0309 commented 9 months ago

Hi guys, I am trying to add 360 degree image as background of my model. This is what I tried. AttributeBegin Rotate 180 0 0 1 Translate 0 0 -50 LightSource "infinite" "string filename" "images/background1.exr" with background1.exr is the 360 degree image.

I got this error Error: images/background1.exr: image resolution (1917, 938) is non-square. It's unlikely this is an equal area environment map. Do you know how to resolve this? Thank you very much.

mmp commented 9 months ago

What spherical parameterization are you using? (Likely latitude-longitude?). If so:

https://pbrt.org/fileformat-v4 -> Differences from pbrt-v3 -> Environment maps used for image-based lighting should now use Clarberg's equal-area mapping. pbrt's imgtool utility provides a makeequiarea operation that converts equirectangular environment maps (as used in pbrt-v3) to this parameterization.