In my scene it is required to position the lights close to the main object like this:

enter image description here

How I can make the light source invisible to the camera?


In the object properties, you can turn off Ray Visibility of the 'emission object' for the camera:

enter image description here

As of Blender 2.76 the Ray Visibility panel was renamed to Cycles Settings:

enter image description here

As of Blender 2.8x, Ray Visibility panel is now part of the new Visibility Panel:

enter image description here

You can also run this script to toggle the Camera Ray Visibility for selected objects (updated for 2.8x):

import bpy

for obj in bpy.context.selected_objects:

    # toggle mesh lights
    if obj.type == 'MESH':
        for slot in obj.material_slots:
            if slot.material:
                for node in slot.material.node_tree.nodes:
                    if node.type == "EMISSION":
                        obj.cycles_visibility.camera = not obj.cycles_visibility.camera

    # toggle light types
    if obj.type == 'LIGHT':
        obj.cycles_visibility.camera = not obj.cycles_visibility.camera
  • 3
    $\begingroup$ Both of the answers produce the same result, but just to add that in the node setup you have much more control over things. $\endgroup$
    – Vladimir
    Oct 18 '14 at 13:10
  • 4
    $\begingroup$ @Vladimir Note that disabling visibility in the object settings is slightly more efficient performance wise than a node setup. $\endgroup$
    – gandalf3
    Oct 18 '14 at 18:49
  • $\begingroup$ @gandalf3 I didn't know that. But, maybe the node setup can be more useful if the performance is here there the same. Thanks for the tip. $\endgroup$
    – Vladimir
    Oct 19 '14 at 11:32
  • 1
    $\begingroup$ Does not work correctly, it still appears in the bake $\endgroup$
    – Black
    Nov 29 '17 at 20:01
  • $\begingroup$ Can I also exclude it from compositing layers like depth or normals? $\endgroup$ Mar 18 '20 at 11:16

You can setup the emission material in cylcles like this:

enter image description here

Note: @gandalf3 mentioned that disabling visibility is slightly more efficient performance wise than this node setup.


enter image description here

Well, in Blender 2.79 just turning the camera ray off did not work as I expected. So I did a new trick. It Works fine for me.

  • 8
    $\begingroup$ Answers should be more in depth than a simple screenshot. What did you do differently? Why was the accepted answer insufficient? FWIW, the accepted answer still works fine in 2.79, something else must be different in your scene. Is your light behind glass, for example? That would cause rays hitting it to be transmissions rays rather than camera rays. $\endgroup$
    – JtheNinja
    Jun 27 '18 at 5:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.