Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/bvh/bvh.h
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| #if defined(__INSTANCING__) | #if defined(__INSTANCING__) | ||||
| # define BVH_FUNCTION_NAME bvh_intersect_instancing | # define BVH_FUNCTION_NAME bvh_intersect_instancing | ||||
| # define BVH_FUNCTION_FEATURES BVH_INSTANCING | # define BVH_FUNCTION_FEATURES BVH_INSTANCING | ||||
| # include "kernel/bvh/bvh_traversal.h" | # include "kernel/bvh/bvh_traversal.h" | ||||
| #endif | #endif | ||||
| #if defined(__HAIR__) | #if defined(__HAIR__) | ||||
| # define BVH_FUNCTION_NAME bvh_intersect_hair | # define BVH_FUNCTION_NAME bvh_intersect_hair | ||||
| # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH | # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR | ||||
| # include "kernel/bvh/bvh_traversal.h" | # include "kernel/bvh/bvh_traversal.h" | ||||
| #endif | #endif | ||||
| #if defined(__OBJECT_MOTION__) | #if defined(__OBJECT_MOTION__) | ||||
| # define BVH_FUNCTION_NAME bvh_intersect_motion | # define BVH_FUNCTION_NAME bvh_intersect_motion | ||||
| # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION | # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION | ||||
| # include "kernel/bvh/bvh_traversal.h" | # include "kernel/bvh/bvh_traversal.h" | ||||
| #endif | #endif | ||||
| #if defined(__HAIR__) && defined(__OBJECT_MOTION__) | #if defined(__HAIR__) && defined(__OBJECT_MOTION__) | ||||
| # define BVH_FUNCTION_NAME bvh_intersect_hair_motion | # define BVH_FUNCTION_NAME bvh_intersect_hair_motion | ||||
| # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH|BVH_MOTION | # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION | ||||
| # include "kernel/bvh/bvh_traversal.h" | # include "kernel/bvh/bvh_traversal.h" | ||||
| #endif | #endif | ||||
| /* Subsurface scattering BVH traversal */ | /* Subsurface scattering BVH traversal */ | ||||
| #if defined(__BVH_LOCAL__) | #if defined(__BVH_LOCAL__) | ||||
| # define BVH_FUNCTION_NAME bvh_intersect_local | # define BVH_FUNCTION_NAME bvh_intersect_local | ||||
| # define BVH_FUNCTION_FEATURES BVH_HAIR | # define BVH_FUNCTION_FEATURES BVH_HAIR | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | ccl_device_inline bool scene_intersect_valid(const Ray *ray) | ||||
| */ | */ | ||||
| return isfinite(ray->P.x); | return isfinite(ray->P.x); | ||||
| } | } | ||||
| /* Note: ray is passed by value to work around a possible CUDA compiler bug. */ | /* Note: ray is passed by value to work around a possible CUDA compiler bug. */ | ||||
| ccl_device_intersect bool scene_intersect(KernelGlobals *kg, | ccl_device_intersect bool scene_intersect(KernelGlobals *kg, | ||||
| const Ray ray, | const Ray ray, | ||||
| const uint visibility, | const uint visibility, | ||||
| Intersection *isect, | Intersection *isect) | ||||
| uint *lcg_state, | |||||
| float difl, | |||||
| float extmax) | |||||
| { | { | ||||
| PROFILING_INIT(kg, PROFILING_INTERSECT); | PROFILING_INIT(kg, PROFILING_INTERSECT); | ||||
| if(!scene_intersect_valid(&ray)) { | if(!scene_intersect_valid(&ray)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| #ifdef __EMBREE__ | #ifdef __EMBREE__ | ||||
| if(kernel_data.bvh.scene) { | if(kernel_data.bvh.scene) { | ||||
| Show All 9 Lines | if(kernel_data.bvh.scene) { | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| #endif /* __EMBREE__ */ | #endif /* __EMBREE__ */ | ||||
| #ifdef __OBJECT_MOTION__ | #ifdef __OBJECT_MOTION__ | ||||
| if(kernel_data.bvh.have_motion) { | if(kernel_data.bvh.have_motion) { | ||||
| # ifdef __HAIR__ | # ifdef __HAIR__ | ||||
| if(kernel_data.bvh.have_curves) | if(kernel_data.bvh.have_curves) | ||||
| return bvh_intersect_hair_motion(kg, &ray, isect, visibility, lcg_state, difl, extmax); | return bvh_intersect_hair_motion(kg, &ray, isect, visibility); | ||||
| # endif /* __HAIR__ */ | # endif /* __HAIR__ */ | ||||
| return bvh_intersect_motion(kg, &ray, isect, visibility); | return bvh_intersect_motion(kg, &ray, isect, visibility); | ||||
| } | } | ||||
| #endif /* __OBJECT_MOTION__ */ | #endif /* __OBJECT_MOTION__ */ | ||||
| #ifdef __HAIR__ | #ifdef __HAIR__ | ||||
| if(kernel_data.bvh.have_curves) | if(kernel_data.bvh.have_curves) | ||||
| return bvh_intersect_hair(kg, &ray, isect, visibility, lcg_state, difl, extmax); | return bvh_intersect_hair(kg, &ray, isect, visibility); | ||||
| #endif /* __HAIR__ */ | #endif /* __HAIR__ */ | ||||
| #ifdef __KERNEL_CPU__ | #ifdef __KERNEL_CPU__ | ||||
| # ifdef __INSTANCING__ | # ifdef __INSTANCING__ | ||||
| if(kernel_data.bvh.have_instancing) | if(kernel_data.bvh.have_instancing) | ||||
| return bvh_intersect_instancing(kg, &ray, isect, visibility); | return bvh_intersect_instancing(kg, &ray, isect, visibility); | ||||
| # endif /* __INSTANCING__ */ | # endif /* __INSTANCING__ */ | ||||
| ▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines | |||||