Blender V4.3
tree.h File Reference

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN ccl_device float light_tree_cos_bound_subtended_angle (const BoundingBox bbox, const float3 centroid, const float3 P)
 
ccl_device float3 compute_v (const float3 centroid, const float3 P, const float3 D, const float3 bcone_axis, const float t)
 
ccl_device_inline bool is_light (const ccl_global KernelLightTreeEmitter *kemitter)
 
ccl_device_inline bool is_mesh (const ccl_global KernelLightTreeEmitter *kemitter)
 
ccl_device_inline bool is_triangle (const ccl_global KernelLightTreeEmitter *kemitter)
 
ccl_device_inline bool is_leaf (const ccl_global KernelLightTreeNode *knode)
 
template<bool in_volume_segment>
ccl_device void light_tree_to_local_space (KernelGlobals kg, const int object_id, ccl_private float3 &P, ccl_private float3 &N_or_D, ccl_private float &t)
 
template<bool in_volume_segment>
ccl_device void light_tree_importance (const float3 N_or_D, const bool has_transmission, const float3 point_to_centroid, const float cos_theta_u, const BoundingCone bcone, const float max_distance, const float min_distance, const float energy, const float theta_d, ccl_private float &max_importance, ccl_private float &min_importance)
 
template<bool in_volume_segment>
ccl_device bool compute_emitter_centroid_and_dir (KernelGlobals kg, ccl_global const KernelLightTreeEmitter *kemitter, const float3 P, ccl_private float3 &centroid, ccl_private packed_float3 &dir)
 
template<bool in_volume_segment>
ccl_device void light_tree_node_importance (KernelGlobals kg, const float3 P, const float3 N_or_D, const float t, const bool has_transmission, const ccl_global KernelLightTreeNode *knode, ccl_private float &max_importance, ccl_private float &min_importance)
 
template<bool in_volume_segment>
ccl_device void light_tree_emitter_importance (KernelGlobals kg, const float3 P, const float3 N_or_D, const float t, const bool has_transmission, int emitter_index, ccl_private float &max_importance, ccl_private float &min_importance)
 
template<bool in_volume_segment>
ccl_device void light_tree_child_importance (KernelGlobals kg, const float3 P, const float3 N_or_D, const float t, const bool has_transmission, const ccl_global KernelLightTreeNode *knode, ccl_private float &max_importance, ccl_private float &min_importance)
 
ccl_device void sample_reservoir (const int current_index, const float current_weight, ccl_private int &selected_index, ccl_private float &selected_weight, ccl_private float &total_weight, ccl_private float &rand)
 
template<bool in_volume_segment>
ccl_device int light_tree_cluster_select_emitter (KernelGlobals kg, ccl_private float &rand, ccl_private float3 &P, ccl_private float3 &N_or_D, ccl_private float &t, const bool has_transmission, ccl_private int *node_index, ccl_private float *pdf_factor)
 
template<bool in_volume_segment>
ccl_device bool get_left_probability (KernelGlobals kg, const float3 P, const float3 N_or_D, const float t, const bool has_transmission, const int left_index, const int right_index, ccl_private float &left_probability)
 
ccl_device int light_tree_root_node_index (KernelGlobals kg, const int object_receiver)
 
template<bool in_volume_segment>
ccl_device_noinline bool light_tree_sample (KernelGlobals kg, const float rand, const float3 P, float3 N_or_D, float t, const int object_receiver, const int shader_flags, ccl_private LightSample *ls)
 
template<bool in_volume_segment>
ccl_device float light_tree_pdf (KernelGlobals kg, float3 P, float3 N, const float dt, const int path_flag, const int object_emitter, const uint index_emitter, const int object_receiver)
 
ccl_device_inline float light_tree_pdf (KernelGlobals kg, float3 P, float3 N, const float dt, const int path_flag, const int emitter_object, const uint emitter_id, const int object_receiver)
 

Function Documentation

◆ compute_emitter_centroid_and_dir()

◆ compute_v()

ccl_device float3 compute_v ( const float3 centroid,
const float3 P,
const float3 D,
const float3 bcone_axis,
const float t )

◆ get_left_probability()

