Using the following approach, it should be possible to report entirely double precision results from custom written __intersection__()
OptiX programs. Basically, pack those doubles into ints and pass them out through the optixReportIntersection() method, as in this simple example. Sure, there will be a performance hit compared to single precision, but then those of us involved in applications requiring double precision have already crossed that bridge willingly.
union DblAsInt2 {
double a;
int2 b;
};
extern "C" __global__ void __intersection__blort()
{
double u, v, hitT;
//...code to calculate some intersection in double precision
DblAsInt2 uConverted {uv.x};
DblAsInt2 vConverted {uv.y};
optixReportIntersection(hitT, 1,
uConverted._int2.x, uConverted._int2.y,
vConverted._int2.x, vConverted._int2.y);
}
This can get things really close to true double precision ray tracing, the only slight issue being that the optixGetWorldRayOrigin()
and optixGetWorldRayDirection()
available to an __intersection__
routine are only single precision.
So my question is, would the developers consider supporting some new optixTrace()
method/interface that has the ability to provide double3 ray origin and direction values? Things like triangular facet ray tracing, BVH traversal, curves, transformations, etc can remain in single precision. I would just like a way for an __intersection__
program to acquire double precision ray info so that it can generate double precision results.
Thanks.