PDA

View Full Version : Cubic environment mapping from a rectangle picture



devdept
03-29-2011, 05:22 AM
Hi All,

What is the most straightforward way to generate a cubic environment mapping from a rectangle picture programmatically?

Thanks,

Alberto

Alfonse Reinheart
03-29-2011, 12:01 PM
What is the most straightforward way to generate a cubic environment mapping from a rectangle picture programmatically?

You don't.

If all you have is a 2D image, then this image is either a spherical projection of some kind (parametrizing the sphere onto a 2D plane) or it is a snapshot of a scene taken from a particular direction.

In the first case, all you need to do is to use the spherical projection parametrization to project your vector directions into texture coordinates. In the second case, the "environment" map is only taken from a single direction. The best you can do here is project geometry onto the environment map, the way you would for projecting a light texture or something. You can't get a full 360-degree panorama from a single still image.

devdept
03-30-2011, 01:52 AM
No Alfonse, I am talking about a rectangulare landscape picture. I saw a program that can make cubic environment mapping starting from this. Are they rendering to bitmap different view of a mapped sphere?

Thanks,

Alberto

Alfonse Reinheart
03-30-2011, 12:00 PM
No Alfonse, I am talking about a rectangulare landscape picture.

Which means what, exactly? Posting a picture of what they use for input would help explain things.


I saw a program that can make cubic environment mapping starting from this. Are they rendering to bitmap different view of a mapped sphere?

Maybe you could link to this program? Or investigate it's documentation. We can't possibly know what algorithm it's using unless we can see what kind of input it takes and what kind of output it produces from that input. Your descriptions simply aren't enough information to say what it's doing.