intersect_analytic.cu : General Analytic CSG intersection

intersect_analytic.cu provides intersection of rays with arbitrarily complex solids represented using a constructive solid geometry model. The model uses a complete binary tree, with primitives at the leaves and boolean operations (intersection, union, difference) at the other nodes.

The C++ code that creates the OptiX program is OGeo::makeAnalyticGeometry see:

The principal of the approach is described in a note by Andrew Kensler “Ray Tracing CSG Objects Using Single Hit Intersections”, available from the below link together with a discussion of the technique as used in the XRT raytracer.

intersect_analytic.cu : buffers

primBuffer
offsets into part,tran,plan buffers
partBuffer
nodes of the CSG tree (both operators and primitives) (4 quads)
tranBuffer
transforms
planBuffer
planes
identityBuffer

volume identity uint4 from instance_index and primIdx:

uint4 identity = identityBuffer[instance_index*primitive_count+primIdx] ;

Q: with OptiX7 does all this have to go into SBT ?

intersect_analytic.cu : intersect

Intersection of the primIdx prim using evaluative_csg.

The CSG_FLAGNODETREE approach is the default. The former CSG_FLAGPARTLIST approach is not general and requires semi-manual partitioning of CSG solids at constituent intersection planes. This approach may be faster for suitable shapes but lack of generality makes it difficult to use.

Q: what is the OptiX7 equivalent for primIdx
telling or a multi OptixBuildInput GAS which aabb was intersected and hence whic h primitive intersect function to use ?
A: optix7-pdf p18 : Each build input maps to one or more consecutive SBT records
that control program dispatch. See “Shader binding table” (page 41) for more information.