Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/geom/geom_triangle_intersect.h
| Show All 20 Lines | |||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "kernel/kernel_random.h" | #include "kernel/kernel_random.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| ccl_device_inline bool triangle_intersect(ccl_global const KernelGlobals *kg, | ccl_device_inline bool triangle_intersect(KernelGlobals kg, | ||||
| ccl_private Intersection *isect, | ccl_private Intersection *isect, | ||||
| float3 P, | float3 P, | ||||
| float3 dir, | float3 dir, | ||||
| float tmax, | float tmax, | ||||
| uint visibility, | uint visibility, | ||||
| int object, | int object, | ||||
| int prim_addr) | int prim_addr) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| /* Special ray intersection routines for subsurface scattering. In that case we | /* Special ray intersection routines for subsurface scattering. In that case we | ||||
| * only want to intersect with primitives in the same object, and if case of | * only want to intersect with primitives in the same object, and if case of | ||||
| * multiple hits we pick a single random primitive as the intersection point. | * multiple hits we pick a single random primitive as the intersection point. | ||||
| * Returns whether traversal should be stopped. | * Returns whether traversal should be stopped. | ||||
| */ | */ | ||||
| #ifdef __BVH_LOCAL__ | #ifdef __BVH_LOCAL__ | ||||
| ccl_device_inline bool triangle_intersect_local(ccl_global const KernelGlobals *kg, | ccl_device_inline bool triangle_intersect_local(KernelGlobals kg, | ||||
| ccl_private LocalIntersection *local_isect, | ccl_private LocalIntersection *local_isect, | ||||
| float3 P, | float3 P, | ||||
| float3 dir, | float3 dir, | ||||
| int object, | int object, | ||||
| int local_object, | int local_object, | ||||
| int prim_addr, | int prim_addr, | ||||
| float tmax, | float tmax, | ||||
| ccl_private uint *lcg_state, | ccl_private uint *lcg_state, | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| /* Reintersections uses the paper: | /* Reintersections uses the paper: | ||||
| * | * | ||||
| * Tomas Moeller | * Tomas Moeller | ||||
| * Fast, minimum storage ray/triangle intersection | * Fast, minimum storage ray/triangle intersection | ||||
| * http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf | * http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf | ||||
| */ | */ | ||||
| ccl_device_inline float3 triangle_refine(ccl_global const KernelGlobals *kg, | ccl_device_inline float3 triangle_refine(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| float3 P, | float3 P, | ||||
| float3 D, | float3 D, | ||||
| float t, | float t, | ||||
| const int isect_object, | const int isect_object, | ||||
| const int isect_prim) | const int isect_prim) | ||||
| { | { | ||||
| #ifdef __INTERSECTION_REFINE__ | #ifdef __INTERSECTION_REFINE__ | ||||
| Show All 39 Lines | |||||
| #else | #else | ||||
| return P + D * t; | return P + D * t; | ||||
| #endif | #endif | ||||
| } | } | ||||
| /* Same as above, except that t is assumed to be in object space for | /* Same as above, except that t is assumed to be in object space for | ||||
| * instancing. | * instancing. | ||||
| */ | */ | ||||
| ccl_device_inline float3 triangle_refine_local(ccl_global const KernelGlobals *kg, | ccl_device_inline float3 triangle_refine_local(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| float3 P, | float3 P, | ||||
| float3 D, | float3 D, | ||||
| float t, | float t, | ||||
| const int isect_object, | const int isect_object, | ||||
| const int isect_prim) | const int isect_prim) | ||||
| { | { | ||||
| #ifdef __KERNEL_OPTIX__ | #ifdef __KERNEL_OPTIX__ | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||