AABB for mesh of custom primitives - example(s)?

Good morning,

I know that when creating a custom primitive one needs to define an intersection shader and an AABB. Are there any examples with OptiX 7.0 with a mesh of custom primitives with the corresponding AABB’s ?

Thanks in advance for any assist.

Hey, yes there are a few examples of custom primitives. I don’t know about a ‘mesh’ of them, but the examples with a sphere in them are a good place to start, such as the optixWhitted example.

Here’s how I find all of them:

> cd NVIDIA-OptiX-SDK-7.3.0-linux64-x86_64/SDK
> grep -sirl __intersection
optixWhitted/geometry.cu
optixWhitted/optixWhitted.cpp
optixCutouts/optixCutouts.cpp
optixVolumeViewer/volume.cu
optixVolumeViewer/optixVolumeViewer.cpp
optixDemandTexture/optixDemandTexture.cu
optixDemandTexture/optixDemandTexture.cpp
cuda/sphere.cu
optixCallablePrograms/optixCallablePrograms.cpp
optixDynamicMaterials/optixDynamicMaterials.cu
optixDynamicMaterials/optixDynamicMaterials.cpp
optixSimpleMotionBlur/optixSimpleMotionBlur.cu
optixSimpleMotionBlur/optixSimpleMotionBlur.cpp
optixSphere/optixSphere.cpp


David.

Thank you for the information and response @dhart

A follow-up, if that is okay. Can you tell me where a good beginner example is that employs an input mesh to render (custom or built-in triangles) ? such as the teapot example you find on many OpenGL tutorials.

Many thanks.

The optixPathTracer SDK sample is the simplest mesh input example that has multiple triangles. It uses built-in triangles. The entire (very simple) scene is hard-coded in the sample’s optixPathTracer.cpp file: look for g_vertices and g_mat_indices.


David.

Cool. Thanks @dhart

1 Like