3
$\begingroup$

I searched around this place and found a lot of interesting things, but no real answer to my problem so I'm hoping somebody could give me some hints.

So, this is kind of a reversed thing to this cgmatters tutorial, where they create rooms from pictures. I want to depict an architecture (room1) in another, smaller room (room2). Basically room2 ist completely different geometry, but painted/textured in a way that he looks like room1. An optical illusion, comparable to an Ames Room, if you will. https://en.wikipedia.org/wiki/Ames_room

There is a very easy way to do this, and that is the uv project modifier with a camera as projector that has the same angle of view and aspect ratio as the one that took the shot of room1. The results are great, I attached some test pictures at the end. This however leads to extremely different texture resolutions. The sides of the room are high res, the center however is compressed much more by the wide angle (3mm lens) and becomes pixelated.

Unfortunately it seems not to be possible to project panoramicaly from a panoramic camera (as opposed to perspective or orthographic). Maybe I just didn't find the right settings?

Another idea that i really liked was to make the walls of room2 transparent, place room2 inside room1 and then bake what you see through them from the camera to this mesh. Unfortunately I only managed to do that from each planes normal, so it gets a cristalline distortion effect, basically every face has its own perspective. (picasso would have liked it) Is there a way to bake transparency from the viewpoint of the camera, not the normals?

My last idea was to use a bunch of renders, like you would do a stitched panorama. Render, turn camera, render...etc. I could use the rendered files for texture extraction techniques like the ones in cgmatters video, but honestly, that seems tedious.

I would appreciate your insights in this and suggestions for possible solutions.

Thanks in Advance I made a scene to demonstrate what i want to do.

Room 1 is to be depicted on the geometry of room 2

enter image description here

View of Room 1

enter image description here

View of Room 2 using a wideangle projection. this works, but quality is low

enter image description here

View of Room 2(B) using an equirectangular rendering of Room1 as texture. It is not mapped correctly by the UVProject modifier

enter image description here

View of Room2(D) using baked transparencies as texture. These are rendered from the faces normals and thus all "see" through the walls from a different angle.

enter image description here

Explanation why I want to do this, in case you want to know.

What I want to do is create a diorama (in real life), like you would find in a natural history museum. This diorama shall depict a scene in a large building, much larger than the actual space the diorama will be contained in. This is what diorama creators usually do, only that it is a building, not a landscape. The classical method would be to carefully transpose photographs or sketches from the real landscape onto the curved alcove of the diorama and paint over this sketch and grid. But we live in the 21 century and i am no painter, so I have a model of the room, made in blender, and i want to create a texture, that is distorted in such a way, that, if seen from the right position, it will give an illusion of the architecture. he easiest way to imagine this is to imagine the diorama alcove as made of glass. You would then just use what you see through the diorama wall as its texture.

Pictures: older version of the demonstration

Room1 Front View Room1 Front View

Room1 Wide Angle Render Room1 Wide Angle Render

Room2 with picture #2 projected onto it, top view

Room2 with picture #2 projected onto it, top view

Room2, seen as room1 in Picture#1

Room2, seen as room1 in Picture#1

$\endgroup$
4
  • $\begingroup$ Hi and welcome. Have you tried to use multiple cameras for the UV project? providing an example would be helpful. You can upload a blend file using blend-exchange.giantcowfilms.com $\endgroup$
    – lemon
    Commented Sep 29, 2020 at 7:57
  • $\begingroup$ Hi and thanks for the suggestion. I added a file to the original post. I have looked into the multiple camera project method. As far as I understood, it always uses the nearest projector. That would not work, because the core of the perspective illusion is that there is only one camera and only one projector, creating a perfect point of observation. $\endgroup$ Commented Sep 29, 2020 at 8:28
  • $\begingroup$ By panoramic, is it 360 3D view (spherical) or "just" 360 around Z axis? $\endgroup$
    – lemon
    Commented Sep 29, 2020 at 8:47
  • $\begingroup$ @lemon. I actually need only half a panorama. 180deg by 180deg. Using an equirec to make something like a sky dome has the problem that my viewpoint is not in the center of the geometry. I have made a new example file that hopefully helps to show what I want to do. <img src="https://blend-exchange.giantcowfilms.com/embedImage.png?bid=bjOEjxo4" /> $\endgroup$ Commented Sep 29, 2020 at 10:08

1 Answer 1

4
$\begingroup$

I found out how to use an equirectangular image as a projected texture for projection mapping type scenarios. Maybe it's helpful to someone else, so i'll share it here.

  1. Render an equirectangular panorama of the scene. This needs cycles and the camera set to panoramic instead of perspective.
  2. Save the rendered image.
  3. go to the thing you want to project on, go to the Shading-Environment and create a new Material.
  4. add an "Environment Texture" Node and drop your Equirec-Render into it. Plug that into your Principled BSDF, or, if you don't want shadows and stuff, an Emission Node.
  5. add a "Texture Coordinate" Node and connect it's object socket with the "Environment Texture"-Nodes vector socket.
  6. add an "Empty" and place it at the specific location that is supposed to be the center of your projection. (in my case the place where a visitor would stand to see the diorama)
  7. In the texture coordinate node, choose the empty for the "Object" field.
  8. Tweak the projection by moving or rotating the empty.
  9. Slab the material on anything you want to project onto. The Node Setup. The projektor2 object is the empty defining the source or center of the projection The Node Setup. The projektor2 object is the empty defining the source or center of the projection

the diorama. The selected empty is the texture coordinate input the diorama. The selected empty is the texture coordinate input

$\endgroup$
1
  • $\begingroup$ I guess one could also displace the object origin and then point the "Texture Coordinate"-Node to that. This might be a better solution if you want to project on different objects from different points without having to always create an empty and a new material. $\endgroup$ Commented Oct 22, 2020 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .