Skip to content

Add Customizable Analytical Spatial Fields Support#212

Open
favreau wants to merge 11 commits intoNVIDIA:next_releasefrom
favreau:feature/analytical_fields
Open

Add Customizable Analytical Spatial Fields Support#212
favreau wants to merge 11 commits intoNVIDIA:next_releasefrom
favreau:feature/analytical_fields

Conversation

@favreau
Copy link
Collaborator

@favreau favreau commented Feb 3, 2026

This PR introduces support for analytical (procedural) spatial fields in VisRTX, enabling GPU-computed volumetric fields that generate values on-the-fly rather than storing pre-computed data.

Architecture:

  • AnalyticalField (abstract base)
  • AnalyticalFieldSampler (PTX wrapper)
  • SpatialFieldRegistry (device registry)
  • Custom Field Implementations (via preprocessor hooks)

Device-Side changes (VisRTX):

  • Add analytical field infrastructure in devices/rtx/device/spatial_field/
  • Update renderers to support analytical field sampling
  • Extend GPU data structures for analytical field parameters
  • Add texture coordinate and bounds accessors

Resolves target name conflicts between VisRTX's stb_image (STATIC library)
and Barney/OWL's stb_image (INTERFACE library) when building projects that
depend on both.

Changes:
- Add guard to skip stb_image subdirectory if target already exists
- Create visrtx_stb_image as alternative target when stb_image exists
- Update tsd_tinygltf to handle both stb_image variants
- Add proper include directories for OWL's stb/ subdirectory layout

This allows VolumetricPlanets and other projects to build successfully
when including both Barney and VisRTX/TSD in the same CMake project.
Extends TSD UpdateDelegate architecture to support animation time change
notifications, enabling applications to respond when scene.setAnimationTime()
is called.

Changes:
- Add signalAnimationTimeChanged(float time) to BaseUpdateDelegate interface
- Implement signal propagation in MultiUpdateDelegate
- Call signal from Scene::setAnimationTime() to notify all delegates
- Add no-op implementation in RenderIndex
- Update CameraPoses offline rendering to set animation time

This enables applications to register custom delegates that respond to
animation time changes, useful for updating time-dependent spatial fields
during both interactive playback and offline rendering.

Architecture benefits:
- Clean observer pattern: TSD core decoupled from application code
- Extensible: Multiple animation time observers can be registered
- Works across all rendering modes: interactive, offline, camera paths
- Add textureObject() and imageSize() accessors to Image2D and Image3D
  for analytical field texture sampling
- Add lat/lon bounds (minLat, maxLat, minLon, maxLon) to CloudFieldData
  for geographic region filtering
- Add VISRTX_ANALYTICAL_FIELD_DATA_HEADER for external field data definitions
- Add VISRTX_ANALYTICAL_SAMPLERS_HEADER for external sampler implementations
- Add VISRTX_ANALYTICAL_SAMPLE_DISPATCH macro for dispatch logic
- Fix 8-byte alignment for fieldData array to support cudaTextureObject_t
- Remove AnalyticalFieldData.h (moved to consuming project)
- Add AnalyticalData to VolumeSamplingState union for sampler access

This allows external projects (like VolumetricPlanets) to provide
custom analytical field implementations without modifying VisRTX core.
Remove synchronous rendering and animation time changes to keep CameraPoses
aligned with base branch.
The previous fix attempted to handle different stb_image variants but
introduced a CI failure. Simplify to just use the stb_image target
and its INTERFACE_INCLUDE_DIRECTORIES property directly.

This ensures stb_image.h is found regardless of which stb_image
implementation is being used (TSD's own or from an external source).
The stb_image conflict fixes should be in devices/rtx/external only,
not in TSD's tsd_tinygltf. TSD builds its own stb_image and the
link dependency is sufficient to propagate include directories.

This fixes the CI failure where stb_image.h couldn't be found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant