I'm studying the OptixTriangle
example of OptiX 7.3
. However, the meaning of the parameters of optixTrace
are not clear:
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 );
In particular:
- What do the parameters
p0
,p1
andp2
stand for? - How is it possible to compute the surface normal at the hit point so that I could colour the triangle with that information?