Skip to content

Commit

Permalink
Merge branch 'next_release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffamstutz committed Aug 12, 2023
2 parents 06aa69c + 6c2efab commit 7e64fd1
Show file tree
Hide file tree
Showing 299 changed files with 47,482 additions and 8,055 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ cmake-build-*
docs/gen/*
docs/out/*
.match3D
.anari_deps
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.6.0
##### TBD
- Added new GL based device implementation
- Added support for image backgrounds via the `background` renderer parameter
- Improved `sphere` geometry update speed for large numbers of primitives
- Improved handling of renderers of an unknown subtype
- Fix incorrect type for `scivis` volume `"valueRange"` parameter
- Fix numeric issue in edge case when generating cone geometry
- Fix support for non-float element types in `structuredRegular` spatial fields

## 0.5.0
##### 2023-01-23
- Update to latest ANARI SDK v0.3.0
Expand Down
52 changes: 29 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -35,9 +35,6 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

set(CMAKE_BUILD_TYPE_INIT "Release")

set(CMAKE_INSTALL_RPATH "$ORIGIN")
Expand All @@ -49,7 +46,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

project(VisRTX VERSION 0.5.0 LANGUAGES C CXX CUDA)
project(VisRTX VERSION 0.6.0 LANGUAGES C CXX)

include(GNUInstallDirs)

Expand All @@ -60,12 +57,29 @@ option(
)
mark_as_advanced(VISRTX_SET_SOVERSION)

if (VISRTX_SET_SOVERSION)
set(VISRTX_CMAKE_INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
)
else()
set(VISRTX_CMAKE_INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
endif()

## Dependencies ###############################################################

# ANARI-SDK
set(ANARI_REQUIRED_VERSION 0.3.0)
set(ANARI_REQUIRED_VERSION 0.7.0)
find_package(anari ${ANARI_REQUIRED_VERSION} EXACT REQUIRED)

# CUDA
find_package(CUDAToolkit 11.3.1)
find_package(OptiX7)

# OpenGL
find_package(OpenGL)

# glm (locally included)
set(glm_DIR ${CMAKE_CURRENT_LIST_DIR}/external/glm/lib/cmake/glm)
find_package(glm REQUIRED)
Expand All @@ -83,28 +97,12 @@ add_subdirectory(external)

enable_testing()

add_subdirectory(device)
add_subdirectory(devices)
add_subdirectory(examples)
add_subdirectory(tests)
add_subdirectory(tools)

## Configure CMake find_package() config files ################################

if (VISRTX_SET_SOVERSION)
set(VISRTX_CMAKE_INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
)
else()
set(VISRTX_CMAKE_INSTALL_DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
endif()

install(EXPORT VisRTX_Exports
DESTINATION ${VISRTX_CMAKE_INSTALL_DESTINATION}
NAMESPACE VisRTX::
)

include(CMakePackageConfigHelpers)

configure_package_config_file(
Expand Down Expand Up @@ -133,3 +131,11 @@ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/cmake
FILES_MATCHING
PATTERN *.cmake
)

option(VISRTX_PRECOMPILE_SHADERS "Run visrtxCompileShaders after install?" ON)
if (TARGET visrtxCompileShaders AND VISRTX_PRECOMPILE_SHADERS)
install(
CODE
"execute_process(COMMAND ${CMAKE_BINARY_DIR}/visrtxCompileShaders)"
)
endif()
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without
Expand Down
137 changes: 12 additions & 125 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Building VisRTX requires the following:
- NVIDIA Driver 495+
- CUDA 11.3.1+
- [OptiX 7.4+](https://developer.nvidia.com/rtx/ray-tracing/optix)
- [ANARI-SDK 0.3.0](https://github.com/KhronosGroup/ANARI-SDK)
- [ANARI-SDK 0.7.0](https://github.com/KhronosGroup/ANARI-SDK)

Building VisRTX is done through invoking CMake on the source directory from a
stand alone build directory. This might look like
Expand Down Expand Up @@ -71,43 +71,13 @@ dependency.
# Feature Overview

The following sections describes details of VisRTX's ANARI completeness,
provided extensions, and known missing features to add in the future.
provided extensions, and known missing extensions to add in the future.

## Queryable ANARI Extensions

The following extension strings will return true when queried with
`anariDeviceImplements()`. Note that all vendor extensions are subject to change
at any time.

#### "ANARI_KHR_STOCHASTIC_RENDERING"

This core extension indicates that frames will accumulate samples when
subsequent calls to `anariRenderFrame()` are made if no objects modifications
are made since the previously rendered frame. Accumulation will not reset on
`anariSetParameter()`, but only if objects that have parameter changes have been
commited via `anariCommit()`.

Note that variance estimation and convergence progress properties are not yet
implemented.

#### "VISRTX_SAMPLER_COLOR_MAP"

This vendor extension indicates that an additional sampler subtype is available:
`"colorMap"`. This sampler takes the first channel of the input attribute and
applies a transfer function (normalization + color) to it. This sampler has the
following parameters in addition to the base ANARI sampler parameters:

| Name | Type | Default | Description |
|:---------------|:-------------------|--------:|:------------------------------------------------------------------------|
| color | ARRAY1D of Color | | array to map sampled and clamped field values to color |
| color.position | ARRAY1D of FLOAT32 | | optional array to position the elements of color values in `valueRange` |
| valueRange | FLOAT32_BOX1 | \[0,1\]| input attribute values are clamped to this range |

This sampler follows the same rules for the `color` and `color.position`
parameters as they are found on the `"scivis"` volume subtype. Values from this
sampler are output as `VEC3(r, g, b, 1)` to the input of the material where the
sampler used, where `r`, `g`, and `b` come from the values in `color`
respectively.
In addition to standard `ANARI_KHR` extensions, the following vendor extensions
are also implemented in the `visrtx` device. Note that all vendor extensions are
subject to change

#### "VISRTX_CUDA_OUTPUT_BUFFERS"

Expand All @@ -122,24 +92,6 @@ GPU pointers returned by `anariMapFrame()` are device pointers intended to be
kept on the device. Applications which desire to copy data from the device back
to the host should instead map the ordinary `color` and `depth` channels.

#### "VISRTX_ARRAY1D_DYNAMIC_REGION"

This vendor extension permits applications to use a subset of `ANARIArray1D`
elements via parameters. This is helpful for applications to more quickly resize
an array without needing to reallocate the array by making a new array object.
The following parameters are consumed by 1D arrays:

| Name | Type | Default | Description |
|:------|:---------|-----------:|:----------------------------------------------------|
| begin | UINT64 | 0 | first index (inclusive) to be used by parent objects |
| end | UINT64 | *capacity | last index (exclusive) to be used by parent objects |

When an array is constructed, it's initial size is the maximum capacity allowed
by that array object. The `begin` and `end` parameters establish a contiguous
subset of the array, which is interpreted as the elements to be used by parent
objects referencing the array. Note that mapping the array will always return
the first element of the array (element `0`), which may be below `begin`.

#### "VISRTX_TRIANGLE_ATTRIBUTE_INDEXING" (experimental)

This vendor extension indicates that additional attribute indexing is
Expand Down Expand Up @@ -176,19 +128,6 @@ device.

#### Frame

The following optional parameters are available to set on `ANARIFrame`:

| Name | Type | Default | Description |
|:-------------|:-----|--------:|:-------------------------------------------------|
| denoise | BOOL | false | enable the OptiX denoiser on the `color` channel |
| checkerboard | BOOL | false | trade fewer samples per-frame for interactivity |

The `checkerboard` parameter will sample subsets of the image at a faster rate,
while still converging to the same image, as the final set of samples taken for
each pixel ends up being the same. The pattern and method of which this feature
is implementented is subject to change, so applications which desire exact
sample counts should use the `numSamples` property described below.

The following properties are available to query on `ANARIFrame`:

| Name | Type | Description |
Expand All @@ -197,78 +136,26 @@ The following properties are available to query on `ANARIFrame`:
| nextFrameReset | BOOL | query whether the next frame will reset accumulation |

The `numSamples` property is the lower bound of pixel samples taken when the
`checkerboard` parameter is enabled because not every pixel will have the same
number of samples accumulated.
`checkerboard` renderer parameter (see below) is enabled because not every pixel
will have the same number of samples accumulated.

The `nextFrameReset` property can give the application feedback for when
accumulation is about to reset in the next frame. When the property is queried
and the current frame is complete, all committed objects since the last
rendering operation will be internally updated (may be expensive).

#### Renderer

The ANARI specification does not have any required renderer subtypes devices
must provite, other than the existence of a `default` subtype. VisRTX provides
the following subtypes:

- `scivis` (default)
- `ao`
- `raycast`
- `debug`

All renderers share the following parameters:

| Name | Type | Default | Description |
|:----------------|:-------------|----------:|:----------------------------------------------------------|
| backgroundColor | FLOAT32_VEC4 | {1,1,1,1} | color of the background |
| pixelSamples | INT32 | 1 | number of samples taken per call to `anariRenderFrame()` |

The `pixelSamples` parameter is equivalent to calling `anariRenderFrame()` N
times to reduce noise in the image.

The `debug` renderer is designed to help developers understand how VisRTX is
interpreting the scene it is rendering. This renderer uses a `STRING` parameter
named `"method"` to control which debugging views of the scene is used. The
following values are valid values:

| Method | Description |
|:---------|:-----------------------------------------------------------|
| primID | visualize geometry primitive index |
| geomID | visualize geometry index within a group |
| instID | visualize instance index within the world |
| Ng | visualize geometric normal |
| uvw | visualize geometry barycentric coordinates |
| istri | show objects as green if they are HW accelerated triangles |
| isvol | show objects as green if they are a volume |
| backface | show front facing primitives as green, red if back facing |

The `debug` renderer can use a `_[method]` suffix on the subtype string to set
the default method. This can be a convenient alternative for applications to
switch between debug renderer views. For example, `"debug_Ng"` would initially
use the `Ng` method. The debug renderer with method suffixes are listed out as
complete subtypes by `anariGetObjectSubtypes()`.

Note that VisRTX renderers and their parameters are very much still in flux, so
applications should use ANARI object introspection query functions to get the
latest available parameters they can use. When the list of renderers and their
parameters stabilize over time, they will be documented here. VisRTX will always
keep the `default` renderer subtype as something usable without needing to
change parameters.

## Known Missing Core ANARI Features + Extensions
## Known Missing Core ANARI Extensions + Features

The following features are not yet implemented by VisRTX:
The following extensions are not yet implemented by VisRTX:

- Light: `spot`, instancing
- Camera: `omnidirectional`, stereo rendering, direct transform parameter
- Sampler: `image3D`, in/out transforms on `image2D`
- Camera: `omnidirectional`, stereo rendering
- Sampler: `image3D`
- Frame: variance property
- Sparse shared arrays (non-zero stride)
- Core extensions:
- `ANARI_KHR_AREA_LIGHTS`
- `ANARI_KHR_FRAME_COMPLETION_CALLBACK`
- `ANARI_KHR_DEVICE_SYNCHRONIZATION`
- `ANARI_KHR_TRANSFORMATION_MOTION_BLUR`

For any found bugs in features that are implemented, please [open an
For any found bugs in extensions that are implemented, please [open an
issue](https://github.com/NVIDIA/VisRTX/issues/new)!
20 changes: 20 additions & 0 deletions ci/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
stages:
- build

variables:
GIT_DEPTH: "15"

build-ubuntu-22_04:
stage: build
script:
- ci/build_linux.sh
tags:
- linux
- ubuntu

build-windows:
stage: build
script:
- ci/build_win.ps1
tags:
- windows
11 changes: 11 additions & 0 deletions ci/build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

mkdir build
cd build

cmake \
-DVISRTX_PRECOMPILE_SHADERS=OFF \
-DCMAKE_CUDA_HOST_COMPILER=$CXX \
..

cmake --build . -j `nproc`
7 changes: 7 additions & 0 deletions ci/build_win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
md build
cd build

cmake -DVISRTX_PRECOMPILE_SHADERS=OFF -DVISRTX_BUILD_GL_DEVICE=OFF ..
cmake --build . -j --config Release --target ALL_BUILD

exit $LASTEXITCODE
2 changes: 1 addition & 1 deletion cmake/EmbedPTX.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmake/EmbedPTXRun.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindOptiX7.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindVisRTX.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion cmake/VisRTXConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit 7e64fd1

Please sign in to comment.