and these are mostly out of sight
but we can still see them!
Please read How is Cycles different from Blender Internal first.
Most materials [and objects] scatter light, so Cycles needs to account for light bouncing in different directions. How this is done depends on which [Integrator] is used.
Objects scatter light even if they are outside of the visible frame.
If you remove them, you will likely receive a different result, even if they weren't directly visible. There are many ways to restrict rendering manually.
You could do a check with python to see if an object is in the cameras frustum. Adapting the code from this reddit post1 we can select all the objects which don't contain points in the frustum. However for a production ready check, we would also have to take edges/faces modifiers and reflections into account.+
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view
def check_if_vertices_in_frustum(scene, cam, obj):
mat_world = obj.matrix_world
cs, ce = cam.data.clip_start, cam.data.clip_end
for v in obj.data.vertices:
co_ndc = world_to_camera_view(scene, cam, mat_world * v.co)
#check wether point is inside frustum
if (0.0 < co_ndc.x < 1.0 and
0.0 < co_ndc.y < 1.0 and
cs < co_ndc.z < ce):
scene = bpy.context.scene
cam = scene.camera
for obj in scene.objects:
if obj.type == 'MESH':
if (check_if_vertices_in_frustum(scene, cam, obj)):
obj.select = False
# obj.hide_render = False
obj.select = True
# obj.hide_render = True
1 Help with finding whether a vertex is visible from a camera or not