我正在研究的OptixTriangle
例子OptiX 7.3
。但是,参数的含义optixTrace
并不清楚:
optixTrace(
params.handle,
ray_origin,
ray_direction,
0.0f, // --- Min intersection distance (tmin)
1e16f, // --- Max intersection distance (tmax)
0.0f, // --- rayTime -- used for motion blur
OptixVisibilityMask( 255 ), // --- Specify always visible
OPTIX_RAY_FLAG_NONE, // --- OPTIX_RAY_FLAG_DISABLE_ANYHIT
0, // --- SBT offset -- See SBT discussion
1, // --- SBT stride -- See SBT discussion
0, // --- missSBTIndex -- See SBT discussion
p0, p1, p2 );
float3 result;
result.x = int_as_float( p0 );
result.y = int_as_float( p1 );
result.z = int_as_float( p2 );
// Record results in our output raster
params.image[idx.y * params.image_width + idx.x] = make_color( result );
尤其是:
- 参数
p0
和代表什么p1
?p2
- 如何计算命中点的表面法线,以便我可以使用该信息为三角形着色?