|
Blender V4.3
|
#include "kernel/light/area.h"#include "kernel/light/common.h"#include "kernel/light/light.h"#include "kernel/light/spot.h"#include "kernel/light/triangle.h"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 ¢roid, 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) |
| 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 ) |
Definition at line 235 of file tree.h.
References ccl_global, cross(), EMISSION_SAMPLING_BACK, EMISSION_SAMPLING_FRONT, is_light(), is_triangle(), kernel_assert, kernel_data_fetch, LIGHT_AREA, LIGHT_BACKGROUND, LIGHT_DISTANT, LIGHT_POINT, LIGHT_SPOT, make_float3(), P, safe_normalize(), SD_OBJECT_NEGATIVE_SCALE, SD_OBJECT_TRANSFORM_APPLIED, and triangle_vertices().
Referenced by light_tree_emitter_importance().
| ccl_device float3 compute_v | ( | const float3 | centroid, |
| const float3 | P, | ||
| const float3 | D, | ||
| const float3 | bcone_axis, | ||
| const float | t ) |
Definition at line 43 of file tree.h.
References dot(), fminf, inversesqrtf(), make_orthonormals_tangent(), normalize(), P, and sqr().
Referenced by light_tree_emitter_importance(), and light_tree_node_importance().
| 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().
| ccl_device_inline bool is_leaf | ( | const ccl_global KernelLightTreeNode * | knode | ) |
Definition at line 79 of file tree.h.
References LIGHT_TREE_LEAF.
Referenced by BKE_lib_override_library_is_hierarchy_leaf(), foreachid_is_hierarchy_leaf_fn(), light_tree_pdf(), and light_tree_sample().
| ccl_device_inline bool is_light | ( | const ccl_global KernelLightTreeEmitter * | kemitter | ) |
Definition at line 64 of file tree.h.
Referenced by compute_emitter_centroid_and_dir(), icon_draw_size(), is_mesh(), is_triangle(), light_tree_emitter_importance(), and BlenderSync::sync_recalc().
| ccl_device_inline bool is_mesh | ( | const ccl_global KernelLightTreeEmitter * | kemitter | ) |
Definition at line 69 of file tree.h.
References is_light(), and OBJECT_NONE.
Referenced by light_tree_cluster_select_emitter(), light_tree_emitter_importance(), and OVERLAY_wireframe_cache_populate().
| 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().
| 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().
| 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 ) |
Definition at line 562 of file tree.h.
References ccl_global, float, is_mesh(), kernel_assert, kernel_data_fetch, light_tree_emitter_importance(), LIGHT_TREE_INSTANCE, light_tree_to_local_space(), P, popcount(), and sample_reservoir().
Referenced by light_tree_sample().
| 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().
| 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 ) |
Definition at line 374 of file tree.h.
References area_light_tree_parameters(), background_light_tree_parameters(), ccl_global, clamp(), compute_emitter_centroid_and_dir(), compute_v(), distance(), distant_light_tree_parameters(), dot(), fast_atan2f(), is_light(), is_mesh(), is_triangle(), kernel_assert, kernel_data_fetch, len, LIGHT_AREA, LIGHT_BACKGROUND, LIGHT_DISTANT, LIGHT_POINT, LIGHT_SPOT, light_tree_importance(), light_tree_node_importance(), P, point_light_tree_parameters(), spot_light_tree_parameters(), triangle_light_tree_parameters(), and float3::x.
Referenced by light_tree_child_importance(), light_tree_cluster_select_emitter(), and light_tree_pdf().
| 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 ) |
Definition at line 120 of file tree.h.
References cos_theta(), cosf, dot(), fabsf, fast_acosf(), fast_sincosf(), fmaxf, isequal(), kernel_assert, M_PI_F, N, sin_from_cos(), sin_theta(), and sqr().
Referenced by light_tree_emitter_importance(), and light_tree_node_importance().
| 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 ) |
Definition at line 297 of file tree.h.
References clamp(), compute_v(), distance(), dot(), fabs(), fast_atan2f(), fast_cosf(), FLT_MAX, fmaxf, len, light_tree_cos_bound_subtended_angle(), LIGHT_TREE_DISTANT, light_tree_importance(), N, normalize_len(), and P.
Referenced by light_tree_child_importance(), and light_tree_emitter_importance().
| 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.
| 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 ) |
Definition at line 780 of file tree.h.
References ccl_global, get_left_probability(), is_leaf(), is_triangle(), kernel_data_fetch, light_tree_emitter_importance(), LIGHT_TREE_INSTANCE, light_tree_root_node_index(), light_tree_to_local_space(), N, P, and PATH_RAY_MIS_HAD_TRANSMISSION.
Referenced by light_sample_mis_weight_forward_background(), light_sample_mis_weight_forward_lamp(), light_sample_mis_weight_forward_surface(), and light_tree_pdf().
| 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().
| 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 ) |
Definition at line 709 of file tree.h.
References ccl_global, get_left_probability(), is_leaf(), kernel_data, kernel_data_fetch, light_tree_cluster_select_emitter(), light_tree_root_node_index(), P, sample_reservoir(), and SD_BSDF_HAS_TRANSMISSION.
Referenced by light_sample_from_position(), and light_sample_from_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 ) |
Definition at line 86 of file tree.h.
References is_zero(), kernel_data_fetch, normalize(), normalize_len(), object_fetch_transform(), object_fetch_transform_motion_test(), OBJECT_INVERSE_TRANSFORM, OBJECT_TRANSFORM, P, SD_OBJECT_TRANSFORM_APPLIED, transform_direction(), transform_direction_transposed(), and transform_point().
Referenced by light_tree_cluster_select_emitter(), and light_tree_pdf().
| 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().