Beginner with simple geometry program problems

[ACCEL] Invalid value (0) for “buildInputs[0].triangleArray.flags”

That’s because you have not set that flags pointer inside your code.
It must be a pointer to an array of OptixGeometryFlags, one per SBT record.
Something like this:

[PIPELINE] params variable “params” not found in any module. It might have been optimized away.

You told OptiX that the name of your launch parameter block in constant memory is named params with this field inside the OptixPipelineCompile options:
pipelineCompileOptions.pipelineLaunchParamsVariableName = "params";

Then you need to have a declaration for that params variable with your launch parameter structure.
Something like this, just with your structure and variable names:

Please do not set some fixed values for the stack sizes. Do the proper calculation to use the minimal necessary amount.
The OptiX SDK contains helper functions for that inside the optix_stack_size.h header.
I rolled my own before that header existed:

You set pipelineCompileOptions.traversableGraphFlags = OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_LEVEL_INSTANCING; which is good because that is the fastest render graph layout on RTX boards, but you’re only calling optixAccelBuild once and build a geometry AS only. There needs to be some optixAccelBuild over OptixInstances for the top-level instance AS as well and the traversable handle of that should be your argument to optixTrace calls.
There was a recent discussion about that here:

If you look into the examples inside that github repository, there are some simpler cases where some runtime generated geometries are built (plane, box, sphere, torus). I just added another example to that today.

1 Like