CGTalk Projecting lat long to ground using UVs
05-09-2012, 06:54 AM   #1
mingbling
New Member

Join Date: Jan 2003
Posts: 17
Projecting lat long to ground using UVs

I have a panoramic 360̊x180̊ image in equirectangular (lat long) format mapped to a sphere as my environment. I would like to map this same image to a ground plane so that a camera placed roughly where the pano was taken renders the ground perfectly with no distortions. (ie. no matter if I render with the ground plane visibility on/off the rendered image is exactly the same.)

The trick is that I don't want to use useBackground shader as I want to be able translate the camera slightly in the scene and I also want the geometry to be loadable in any 3D application and "just work". I figure I will need to project the UVs onto the geometry to do this.

My assumption was that I could project UVs spherically with the projection center placed at the nodal point of the camera but this doesn't seem to work.

Does anyone have any ideas of how to manipulate the geometry and/or UVs of a ground plane so that a standard lat long image will map to it without distortion from the camera perspective?
Attached Images
 ground_plane.jpg (54.9 KB, 70 views) ground_plane_uv.jpg (57.2 KB, 70 views)

 05-09-2012, 08:46 AM #2 THExDUKE Know-it-All   portfolio Erce Erim 3D Generalist Germany   Join Date: Oct 2008 Posts: 494 Why dont you flatten the lower half of the sphere where it represents your ground? __________________ Cheers Duke Blog share quote
05-09-2012, 01:56 PM   #3
mingbling
New Member

Join Date: Jan 2003
Posts: 17
Quote:
 Originally Posted by THExDUKE Why dont you flatten the lower half of the sphere where it represents your ground?

The ground plane you see selected in my image is exactly that. But a camera placed at eye level just above the ground will see massive texture distortion. The UVs and/or geometry need to be manipulated relative to the camera perspective to correct this. I can approximate this manually but I am looking for a mathematical or maya generated solution that results in a perfect match between the sky sphere and the ground plane when rendered; much like the Use Background shader provides.

 10-09-2012, 09:00 PM #4 pailhead vault dweller   portfolio Dusan Bosnjak Belgrade, Yugoslavia   Join Date: Jul 2003 Posts: 173 That actually severely deforms the would be texture, i have this problem myself, but i'm not sure how to solve it share quote
10-10-2012, 08:00 AM   #5
lostparanoia
Care bear
Mikael
VFX artist - 3D
Malmö, Sweden

Join Date: Dec 2005
Posts: 636
Quote:
 Originally Posted by mingbling The ground plane you see selected in my image is exactly that. But a camera placed at eye level just above the ground will see massive texture distortion. The UVs and/or geometry need to be manipulated relative to the camera perspective to correct this. I can approximate this manually but I am looking for a mathematical or maya generated solution that results in a perfect match between the sky sphere and the ground plane when rendered; much like the Use Background shader provides.

mip_matteshadow provides this functionality. You need to go through some steps to make it work though. First, you need to use a proper mental ray environment instead of your env sphere. In this case I would use a mib_lookup_spherical. it's a bitch to control because you have zero visual representation and you can only rotate it in the Y axis. Unfortunately you can't hook up a ibl to the matteshadow because the people at autodesk obviously decided that this would not be a useful feature. Welcome to mental ray for maya.
Anyway. You hook this environment up to the environment slot (mental ray section) of your camera and to the "background" slot of a mip_matteshadow. Make appropriate adjustments to the mip matteshadow and you're done.
__________________
"No, the movement is good, it just has to travel faster from spot A to spot B in the same amount of time."

 10-10-2012, 08:00 AM #6 CGTalk Moderation Lord of the posts   Join Date: Sep 2003 Posts: 1,066,481 Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote