Dynamic Rendering
- crt.rendering.instance_pass(camera, entities, return_image=False)[source]
Perform an instance segmentation pass with dynamic entities
- Parameters
camera (Camera) – Camera model to be used for generating rays
entities (Union[Entity, List[Entity], Tuple[Entity,...]]) – Entity/Entities against which ray tracing is performed
return_image (bool, optional) – Flag to return an image representation of the instances
Default:False
- Returns
An array unique id codes for each unique entity intersected. If
return_image
is set toTrue
, then an image where each unique id is represented with a unique RGB color is returned as a second output.- Return type
Union[np.ndarray, Tuple(np.ndarray, np.ndarray)]
- crt.rendering.intersection_pass(camera, entities, return_image=False)[source]
Perform a normal pass with dynamic entities
- Parameters
camera (Camera) – Camera model to be used for generating rays
entities (Union[Entity, List[Entity], Tuple[Entity,...]]) – Entity/Entities against which ray tracing is performed
return_image (bool, optional) – Flag to return an image representation of the intersection depth
Default:False
- Returns
An array of the intersected points. If
return_image
is set toTrue
, then an image where the distance to each intersected point is represented via pixel intensity is returned as a second output.- Return type
Union[np.ndarray, Tuple(np.ndarray, np.ndarray)]
- crt.rendering.normal_pass(camera, entities, return_image=False)[source]
Perform a normal pass with dynamic entities
- Parameters
camera (Camera) – Camera model to be used for generating rays
entities (Union[Entity, List[Entity], Tuple[Entity,...]]) – Entity/Entities against which ray tracing is performed
return_image (bool, optional) – Flag to return an image representation of the intersected normals
Default:False
- Returns
An array of the intersected normals. If
return_image
is set toTrue
, then an image where the normal XYZ values are represented using RGB color values is returned as a second output.- Return type
Union[np.ndarray, Tuple(np.ndarray, np.ndarray)]
- crt.rendering.render(camera, lights, entities, min_samples=1, max_samples=1, noise_threshold=1.0, num_bounces=1)[source]
Render a scene with dynamic entities. Prior to rendering, a Bounding Volume Heirarchy will be built from scratch for the entire scene
- Parameters
camera (Camera) – Camera model to be used for generatring rays
lights (Union[Light, List[Light], Tuple[Light,...]]) – Light(s) to be used for rendering
entities (Union[Entity, List[Entity], Tuple[Entity,...]]) – Entity/Entities to be rendered
min_samples (int, optional) – Minimum number of ray samples per pixel
Default:1
max_samples (int, optional) – Maximum number of ray samples per pixel
Default:1
noise_threshold (float, optional) – Pixel noise threshold for adaptive sampling
Default:1
num_bounces (int, optional) – Number of ray bounces