Examples#

The source distribution includes 11 short lessons under examples/. Each one adds one concept to the ones before it and builds its scene from Universal Scene Description (USD) written in the program. It checks its results and renders the scene with the ovRTX renderer, so you can see what the queries found. Lessons 01 to 10 each come as a Python program and a C++ program that calls the C API directly. Lesson 11 pairs a C++ producer with a Python presenter.

Note

Before you run a lesson, check that you have an NVIDIA GPU for rendering and these packages:

Package

Supported Versions

ovstage

0.4

ovRTX

0.7

NVIDIA Warp (warp-lang)

1.18

ovRTX 0.7 works only with ovstage 0.4, so the lessons need ovstage 0.4 even though the library also supports 0.3. Lessons 08 to 10 run their plan or pair reporter on the GPU, and on the CPU when the library cannot run it there. The other queries run on the CPU. The examples/README.md file in the source distribution describes how to build the library and set up the lesson packages.

Run a lesson from the source root with this command:

./dev.sh example 01

On Windows, use dev.cmd example 01. Add --headless to render a few frames to files instead of opening a window. For lessons 01 to 10, add --language native to run the C++ program, or --language both to run both programs. Lesson 11 runs only with the default --language python.

Each card names a lesson and the concept it adds:

A ray from a small marker stops on the near face of a green cube. A blue cube stands farther away on a dark floor.
01 · Raycast

static_candidate_raycast: one synchronous raycast against an ovstage population, closest bounds candidate.

A yellow sphere swept along a line stops where it first touches a green cube. A blue cube stands farther away.
02 · Sphere Sweep

sphere_sweep: a moving sphere and the first object it would touch.

A yellow query sphere touches the side of a green cube. A blue cube stands apart on the floor.
03 · Overlap

shape_overlap: whether a sphere you describe touches anything.

One ray passes a red cube that the view skips and stops on a green cube behind it.
04 · View

filtered_view: the same ray against a population and a view that skips the nearer object.

A wide green box, an orange cube, and a blue cube on a floor.
05 · Pair Snapshot

two_set_pair_snapshot: the bounding-box pairs between two populations and both ordinals.

A ray stops on a green triangle and marks the hit point in orange. A second triangle stands behind it.
06 · Exact Triangle Hit

precise_triangle: an exact ray hit on a mesh, with the authored face and barycentrics.

A ray stops on a large teal cube. A small orange sphere floats to its left.
07 · New Version

time_sampled_update: publish a new USD time sample as a new ordinal.

Two parallel rays: one stops on a near teal cube, and the other passes it and stops on a farther cube.
08 · Batch Plan

reusable_cpu_batch: one raycast plan, on the GPU when there is one, two launches, result columns.

An orange sphere on a ray that ends short of a blue cube.
09 · Pinned Version

immutable_version_overlap: a batch in flight keeps reading the version it was admitted on while the next one is published.

A blue box with a green band where another box overlaps it, and a separate purple cube.
10 · Pair Reporter

pair_reporter_deltas: a reporter’s baseline, then the pair that exits.

Three panels of the lesson 11 showcase: ovstage participation bits that let one ray hit a sphere and block another, three explicit objects with a convex, and a CUDA panel marked not available.
11 · Capability Showcase

capability_showcase: ovstage participation bits, an explicit population, and batch plans on a CUDA device, side by side. The device plans run only with --require-cuda on a CUDA host. By default, the CUDA panel is marked not available.