AcademySoftwareFoundation / AcademySoftwareFoundation/openexr
exrenvmap: observed imprecise conversion of cubemap to lat/lon
- Dominant language
- C
- Stars
- 1.8k
- Forks
- 700
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 29
Description
Using exr2envmap with cubemaps as input, I noticed differences to what my own calculations for the resulting lat/lon environment maps produced. So I went to investigate. To see if exr2envmap might be responsible for these differences, I created a synthetic cubemap and had it processed by exr2envmap. The resulting lat/lon environment suggests to me that there might be a flaw in the conversion process. Here's my reasoning:
- I am feeding a cubemap of six black 1000X1000 squares, each with one-pixel-wide edges in different per-cubeface colours
- the invocation I use is `exrenvmap -ci -l -w 4000 -f 0 1 -v cubemap.exr latlon.exr`
- this is using an openexr CL tools install on debian testing which is labeled 3.1.5-5.1+b2, same with a fresh build from master
- the resulting lat/lon environment map shows inconsistencies in the width of visible vertical cube edges
Coming from a perfectly symmetrical cubemap, I would expect that the rendition of all cube edges should look alike - except for showing different colours - and that the edges should each show as two one-pixel-wide vertical lines next to each other. Instead I observe that some come out one pixel wide, and some two pixels wide. I tried raising the resolution (-w8000) and still got different widths in the rendition of the edges. Can you confirm that the conversion should indeed produce renditions of the vertical edges which are geometrically identical, and that they should look as I expect?
I have a suspicion about what may go wrong. The output is periodic, and should be treated as if it maps the 360 degrees field of view horizontally to a range from a point half a pixel to the left of the first pixel's center to a point half a pixel to the right of the last pixel's center. The output from exr2envmap I observe looks like it might have been calculated disregarding this small offset. Would you care to have a look at my findings, to see if you can reproduce my results? I can upload the cubemap I've used, and if you like, also the result I got from exr2envmap and a lat/lon environment map showing what I think the output should look like.
Contributor guide
Research direction
Start by reproducing the reported exrenvmap invocation with a synthetic 1000x1000-per-face cubemap whose edges use distinct colours, then inspect the 4000-pixel lat/lon output. Compare the widths and symmetry of the rendered vertical cube edges, including the proposed half-pixel periodic-boundary handling; done means the conversion behavior is confirmed and the discrepancy is resolved or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100