Camera mapping wrong #43346

Closed
opened 2015-01-21 20:56:21 +01:00 by Anna Celarek · 15 comments

System Information
Windows 7, Nvidia gtx 550Ti
Ubuntu

Blender Version
Broken: 83cbcef
6b655ca
2.73a official

Short description of error
World texture with camera mapping is mapped spherically (?) and in the wrong place

Exact steps for others to reproduce the error
Put a texture with camera mapping as world background texture, or see the attached file. Render (F12) or turn on viewport render.

  1. observe how the image bends on the camera edges, as if it was slightly spherical
  2. observe how the image corner is in the camera middle.
    The expected behavior is that the image would map exactly onto the camera view (so the image edges would align with the edges of the camera view, and the left top corner of the image would be in the left top corner of the camera).
    The shift is the minor problem, the user can solve it with a mapping node, but I found no workaround for the bending.
**System Information** Windows 7, Nvidia gtx 550Ti Ubuntu **Blender Version** Broken: 83cbcef 6b655ca 2.73a official **Short description of error** World texture with camera mapping is mapped spherically (?) and in the wrong place **Exact steps for others to reproduce the error** Put a texture with camera mapping as world background texture, or see the attached file. Render (F12) or turn on viewport render. 1. observe how the image bends on the camera edges, as if it was slightly spherical 2. observe how the image corner is in the camera middle. The expected behavior is that the image would map exactly onto the camera view (so the image edges would align with the edges of the camera view, and the left top corner of the image would be in the left top corner of the camera). The shift is the minor problem, the user can solve it with a mapping node, but I found no workaround for the bending.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AnnaCelarek

Added subscriber: @AnnaCelarek
Author
![background_screenshot.jpg](https://archive.blender.org/developer/F138627/background_screenshot.jpg) [background_test.blend](https://archive.blender.org/developer/F138629/background_test.blend)
Sergey Sharybin was assigned by Bastien Montagne 2015-01-22 14:21:30 +01:00

Added subscriber: @brecht

Added subscriber: @brecht

I'm not sure why you consider this a bug, it's just how mapping happens to camera space (FOV affects on non-linearity of the mapping, center is on viewplane center). Maybe i'm wrong here and @brecht originally wanted some different behavior in here.

To map texture flat and make it's filling the whole viewplane you need to use window mapping. The only issue with that is that viewport render wouldn't be correct, only final render will have proper window. That i think we need to address at some point, even though it's not totally trivial to do in case of non-camera view in viewport.

I'm not sure why you consider this a bug, it's just how mapping happens to camera space (FOV affects on non-linearity of the mapping, center is on viewplane center). Maybe i'm wrong here and @brecht originally wanted some different behavior in here. To map texture flat and make it's filling the whole viewplane you need to use window mapping. The only issue with that is that viewport render wouldn't be correct, only final render will have proper window. That i think we need to address at some point, even though it's not totally trivial to do in case of non-camera view in viewport.

This is indeed what the "Window" output is for:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Texture_Coordinates

The "Camera" output is the position in camera space. The terminology may be confusing here, it's consistent with that you would find in e.g. Renderman or OSL, but I guess "camera space" is not a very useful concept for users.

This is indeed what the "Window" output is for: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Texture_Coordinates The "Camera" output is the position in camera space. The terminology may be confusing here, it's consistent with that you would find in e.g. Renderman or OSL, but I guess "camera space" is not a very useful concept for users.
Author

That's exactly my problem with using window coordinates, it's not linked to the camera when I zoom.
If you could make the window mapping match the camera frame in camera view (instead of viewport border), I would be totally happy (I'm working on an animation with lots of backgrounds where I need this kind of mapping).
In the case of non-camera view, it's fine and logical as it is now.

To map texture flat and make it's filling the whole viewplane you need to use window mapping. The only issue with that is that viewport render wouldn't be correct, only final render will have proper window. That i think we need to address at some point, even though it's not totally trivial to do in case of non-camera view in viewport.

That's exactly my problem with using window coordinates, it's not linked to the camera when I zoom. If you could make the window mapping match the camera frame in camera view (instead of viewport border), I would be totally happy (I'm working on an animation with lots of backgrounds where I need this kind of mapping). In the case of non-camera view, it's fine and logical as it is now. > To map texture flat and make it's filling the whole viewplane you need to use window mapping. The only issue with that is that viewport render wouldn't be correct, only final render will have proper window. That i think we need to address at some point, even though it's not totally trivial to do in case of non-camera view in viewport.

@AnnaCelarek, i think making it so camera view in viewport uses proper window mapping is what we really need to make working and will look into it.

@AnnaCelarek, i think making it so camera view in viewport uses proper window mapping is what we really need to make working and will look into it.

This issue was referenced by 3b50d3a04f

This issue was referenced by 3b50d3a04f2c3b7202b935652a81a8888b47c84a

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 3b50d3a04f.

Closed by commit 3b50d3a04f.

This issue was referenced by blender/cycles@aee5ac214f

This issue was referenced by blender/cycles@aee5ac214f1852321ff69d0c6136f0cfd71a0c79
Author

Thanks, render view works perfectly now :)

It's still inconsistent though for other views (Solid, Wire, Textured, Material) with N > Display > World Background on (there it maps with the "old" Window method).
But no big issue, since the background can be loaded through the Background Image rollout instead.

Thanks, render view works perfectly now :) It's still inconsistent though for other views (Solid, Wire, Textured, Material) with N > Display > World Background on (there it maps with the "old" Window method). But no big issue, since the background can be loaded through the Background Image rollout instead.

Added subscriber: @Psy-Fi

Added subscriber: @Psy-Fi

Yes, think GLSL needs some tweaks (which might be not so tricial?). @Psy-Fi can know better, will talk to him in irc.

Yes, think GLSL needs some tweaks (which might be not so tricial?). @Psy-Fi can know better, will talk to him in irc.
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#43346
No description provided.