7
$\begingroup$

Is it possible to produce a spot light with a different shape than a circle? In particular, I would like to produce a spotlight that casts a squared image into a wall, and the spotlight can be occluded by certain elements in the scene.

Edited: Using Cycles blender

$\endgroup$
3
  • 1
    $\begingroup$ Please specify what render engine you are using. $\endgroup$
    – user1853
    Commented May 22, 2017 at 1:03
  • $\begingroup$ What render engine, are you talking about Cycles? See blender.stackexchange.com/questions/47756/… and blender.stackexchange.com/questions/57013/… . If you simply want a rectangular shape it might be best to simply use an actual object in the 3D scene like a "stencil" to actually occlude the light in a rectangle shape $\endgroup$ Commented May 22, 2017 at 1:04
  • 2
    $\begingroup$ For blender internal just set the spot shape to square. $\endgroup$
    – user1853
    Commented May 22, 2017 at 1:04

1 Answer 1

12
$\begingroup$

The Geometry node Normal can be used to control the profile of the light emitted by a lamp and this can be used with an image texture to give full control of the lamp output.

Consider the following nodes :

material

Here the Geometry Normal is passed through a Mapping node to rotate it into the desired direction before being split into its X,Y,Z components. The X and Y components are adjusted to remove the 'bending' caused by the spherical Normal coordinates (otherwise you get distortion of the image at the corners) before being passed through a second Mapping node (to adjust the aspect ratio of the image) before being passed to the Image node for the texture - simply apply your own image in the Image node.

This can produce the following result :

rendered

Replace the Image with an image of a plain square - or any other shape - for your desired result.

This method will work with the Point and Spot lamp types - but the Spot will also be limited to a circular spot (in the direction of the lamp) so the Point lamp gives more control since you can simply provide whatever image you desire. Note also that the Lamp includes a 'Size' setting - setting to affect the blurriness of the lamp - setting this to zero will produce a very sharp image (as in the above example). Setting it to larger values will produce progressively blurier projections.

$\endgroup$

You must log in to answer this question.

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