Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/geom_bvh_subsurface.h
| Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| ssef tsplat(0.0f, 0.0f, -isect_t, -isect_t); | ssef tsplat(0.0f, 0.0f, -isect_t, -isect_t); | ||||
| gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | ||||
| #endif | #endif | ||||
| IsectPrecalc isect_precalc; | |||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| /* traversal loop */ | /* traversal loop */ | ||||
| do { | do { | ||||
| do | do | ||||
| { | { | ||||
| /* traverse internal nodes */ | /* traverse internal nodes */ | ||||
| while(nodeAddr >= 0 && nodeAddr != ENTRYPOINT_SENTINEL) | while(nodeAddr >= 0 && nodeAddr != ENTRYPOINT_SENTINEL) | ||||
| { | { | ||||
| bool traverseChild0, traverseChild1; | bool traverseChild0, traverseChild1; | ||||
| ▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | #endif | ||||
| if(tri_object != subsurface_object) | if(tri_object != subsurface_object) | ||||
| continue; | continue; | ||||
| /* intersect ray against primitive */ | /* intersect ray against primitive */ | ||||
| uint type = kernel_tex_fetch(__prim_type, primAddr); | uint type = kernel_tex_fetch(__prim_type, primAddr); | ||||
| switch(type & PRIMITIVE_ALL) { | switch(type & PRIMITIVE_ALL) { | ||||
| case PRIMITIVE_TRIANGLE: { | case PRIMITIVE_TRIANGLE: { | ||||
| triangle_intersect_subsurface(kg, isect_array, P, dir, object, primAddr, isect_t, &num_hits, lcg_state, max_hits); | triangle_intersect_subsurface(kg, &isect_precalc, isect_array, P, dir, object, primAddr, isect_t, &num_hits, lcg_state, max_hits); | ||||
| break; | break; | ||||
| } | } | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| case PRIMITIVE_MOTION_TRIANGLE: { | case PRIMITIVE_MOTION_TRIANGLE: { | ||||
| motion_triangle_intersect_subsurface(kg, isect_array, P, dir, ray->time, object, primAddr, isect_t, &num_hits, lcg_state, max_hits); | motion_triangle_intersect_subsurface(kg, isect_array, P, dir, ray->time, object, primAddr, isect_t, &num_hits, lcg_state, max_hits); | ||||
| break; | break; | ||||
| } | } | ||||
| #endif | #endif | ||||
| Show All 9 Lines | #if FEATURE(BVH_INSTANCING) | ||||
| if(subsurface_object == kernel_tex_fetch(__prim_object, -primAddr-1)) { | if(subsurface_object == kernel_tex_fetch(__prim_object, -primAddr-1)) { | ||||
| object = subsurface_object; | object = subsurface_object; | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect_t, &ob_tfm); | bvh_instance_motion_push(kg, object, ray, &P, &dir, &idir, &isect_t, &ob_tfm); | ||||
| #else | #else | ||||
| bvh_instance_push(kg, object, ray, &P, &dir, &idir, &isect_t); | bvh_instance_push(kg, object, ray, &P, &dir, &idir, &isect_t); | ||||
| #endif | #endif | ||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| #if defined(__KERNEL_SSE2__) | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[0] = ssef(P.x); | Psplat[0] = ssef(P.x); | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); | tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); | ||||
| Show All 21 Lines | if(stackPtr >= 0) { | ||||
| /* instance pop */ | /* instance pop */ | ||||
| #if FEATURE(BVH_MOTION) | #if FEATURE(BVH_MOTION) | ||||
| bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, &isect_t, &ob_tfm); | bvh_instance_motion_pop(kg, object, ray, &P, &dir, &idir, &isect_t, &ob_tfm); | ||||
| #else | #else | ||||
| bvh_instance_pop(kg, object, ray, &P, &dir, &idir, &isect_t); | bvh_instance_pop(kg, object, ray, &P, &dir, &idir, &isect_t); | ||||
| #endif | #endif | ||||
| triangle_intersect_precalc(dir, &isect_precalc); | |||||
| #if defined(__KERNEL_SSE2__) | #if defined(__KERNEL_SSE2__) | ||||
| Psplat[0] = ssef(P.x); | Psplat[0] = ssef(P.x); | ||||
| Psplat[1] = ssef(P.y); | Psplat[1] = ssef(P.y); | ||||
| Psplat[2] = ssef(P.z); | Psplat[2] = ssef(P.z); | ||||
| tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); | tsplat = ssef(0.0f, 0.0f, -isect_t, -isect_t); | ||||
| gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); | ||||
| Show All 16 Lines | |||||