blenderproc.lighting package
Module contents
- blenderproc.lighting.add_intersecting_spot_lights_to_camera_poses(clip_start, clip_end, perform_look_at_intersection_check=True, perform_look_at_pose_visibility_check=True, light_pose_sampling=None, look_at_pose_sampling=None, max_tries_per_cam_pose=10000)
This functions adds spotlights which intersect with the camera pose. This is useful to get a greater variety in lighting situations then the general full illumination from all sides.
The spotlights location is defined by the light_pose_sampling parameter, it gets the eight coordinates of the camera frustum vertices. This camera frustum starts at clip_start and ends at clip_end. It should return a single 3D point. This point is then checked to not be in the camera frustum, if it is inside a new point will be sampled.
After the defining a suitable light position, a look at pose is sampled via the look_pose_sampling function. It uses the same eight coordinates of the camera frustum and the current sampled light position to return a look at pose.
If the perform_look_at_intersection_check value is set an intersection check between the light position and the look at location is done, which ensures that no object is between these two points. Similarly, for the perform_look_at_pose_visibility_check, a newly sampled light pose does not have an intersecting object between this sampled pose and the camera location.
- Parameters:
clip_start (
float
) – The distance between the camera pose and the near clipping plane, used for the sampling of a light and look at locationclip_end (
float
) – The distance between the camera pose and the far clipping plane, used for the sampling of a light and look at locationperform_look_at_intersection_check (
bool
) – If this is True an intersection check between the light pose and the look at pose is done, if an object is inbetween both poses are discarded.perform_look_at_pose_visibility_check (
bool
) – If this is True, an intersection check between the look at pose and the camera location is done, to ensure that the light is visible and not hidden.light_pose_sampling (
Optional
[Callable
[[ndarray
],ndarray
]]) – This function samples a new 3D light pose based on the eight 3D coordinates of the camera frustum. If this is None, the _default_light_pose_sampling is used.look_at_pose_sampling (
Optional
[Callable
[[ndarray
,ndarray
],ndarray
]]) – This function samples a new 3D look at pose based on the eight 3D coordinates of the camera frustum and the currently sampled light pose. If this is None, the _default_look_at_pose_sampling is used.max_tries_per_cam_pose (
int
) – The amount of maximum tries per camera pose for finding a new light pose with look at pose.
- Return type:
- Returns:
The newly generated light
- blenderproc.lighting.light_suncg_scene(lightbulb_emission_strength=15, lampshade_emission_strength=7, ceiling_emission_strength=1.5)
Makes the lamps, windows and ceilings object emit light.
- Parameters:
lightbulb_emission_strength (
float
) – The emission strength that should be used for light bulbs. Default: 15lampshade_emission_strength (
float
) – The emission strength that should be used for lamp shades. Default: 7ceiling_emission_strength (
float
) – The emission strength that should be used for the ceiling. Default: 1.5
- blenderproc.lighting.light_surface(objects, emission_strength=10.0, emission_color=None)
Add emission shader to the materials of the given objects.
- Parameters:
objects (
List
[MeshObject
]) – A list of mesh objects whose materials should emit light.emission_strength (
float
) – The strength of the emitted light.emission_color (
Optional
[list
]) – The color of the light to emit. Default: Color of the surface.