7 #if BVH_FEATURE(BVH_HAIR)
8 # define NODE_INTERSECT bvh_node_intersect
10 # define NODE_INTERSECT bvh_aligned_node_intersect
22 #ifndef __KERNEL_GPU__
30 const uint visibility,
52 float tmin = ray->tmin;
59 const float tmax = ray->tmax;
60 float tmax_hits = tmax;
62 *r_num_recorded_hits = 0;
70 int node_addr_child1, traverse_mask;
89 if (traverse_mask == 3) {
91 bool is_closest_child1 = (dist[1] < dist[0]);
92 if (is_closest_child1) {
94 node_addr = node_addr_child1;
95 node_addr_child1 = tmp;
104 if (traverse_mask == 2) {
105 node_addr = node_addr_child1;
107 else if (traverse_mask == 0) {
120 if (prim_addr >= 0) {
129 for (; prim_addr < prim_addr2; prim_addr++) {
150 kg, &isect,
P, dir, tmin, tmax, visibility, prim_object, prim, prim_addr);
153 #if BVH_FEATURE(BVH_MOTION)
169 #if BVH_FEATURE(BVH_HAIR)
176 if (ray->time < prim_time.
x || ray->time > prim_time.
y) {
183 hit = curve_intersect(
184 kg, &isect,
P, dir, tmin, tmax, prim_object, prim, ray->time, curve_type);
189 #if BVH_FEATURE(BVH_POINTCLOUD)
194 if (ray->time < prim_time.
x || ray->time > prim_time.
y) {
201 hit = point_intersect(
202 kg, &isect,
P, dir, tmin, tmax, prim_object, prim, ray->time, point_type);
227 bool record_intersection =
true;
232 kg, isect.object, isect.prim, isect.type, isect.u);
238 record_intersection =
false;
242 if (record_intersection) {
245 if (*r_num_recorded_hits < max_record_hits || isect.t < tmax_hits) {
248 const uint num_recorded_hits =
min(*r_num_recorded_hits, max_record_hits);
249 uint isect_index = num_recorded_hits;
250 if (num_recorded_hits + 1 >= max_record_hits) {
252 uint max_recorded_hit = 0;
254 for (
uint i = 1; i < num_recorded_hits; ++i) {
256 if (isect_t > max_t) {
257 max_recorded_hit = i;
262 if (num_recorded_hits >= max_record_hits) {
263 isect_index = max_recorded_hit;
267 tmax_hits =
max(isect.t, max_t);
275 ++(*r_num_recorded_hits);
284 #if BVH_FEATURE(BVH_MOTION)
285 bvh_instance_motion_push(kg,
object, ray, &
P, &dir, &idir);
299 if (stack_ptr >= 0) {
317 const uint visibility,
323 kg, ray,
state, visibility, max_hits, num_recorded_hits, throughput);
326 #undef BVH_FUNCTION_NAME
327 #undef BVH_FUNCTION_FEATURES
328 #undef NODE_INTERSECT
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
#define kernel_assert(cond)
#define ccl_optional_struct_init
#define ccl_device_inline
ccl_device_forceinline int intersection_get_shader_flags(KernelGlobals kg, const int prim, const int type)
#define CURVE_SHADOW_TRANSPARENCY_CUTOFF
ccl_device_inline float intersection_curve_shadow_transparency(KernelGlobals kg, const int object, const int prim, const int type, const float u)
ccl_device_inline bool intersection_skip_self_shadow(ccl_private const RaySelfPrimitives &self, const int object, const int prim)
BLI_Stack * traversal_stack
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
#define ENTRYPOINT_SENTINEL
#define BVH_FUNCTION_FULL_NAME(prefix)
ccl_device_inline void bvh_instance_push(KernelGlobals kg, int object, ccl_private const Ray *ray, ccl_private float3 *P, ccl_private float3 *dir, ccl_private float3 *idir)
ccl_device_inline float3 bvh_clamp_direction(float3 dir)
ccl_device_inline void bvh_instance_pop(ccl_private const Ray *ray, ccl_private float3 *P, ccl_private float3 *dir, ccl_private float3 *idir)
ccl_device_inline float3 bvh_inverse_direction(float3 dir)
@ SD_HAS_TRANSPARENT_SHADOW
@ PRIMITIVE_MOTION_CURVE_RIBBON
@ PRIMITIVE_MOTION_TRIANGLE
@ PRIMITIVE_MOTION_CURVE_THICK
#define INTEGRATOR_SHADOW_ISECT_SIZE
ccl_device_inline bool motion_triangle_intersect(KernelGlobals kg, ccl_private Intersection *isect, float3 P, float3 dir, float tmin, float tmax, float time, uint visibility, int object, int prim, int prim_addr)
ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals kg, ccl_private const Ray *ray, IntegratorShadowState state, const uint visibility, const uint max_hits, ccl_private uint *num_recorded_hits, ccl_private float *throughput)
IntegratorShadowStateCPU *ccl_restrict IntegratorShadowState
#define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
ccl_device_forceinline void integrator_state_write_shadow_isect(IntegratorShadowState state, ccl_private const Intersection *ccl_restrict isect, const int index)
CCL_NAMESPACE_BEGIN ccl_device_inline bool triangle_intersect(KernelGlobals kg, ccl_private Intersection *isect, float3 P, float3 dir, float tmin, float tmax, uint visibility, int object, int prim, int prim_addr)
ccl_device_inline int __float_as_int(float f)