Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/geom_bvh.h
| Context not available. | |||||
| #include "geom_bvh_volume.h" | #include "geom_bvh_volume.h" | ||||
| #endif | #endif | ||||
| /* Record all BVH intersection for volumes */ | |||||
| #if defined(__VOLUME_RECORD_ALL__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume_all | |||||
| #define BVH_FUNCTION_FEATURES 0 | |||||
| #include "geom_bvh_volume_all.h" | |||||
| #endif | |||||
| #if defined(__VOLUME_RECORD_ALL__) && defined(__INSTANCING__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume_all_instancing | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING | |||||
| #include "geom_bvh_volume_all.h" | |||||
| #endif | |||||
| #if defined(__VOLUME_RECORD_ALL__) && defined(__HAIR__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume_all_hair | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH | |||||
| #include "geom_bvh_volume_all.h" | |||||
| #endif | |||||
| #if defined(__VOLUME_RECORD_ALL__) && defined(__OBJECT_MOTION__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume_all_motion | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION | |||||
| #include "geom_bvh_volume_all.h" | |||||
| #endif | |||||
| #if defined(__VOLUME_RECORD_ALL__) && defined(__HAIR__) && defined(__OBJECT_MOTION__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume_all_hair_motion | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH|BVH_MOTION | |||||
| #include "geom_bvh_volume_all.h" | |||||
| #endif | |||||
| #undef BVH_FEATURE | #undef BVH_FEATURE | ||||
| #undef BVH_NAME_JOIN | #undef BVH_NAME_JOIN | ||||
| #undef BVH_NAME_EVAL | #undef BVH_NAME_EVAL | ||||
| Context not available. | |||||
| } | } | ||||
| #endif | #endif | ||||
| #ifdef __VOLUME_RECORD_ALL__ | |||||
| ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals *kg, | |||||
| const Ray *ray, | |||||
| Intersection *isect, | |||||
| const uint max_hits) | |||||
| { | |||||
| #ifdef __OBJECT_MOTION__ | |||||
| if(kernel_data.bvh.have_motion) { | |||||
| #ifdef __HAIR__ | |||||
| if(kernel_data.bvh.have_curves) | |||||
| return bvh_intersect_volume_all_hair_motion(kg, ray, isect, max_hits); | |||||
| #endif /* __HAIR__ */ | |||||
| return bvh_intersect_volume_all_motion(kg, ray, isect, max_hits); | |||||
| } | |||||
| #endif /* __OBJECT_MOTION__ */ | |||||
| #ifdef __HAIR__ | |||||
| if(kernel_data.bvh.have_curves) | |||||
| return bvh_intersect_volume_all_hair(kg, ray, isect, max_hits); | |||||
| #endif /* __HAIR__ */ | |||||
| #ifdef __INSTANCING__ | |||||
| if(kernel_data.bvh.have_instancing) | |||||
| return bvh_intersect_volume_all_instancing(kg, ray, isect, max_hits); | |||||
| #endif /* __INSTANCING__ */ | |||||
| return bvh_intersect_volume_all(kg, ray, isect, max_hits); | |||||
| } | |||||
| #endif | |||||
| /* Ray offset to avoid self intersection. | /* Ray offset to avoid self intersection. | ||||
| * | * | ||||
| Context not available. | |||||
| #endif | #endif | ||||
| } | } | ||||
| ccl_device_noinline int bvh_intersections_compare(const void *a, const void *b) | |||||
| { | |||||
| const Intersection *isect_a = (const Intersection*)a; | |||||
| const Intersection *isect_b = (const Intersection*)b; | |||||
| if(isect_a->t < isect_b->t) | |||||
| return -1; | |||||
| else if(isect_a->t > isect_b->t) | |||||
| return 1; | |||||
| else | |||||
| return 0; | |||||
| } | |||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| Context not available. | |||||