6
$\begingroup$

My goal is to create a realistic reproduction of a projector mounted on the ceiling. So far I can reproduce a projector that is projecting straight. But I cannot wrap my head around how to correct perspective distortion when the projector is tilted down.

Edit: The Solution shoud work like you woud expect from a real world projector. With the light beam originating from the lamp position spreading out onto the surface and interacting with objects in between.

For a projector that points 90° to the wall evything works fine. enter image description here

As soon as i tilt the Projector i introduce Perspective distortion enter image description here

Node tree to get the lamp to project a texture without barrel distorion like here or here

current projectore node tree

This example file:

$\endgroup$
1
  • $\begingroup$ It would also be nice if we could calculate the Scale and settings direcly from the projector position relative to the wall. $\endgroup$
    – J.Doe
    Apr 6, 2020 at 14:33

5 Answers 5

6
+50
$\begingroup$

I don't know whether this suits, you might be wanting more of a simulation of real lenses. But we have an unusual advantage here in CG-world .. the projector can know how far away it is from the points it's projecting onto, via a Ray Length output of a Light Path node.

By similar triangles, (multiplying the normal by the ray-length) the spherical look-up, using the lamp's normal direction, can be corrected back to an orthogonal look-up into the texture, correcting the keystone.

Assuming the lamp is rotating around its X axis, that angle can be used in a driver to correct the aspect ratio of the resulting rectangle.A sine is taken only because the wall is at 90 degrees. If the lamp was projecting onto the floor, or the lamp was parented to a screen with its Z pointing towards it, that would be a cosine.

enter image description here

I've also set the lamp's falloff to 'Constant', so the image is evenly bright. You may want to switch that out.

enter image description here

$\endgroup$
1
  • $\begingroup$ Hmm actualy now after trying to work with this solution i realized it dosnt work the way you would expect form a projector. When i put Objects in the Path of the Light not in the plane which its projecting onto.. the Light beam compes from a totaly unexpected angle and not the Position of the Projecting Lamp. $\endgroup$
    – J.Doe
    Apr 22, 2020 at 16:16
3
$\begingroup$

I made a node group. It isn't perfect but works just fine for non-extreme cases. Hope this helps corrected projection node setup keystone correction node group This node group can be further condensed, but it is better this way for better clarity.

To know what Horizontal and Vertical inputs mean see: Keystone Correction

$\endgroup$
1
  • 1
    $\begingroup$ this helps already a lot! Now all thats left is to get rid of the distorion :) $\endgroup$
    – J.Doe
    Apr 3, 2020 at 15:30
2
$\begingroup$

I found another method to correct keystone distortion thanks to this paper. It too has its limitations. I guess if you take an average of this and my previous setup, you would get the best result. Corrected projection Node Setup Node Group

$\endgroup$
2
$\begingroup$

I don't know if this is the mathematically correct way to do it, but this worked for me:

Blender Nodes Setup

Based on a video from CGMatter: https://www.youtube.com/watch?v=adahnQCqmw0

The nodes additionally modify the Z value before dividing to achieve a perspective correction. This is done by multiplying the X or Y value of the normal vector by the amount of correction desired and then adding it to the Z value.

This is the result:

Blender Projector

$\endgroup$
0
$\begingroup$

Thanks, I had the same query. But to avoid the non linear distorsion of the edges I've found this node setup.Correction Keystone

I couldn't explain why it works though.

$\endgroup$
1
  • $\begingroup$ what did you change? $\endgroup$
    – J.Doe
    Oct 20, 2020 at 12:20

You must log in to answer this question.

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