template<bool in_volume_segment>
ccl_device bool get_left_probability ( KernelGlobals kg,
const float3 P,
const float3 N_or_D,
const float t,
const bool has_transmission,
const int left_index,
const int right_index,
ccl_private float & left_probability )

Definition at line 659 of file tree.h.

References ccl_global, float, kernel_data_fetch, light_tree_child_importance(), and P.

Referenced by light_tree_pdf(), and light_tree_sample().

◆ is_leaf()

◆ is_light()

◆ is_mesh()

◆ is_triangle()

ccl_device_inline bool is_triangle ( const ccl_global KernelLightTreeEmitter * kemitter)

Definition at line 74 of file tree.h.

References is_light(), and OBJECT_NONE.

Referenced by compute_emitter_centroid_and_dir(), light_tree_emitter_importance(), and light_tree_pdf().

◆ light_tree_child_importance()

template<bool in_volume_segment>
ccl_device void light_tree_child_importance ( KernelGlobals kg,
const float3 P,
const float3 N_or_D,
const float t,
const bool has_transmission,
const ccl_global KernelLightTreeNode * knode,
ccl_private float & max_importance,
ccl_private float & min_importance )

Definition at line 490 of file tree.h.

References light_tree_emitter_importance(), light_tree_node_importance(), and P.

Referenced by get_left_probability().

◆ light_tree_cluster_select_emitter()

template<bool in_volume_segment>
ccl_device int light_tree_cluster_select_emitter ( KernelGlobals kg,
ccl_private float & rand,
ccl_private float3 & P,
ccl_private float3 & N_or_D,
ccl_private float & t,
const bool has_transmission,
ccl_private int * node_index,
ccl_private float * pdf_factor )

◆ light_tree_cos_bound_subtended_angle()

CCL_NAMESPACE_BEGIN ccl_device float light_tree_cos_bound_subtended_angle ( const BoundingBox bbox,
const float3 centroid,
const float3 P )

Definition at line 27 of file tree.h.

References len_squared(), P, and safe_sqrtf().

Referenced by light_tree_node_importance().

◆ light_tree_emitter_importance()

◆ light_tree_importance()

template<bool in_volume_segment>
ccl_device void light_tree_importance ( const float3 N_or_D,
const bool has_transmission,
const float3 point_to_centroid,
const float cos_theta_u,
const BoundingCone bcone,
const float max_distance,
const float min_distance,
const float energy,
const float theta_d,
ccl_private float & max_importance,
ccl_private float & min_importance )

◆ light_tree_node_importance()

template<bool in_volume_segment>
ccl_device void light_tree_node_importance ( KernelGlobals kg,
const float3 P,
const float3 N_or_D,
const float t,
const bool has_transmission,
const ccl_global KernelLightTreeNode * knode,
ccl_private float & max_importance,
ccl_private float & min_importance )

◆ light_tree_pdf() [1/2]

ccl_device_inline float light_tree_pdf ( KernelGlobals kg,
float3 P,
float3 N,
const float dt,
const int path_flag,
const int emitter_object,
const uint emitter_id,
const int object_receiver )

Definition at line 896 of file tree.h.

References light_tree_pdf(), N, normalize(), P, and PATH_RAY_VOLUME_SCATTER.

◆ light_tree_pdf() [2/2]

◆ light_tree_root_node_index()

ccl_device int light_tree_root_node_index ( KernelGlobals kg,
const int object_receiver )

Definition at line 693 of file tree.h.

References kernel_data, kernel_data_fetch, KERNEL_FEATURE_LIGHT_LINKING, and OBJECT_NONE.

Referenced by light_tree_pdf(), and light_tree_sample().

◆ light_tree_sample()

template<bool in_volume_segment>
ccl_device_noinline bool light_tree_sample ( KernelGlobals kg,
const float rand,
const float3 P,
float3 N_or_D,
float t,
const int object_receiver,
const int shader_flags,
ccl_private LightSample * ls )

◆ light_tree_to_local_space()

◆ sample_reservoir()

ccl_device void sample_reservoir ( const int current_index,
const float current_weight,
ccl_private int & selected_index,
ccl_private float & selected_weight,
ccl_private float & total_weight,
ccl_private float & rand )

Definition at line 520 of file tree.h.

References saturatef.

Referenced by light_tree_cluster_select_emitter(), and light_tree_sample().