Page MenuHome

New equirectangular world texture mapping option (needs test file, postponed until after 2.61
Closed, ArchivedPublicPATCH

Description

This patch adds a new equirectangular projection option in the world texture mapping panel.

This option will allow the user to map full (360 by 180 degree) equirectangular panorama images as a sky texture. This improves upon the existing "Sphere" option which only maps to the hemisphere in the positive z-space and should be useful to those wanting to use equirectangular images for Image Based Lighting. Equirectangular images are very common in IBL as they result in less distortion when projected as compared to angular maps.

Testing: Load image texture in world texture panel. Select 'Equirectangular' under Mapping. Then of course check Horizon under Influence and check Real Sky in World panel.

Note: A true equirectangular image (i.e. a full-sized one, not cropped) will have an aspect ratio of exactly two. Any other aspect ratio will introduce stretching.

Event Timeline

Tested with r38750. Works fine. Thanks Perry for doing that.

+1 add to trunk.

We should definitely add this little gem to the trunk! Equirectangular is an increasingly common format for HDR environment maps.

Updated patch to current trunk, I think this could go in.

Note: changed TEXCO_EQUIRECTMAP to 2048, as 128 collides with TEXCO_VIEW, which is also a possible world projection.

+1 I like this functionality and the code seems simple enough (I wonder if it should be supported for the glsl material too though).

Checked on the meeting and we're 2 weeks away from release at the moment, so this patch should be reviewed for inclusion after that.

Just a note that it would be nice to have a test file with this patch to show it working.

Added a test file showing equirect patch working with trunk r42195. Press render to see panorama camera take shot of sky.

NOTE: at this time cycles Environment Map (equirect mapping to sky dome) seems to be broken but it was working previously with this patch applied. Cycles Environment mapping needed to change its mapping to match that of the internal renderer with REAL SKY enabled to map it to the inside of a sphere rather than the outside.

ummmmm correction.... Cycles Environment map not working with *this* particular PNG file... others seems fine ... strange..... However the mapping needs to be changed from X,Y,Z to Y,X,Z to get the Cycles Env to show everything the right way around.

Very glad to see this is getting some attention!

@Dalai: By "support for the glsl material" do you mean the ability to see a preview of the projection in the 3D view as a background? It is true, this would be great for orienting the camera/background without rendering out tests to see if the texture is rotated to the place you would like. Or did you mean something else?

Retested against r42738 and supplied working .blend file against this version to show it works

NOTE: that the Cycles mapping is still as described above where you have to swap X/Y axis in the environment texture mapping options.

It appears to me that most logical mapping of environment maps (equirect) follows from their lat/long origins and that the centreline (X/2) point North == Y+ and the 3/4X position be East == X+ with 0 and X pixels being South from the W and E directions respectively. See demo image inside the latest .blend demo file.

ie: follows normal map conventions of Eastings on the Y axis and Northings on the X axis.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Unknown Status.Dec 20 2011, 12:52 AM