diff options
author | jon denning <gfxcoder@gmail.com> | 2022-07-29 20:51:49 +0300 |
---|---|---|
committer | jon denning <gfxcoder@gmail.com> | 2022-07-29 20:51:49 +0300 |
commit | 6485941d7a8158381288ce044b657e2c147ff73a (patch) | |
tree | 8fc98916154dfc7d7f57a95732fddb620272d9ac /intern/cycles/kernel/device/cpu/bvh.h | |
parent | eee25a175ad3c0736878918bacd4995e67195ec0 (diff) | |
parent | 9b9417b66150fd070619006dbd233369709edf1b (diff) |
Merge branch 'master' into retopo_transformretopo_transform
Diffstat (limited to 'intern/cycles/kernel/device/cpu/bvh.h')
-rw-r--r-- | intern/cycles/kernel/device/cpu/bvh.h | 89 |
1 files changed, 26 insertions, 63 deletions
diff --git a/intern/cycles/kernel/device/cpu/bvh.h b/intern/cycles/kernel/device/cpu/bvh.h index b5ea3d831f4..6c06232a692 100644 --- a/intern/cycles/kernel/device/cpu/bvh.h +++ b/intern/cycles/kernel/device/cpu/bvh.h @@ -166,16 +166,16 @@ ccl_device_inline void kernel_embree_convert_hit(KernelGlobals kg, } else { isect->type = kernel_data_fetch(objects, isect->object).primitive_type; - isect->u = 1.0f - hit->v - hit->u; - isect->v = hit->u; + isect->u = hit->u; + isect->v = hit->v; } } ccl_device_inline void kernel_embree_convert_sss_hit( KernelGlobals kg, const RTCRay *ray, const RTCHit *hit, Intersection *isect, int object) { - isect->u = 1.0f - hit->v - hit->u; - isect->v = hit->u; + isect->u = hit->u; + isect->v = hit->v; isect->t = ray->tfar; RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData( rtcGetGeometry(kernel_data.device_bvh, object * 2)); @@ -446,19 +446,11 @@ ccl_device void kernel_embree_filter_occluded_func_backface_cull( /* Scene intersection. */ -ccl_device_intersect bool scene_intersect(KernelGlobals kg, - ccl_private const Ray *ray, - const uint visibility, - ccl_private Intersection *isect) +ccl_device_intersect bool kernel_embree_intersect(KernelGlobals kg, + ccl_private const Ray *ray, + const uint visibility, + ccl_private Intersection *isect) { - if (!intersection_ray_valid(ray)) { - return false; - } - - if (!kernel_data.device_bvh) { - return false; - } - isect->t = ray->tmax; CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_REGULAR); IntersectContext rtc_ctx(&ctx); @@ -476,24 +468,13 @@ ccl_device_intersect bool scene_intersect(KernelGlobals kg, } #ifdef __BVH_LOCAL__ -ccl_device_intersect bool scene_intersect_local(KernelGlobals kg, - ccl_private const Ray *ray, - ccl_private LocalIntersection *local_isect, - int local_object, - ccl_private uint *lcg_state, - int max_hits) +ccl_device_intersect bool kernel_embree_intersect_local(KernelGlobals kg, + ccl_private const Ray *ray, + ccl_private LocalIntersection *local_isect, + int local_object, + ccl_private uint *lcg_state, + int max_hits) { - if (!intersection_ray_valid(ray)) { - if (local_isect) { - local_isect->num_hits = 0; - } - return false; - } - - if (!kernel_data.device_bvh) { - return false; - } - const bool has_bvh = !(kernel_data_fetch(object_flag, local_object) & SD_OBJECT_TRANSFORM_APPLIED); CCLIntersectContext ctx(kg, @@ -544,24 +525,14 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals kg, #endif #ifdef __SHADOW_RECORD_ALL__ -ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg, - IntegratorShadowStateCPU *state, - ccl_private const Ray *ray, - uint visibility, - uint max_hits, - ccl_private uint *num_recorded_hits, - ccl_private float *throughput) +ccl_device_intersect bool kernel_embree_intersect_shadow_all(KernelGlobals kg, + IntegratorShadowStateCPU *state, + ccl_private const Ray *ray, + uint visibility, + uint max_hits, + ccl_private uint *num_recorded_hits, + ccl_private float *throughput) { - if (!intersection_ray_valid(ray)) { - *num_recorded_hits = 0; - *throughput = 1.0f; - return false; - } - - if (!kernel_data.device_bvh) { - return false; - } - CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SHADOW_ALL); Intersection *isect_array = (Intersection *)state->shadow_isect; ctx.isect_s = isect_array; @@ -579,20 +550,12 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals kg, #endif #ifdef __VOLUME__ -ccl_device_intersect uint scene_intersect_volume(KernelGlobals kg, - ccl_private const Ray *ray, - ccl_private Intersection *isect, - const uint max_hits, - const uint visibility) +ccl_device_intersect uint kernel_embree_intersect_volume(KernelGlobals kg, + ccl_private const Ray *ray, + ccl_private Intersection *isect, + const uint max_hits, + const uint visibility) { - if (!intersection_ray_valid(ray)) { - return false; - } - - if (!kernel_data.device_bvh) { - return false; - } - CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_VOLUME_ALL); ctx.isect_s = isect; ctx.max_hits = max_hits; |