Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/geom_bvh.h
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| /* Subsurface scattering BVH traversal */ | /* Subsurface scattering BVH traversal */ | ||||
| #if defined(__SUBSURFACE__) | #if defined(__SUBSURFACE__) | ||||
| #define BVH_FUNCTION_NAME bvh_intersect_subsurface | #define BVH_FUNCTION_NAME bvh_intersect_subsurface | ||||
| #define BVH_FUNCTION_FEATURES 0 | #define BVH_FUNCTION_FEATURES 0 | ||||
| #include "geom_bvh_subsurface.h" | #include "geom_bvh_subsurface.h" | ||||
| #endif | #endif | ||||
| #if defined(__SUBSURFACE__) && defined(__INSTANCING__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_subsurface_instancing | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING | |||||
| #include "geom_bvh_subsurface.h" | |||||
| #endif | |||||
| #if defined(__SUBSURFACE__) && defined(__HAIR__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR | |||||
| #include "geom_bvh_subsurface.h" | |||||
| #endif | |||||
| #if defined(__SUBSURFACE__) && defined(__OBJECT_MOTION__) | #if defined(__SUBSURFACE__) && defined(__OBJECT_MOTION__) | ||||
| #define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion | #define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion | ||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION | #define BVH_FUNCTION_FEATURES BVH_MOTION | ||||
| #include "geom_bvh_subsurface.h" | |||||
| #endif | |||||
| #if defined(__SUBSURFACE__) && defined(__HAIR__) && defined(__OBJECT_MOTION__) | |||||
| #define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair_motion | |||||
| #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION | |||||
| #include "geom_bvh_subsurface.h" | #include "geom_bvh_subsurface.h" | ||||
| #endif | #endif | ||||
| /* Volume BVH traversal */ | /* Volume BVH traversal */ | ||||
| #if defined(__VOLUME__) | #if defined(__VOLUME__) | ||||
| #define BVH_FUNCTION_NAME bvh_intersect_volume | #define BVH_FUNCTION_NAME bvh_intersect_volume | ||||
| #define BVH_FUNCTION_FEATURES 0 | #define BVH_FUNCTION_FEATURES 0 | ||||
| ▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | ccl_device_intersect void scene_intersect_subsurface(KernelGlobals *kg, | ||||
| const Ray *ray, | const Ray *ray, | ||||
| SubsurfaceIntersection *ss_isect, | SubsurfaceIntersection *ss_isect, | ||||
| int subsurface_object, | int subsurface_object, | ||||
| uint *lcg_state, | uint *lcg_state, | ||||
| int max_hits) | int max_hits) | ||||
| { | { | ||||
| #ifdef __OBJECT_MOTION__ | #ifdef __OBJECT_MOTION__ | ||||
| if(kernel_data.bvh.have_motion) { | if(kernel_data.bvh.have_motion) { | ||||
| #ifdef __HAIR__ | |||||
| if(kernel_data.bvh.have_curves) { | |||||
| return bvh_intersect_subsurface_hair_motion(kg, | |||||
| ray, | |||||
| ss_isect, | |||||
| subsurface_object, | |||||
| lcg_state, | |||||
| max_hits); | |||||
| } | |||||
| #endif /* __HAIR__ */ | |||||
| return bvh_intersect_subsurface_motion(kg, | return bvh_intersect_subsurface_motion(kg, | ||||
| ray, | ray, | ||||
| ss_isect, | ss_isect, | ||||
| subsurface_object, | subsurface_object, | ||||
| lcg_state, | lcg_state, | ||||
| max_hits); | max_hits); | ||||
| } | } | ||||
| #endif /* __OBJECT_MOTION__ */ | #endif /* __OBJECT_MOTION__ */ | ||||
| #ifdef __HAIR__ | |||||
| if(kernel_data.bvh.have_curves) { | |||||
| return bvh_intersect_subsurface_hair(kg, | |||||
| ray, | |||||
| ss_isect, | |||||
| subsurface_object, | |||||
| lcg_state, | |||||
| max_hits); | |||||
| } | |||||
| #endif /* __HAIR__ */ | |||||
| #ifdef __KERNEL_CPU__ | |||||
| #ifdef __INSTANCING__ | |||||
| if(kernel_data.bvh.have_instancing) { | |||||
| return bvh_intersect_subsurface_instancing(kg, | |||||
| ray, | |||||
| ss_isect, | |||||
| subsurface_object, | |||||
| lcg_state, | |||||
| max_hits); | |||||
| } | |||||
| #endif /* __INSTANCING__ */ | |||||
| return bvh_intersect_subsurface(kg, | |||||
| ray, | |||||
| ss_isect, | |||||
| subsurface_object, | |||||
| lcg_state, | |||||
| max_hits); | |||||
| #else /* __KERNEL_CPU__ */ | |||||
| #ifdef __INSTANCING__ | |||||
| return bvh_intersect_subsurface_instancing(kg, | |||||
| ray, | |||||
| ss_isect, | |||||
| subsurface_object, | |||||
| lcg_state, | |||||
| max_hits); | |||||
| #else | |||||
| return bvh_intersect_subsurface(kg, | return bvh_intersect_subsurface(kg, | ||||
| ray, | ray, | ||||
| ss_isect, | ss_isect, | ||||
| subsurface_object, | subsurface_object, | ||||
| lcg_state, | lcg_state, | ||||
| max_hits); | max_hits); | ||||
| #endif /* __INSTANCING__ */ | |||||
| #endif /* __KERNEL_CPU__ */ | |||||
| } | } | ||||
| #endif | #endif | ||||
| #ifdef __SHADOW_RECORD_ALL__ | #ifdef __SHADOW_RECORD_ALL__ | ||||
| ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg, const Ray *ray, Intersection *isect, uint max_hits, uint *num_hits) | ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg, const Ray *ray, Intersection *isect, uint max_hits, uint *num_hits) | ||||
| { | { | ||||
| #ifdef __OBJECT_MOTION__ | #ifdef __OBJECT_MOTION__ | ||||
| if(kernel_data.bvh.have_motion) { | if(kernel_data.bvh.have_motion) { | ||||
| ▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines | |||||