Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/bvh/bvh.h
| Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | #ifdef __KERNEL_OPTIX__ | ||||
| uint p5 = PRIMITIVE_NONE; | uint p5 = PRIMITIVE_NONE; | ||||
| optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | ||||
| ray->P, | ray->P, | ||||
| ray->D, | ray->D, | ||||
| 0.0f, | 0.0f, | ||||
| ray->t, | ray->t, | ||||
| ray->time, | ray->time, | ||||
| 0xFF, | 0xF, | ||||
| OPTIX_RAY_FLAG_NONE, | OPTIX_RAY_FLAG_NONE, | ||||
| 0, // SBT offset for PG_HITD | |||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, // SBT offset for PG_HITD | |||||
| p0, | p0, | ||||
| p1, | p1, | ||||
| p2, | p2, | ||||
| p3, | p3, | ||||
| p4, | p4, | ||||
| p5); | p5); | ||||
| isect->t = __uint_as_float(p0); | isect->t = __uint_as_float(p0); | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (local_isect) { | ||||
| local_isect->num_hits = 0; // Initialize hit count to zero | local_isect->num_hits = 0; // Initialize hit count to zero | ||||
| } | } | ||||
| optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | ||||
| ray->P, | ray->P, | ||||
| ray->D, | ray->D, | ||||
| 0.0f, | 0.0f, | ||||
| ray->t, | ray->t, | ||||
| ray->time, | ray->time, | ||||
| // Skip curves | |||||
| 0x3, | |||||
| // Need to always call into __anyhit__kernel_optix_local_hit | // Need to always call into __anyhit__kernel_optix_local_hit | ||||
| 0xFF, | |||||
| OPTIX_RAY_FLAG_ENFORCE_ANYHIT, | OPTIX_RAY_FLAG_ENFORCE_ANYHIT, | ||||
| 1, | 2, // SBT offset for PG_HITL | ||||
| 0, | |||||
| 0, | 0, | ||||
| 0, // SBT offset for PG_HITL | |||||
| p0, | p0, | ||||
| p1, | p1, | ||||
| p2, | p2, | ||||
| p3, | p3, | ||||
| p4, | p4, | ||||
| p5); | p5); | ||||
| return p5; | return p5; | ||||
| ▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | # ifdef __KERNEL_OPTIX__ | ||||
| *num_hits = 0; // Initialize hit count to zero | *num_hits = 0; // Initialize hit count to zero | ||||
| optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | ||||
| ray->P, | ray->P, | ||||
| ray->D, | ray->D, | ||||
| 0.0f, | 0.0f, | ||||
| ray->t, | ray->t, | ||||
| ray->time, | ray->time, | ||||
| 0xF, | |||||
| // Need to always call into __anyhit__kernel_optix_shadow_all_hit | // Need to always call into __anyhit__kernel_optix_shadow_all_hit | ||||
| 0xFF, | |||||
| OPTIX_RAY_FLAG_ENFORCE_ANYHIT, | OPTIX_RAY_FLAG_ENFORCE_ANYHIT, | ||||
| 2, | 1, // SBT offset for PG_HITS | ||||
| 0, | |||||
| 0, | 0, | ||||
| 0, // SBT offset for PG_HITS | |||||
| p0, | p0, | ||||
| p1, | p1, | ||||
| *num_hits, | *num_hits, | ||||
| p3, | p3, | ||||
| p4, | p4, | ||||
| p5); | p5); | ||||
| return p5; | return p5; | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | # ifdef __KERNEL_OPTIX__ | ||||
| uint p5 = PRIMITIVE_NONE; | uint p5 = PRIMITIVE_NONE; | ||||
| optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0, | ||||
| ray->P, | ray->P, | ||||
| ray->D, | ray->D, | ||||
| 0.0f, | 0.0f, | ||||
| ray->t, | ray->t, | ||||
| ray->time, | ray->time, | ||||
| // Visibility mask set to only intersect objects with volumes | // Skip everything but volumes | ||||
| 0x02, | 0x2, | ||||
| OPTIX_RAY_FLAG_NONE, | OPTIX_RAY_FLAG_NONE, | ||||
| 0, // SBT offset for PG_HITD | |||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, // SBT offset for PG_HITD | |||||
| p0, | p0, | ||||
| p1, | p1, | ||||
| p2, | p2, | ||||
| p3, | p3, | ||||
| p4, | p4, | ||||
| p5); | p5); | ||||
| isect->t = __uint_as_float(p0); | isect->t = __uint_as_float(p0); | ||||
| ▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines | |||||