How shader-slang/optix-examples works
This repository is a set of progressive OptiX 7 ray-tracing examples using Slang for shading. The learning path moves from a minimal OptiX program through ray generation, window display, mesh and shader-binding-table data, multiple objects, imported models, textures, and shadow rays. In the windowed examples, the application calls the renderer and displays its downloaded pixels; model loading is a separate stage in the later examples. Sampled source and the SOURCE INDEX support these links, but do not expose every renderer-to-OptiX call, so those runtime details are omitted.
Main entry points: GLFWindow.cpp Camera window · example02_pipelineAndRayGen/SampleRenderer.cpp Ray generation · example07_firstRealModel/SampleRenderer.cpp Imported model · example08_addingTextures/SampleRenderer.cpp Textured model
Components 15
Examples 01–03
- OptiX starter
example01_helloOptix/main.cpp - Ray generation
example02_pipelineAndRayGen/SampleRenderer.cpp - Windowed output
example03_inGLFWindow/SampleRenderer.cpp
Geometry and SBT
- Triangle mesh
example04_firstTriangleMesh/SampleRenderer.cpp - SBT data
example05_firstSBTData/SampleRenderer.cpp - Multiple objects
example06_multipleObjects/SampleRenderer.cpp
Models and materials
- Imported model
example07_firstRealModel/SampleRenderer.cpp - Textured model
example08_addingTextures/SampleRenderer.cpp - Shadow rays
example09_shadowRays/SampleRenderer.cpp
Rendering support
- Camera window
common/glfWindow/GLFWindow.cpp - OBJ and textures
example08_addingTextures/Model.cpp - Image output
common/3rdParty/stb_image_write.h - CUDA buffers
example02_pipelineAndRayGen/CUDABuffer.h - Launch parameters
example02_pipelineAndRayGen/LaunchParams.h
Other components
- Example user
Connections 28
- Example user → OptiX starter: runs
- Example user → Ray generation: runs
- Example user → Windowed output: runs
- Example user → Triangle mesh: runs
- Example user → SBT data: runs
- Example user → Multiple objects: runs
- Example user → Imported model: runs
- Example user → Textured model: runs
- Example user → Shadow rays: runs
- Ray generation → Image output: writes pixels
- Windowed output → Camera window: uses window
- Triangle mesh → Camera window: uses window
- SBT data → Camera window: uses window
- Multiple objects → Camera window: uses window
- Imported model → Camera window: uses window
- Textured model → Camera window: uses window
- Shadow rays → Camera window: uses window
- Imported model → OBJ and textures: loads model
- Textured model → OBJ and textures: loads model
- Shadow rays → OBJ and textures: loads model
- Ray generation → CUDA buffers: uses buffers
- Ray generation → Launch parameters: uses parameters
- Triangle mesh → Ray generation: extends renderer
- SBT data → Triangle mesh: extends renderer
- Multiple objects → SBT data: extends renderer
- Imported model → Multiple objects: extends renderer
- Textured model → Imported model: extends renderer
- Shadow rays → Textured model: extends renderer