6

Kind of like a TV, CCTV, or the portal for Portal and Portal 2, so I can see what the camera is seeing on an object. I don't care whether its a material or a modifier, or something like that, even if someone will make a script that is a node or whatever as long as it works, nothing specific as in how I would go about it.

chabad360
  • 208
  • 1
  • 2
  • 9
  • I'm not looking for an effect, I'm looking for a way to see the camera on an object. – chabad360 Mar 03 '16 at 03:43
  • 1
    What do you want to view, or visualize? Do you just want to see what part of the scene the camera can see? – David Mar 03 '16 at 04:10
  • yes (I have a gut feeling that this is only possible with a custom pynode, and I havent gotten around to learning it python) – chabad360 Mar 03 '16 at 04:21
  • maybe related: http://blender.stackexchange.com/questions/7812/live-display-of-a-camera-output-in-the-game-engine –  Mar 03 '16 at 04:35
  • yes, that would work but I want it in cycles. – chabad360 Mar 03 '16 at 20:31
  • It would be especially useful for animations – chabad360 Mar 03 '16 at 20:34
  • I made this work in 3.5.1 with the added benefits of:
    • Not needing to wait until the end of the workflow to set this up. The objects, and not just the data blocks, are duplicated in each of the scenes (when making a new scene, make a "linked copy").
    • supporting multiple CCTV cameras/screens. I even managed to support the screens overlapping each other and having one properly obscure the other. See the example scene. I've named things a bit more clearly to help understand the various relationships. The UI in later versions of Blen
    – Dave Whitney May 07 '23 at 16:28

2 Answers2

13

I think you have two options: one in "real time" and another two-stepped.

The two steps workflow

This is the simplest one. You have your scene with two cameras and a screen in which we are going to see the view of one of the cameras.

The first step is rendering the view of the CCTV camera so you have an image sequence of what camera is seeing. For this, select the camera Ctrl Numpad 0 to make it the scene's active camera. Then render the scene.

Note that this render might have the same aspect ratio than your screen object.

After the render, simply add the image sequence as a texture on your screen material. Make the other camera the active one and render.

The "real time" workflow

With this workflow, which involves the compositor, you'll be able to see the real view of the CCTV camera in one F12 push.

Having your scene with the two cameras and the screen, these are the steps. (Also I've provided an example .blend below)

  1. As a scene can only have one active camera in any given frame, we need another scene for rendering the CCTV camera. So create a new scene with Linked Object Data. Doing so, if you change datablock related stuff in any scene, it changes in both. But not transformations so I recommend waiting until the end to start this workflow. enter image description here

  2. In this new scene (lets call it CCTV scene) select your CCTV camera and make it the active one by Ctrl Numpad 0 it.

  3. If necessary, change that scene's render dimensions to match the screen's aspect ratio.
  4. In the main scene select the screen object and move it to another layer alone. Press M and hold Shift when you select the new layer so you can have it in both layers. Doing this you'll have your main render as expected.
  5. Now go to the Render Layers tab add a new layer, name it "Screen". Enable only the layer where the screen object is and, in the Passes panel, enable the UV pass. enter image description here

  6. Now lets go to the Compositor.

  7. Add the three render layers: the main one and the Screen one from the main scene and the main render layer from the CCTV scene.
  8. Connect the CCTV node image output into the image input of a Map UV node. Then connect the UV output from the Screen render layer to the UV input of the Map UV node.
  9. Now Add the output of that Map UV node to the main render layer. enter image description here

And here is the example file:

Antonio Buch
  • 2,177
  • 14
  • 37
  • 1
    Any suggestions how to handle multiple cameras/screens? In my case the "main" scene is static, possibly masking the uvs using a mask and multiply node? – Teris Jun 26 '17 at 21:15
  • I have to manage multiple instances of this too. Is there any way to make this work with the Material Nodes instead of the Compositor? – RobotUnderscore Jun 29 '17 at 23:41
  • @RobotUnderscore I'm afraid you can't. I think you might need to use the first approach, but rendering as many CCTV cameras as screens you have in your scene. – Antonio Buch Aug 01 '17 at 14:55
  • Blend file doesn't render in Blender 2.79 – Jubei Jul 18 '18 at 09:47
  • @Jubei I don't know why it doesn't. Anyway, download Blender 2.77 and it would render with no problems. – Antonio Buch Sep 10 '18 at 09:14
  • 1
    @Jubei Works fine for me in 2.79a. – B Layer Sep 23 '18 at 12:25
  • How would this work in 2.8? – riccardolardi Aug 29 '19 at 14:58
  • @riccardolardi It works almost the same, changing Layers for Collections and Render Layers for View Layers. The only issue is that in 2.8x and object can only be in one collection, so the step 4 won't work. To make it work, open the example file, delete Collection 2, move the Plane to a new Collection. Then, under Screen View Layer, disable Collection 1.001. F12 and voilà :) – Antonio Buch Feb 23 '20 at 12:26
-1

Did you try the compositor?

Just create a camera that points at what you want, render that camera into a file and use that file as a texture on the monitor displaying the "camera feed".

Technically, yes, this will make the "feed" lag behind one frame, but really nobody will notice.

AdamTM
  • 124
  • 1