Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# The renderer core without Houdini (NOVA_CORE_ONLY, cmake/NovaStandalone.cmake):
# nova_core and its Catch2 unit tests on Linux, built with GCC against system
# libraries. The Hydra delegate, the Houdini package, nova_cli and the GPU
# backend need Houdini on Windows and are not built here.
name: core

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: core-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
name: Linux, GCC (${{ matrix.preset }})
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
preset: [core, core-sanitize]
steps:
- uses: actions/checkout@v4
- name: Install Embree, oneTBB, OpenSubdiv and Catch2
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ninja-build libembree-dev libtbb-dev libosd-dev catch2
# The NanoVDB 32.6 headers are fetched by the configure step.
- name: Configure
run: cmake --preset ${{ matrix.preset }}
- name: Build
run: cmake --build --preset ${{ matrix.preset }}
- name: Test
run: ctest --preset ${{ matrix.preset }}
56 changes: 46 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
cmake_minimum_required(VERSION 3.26)

# NOVA_CORE_ONLY builds the renderer without Houdini: nova_core, its unit tests
# (nova_tests) and nova_bsdf_precompute, against system libraries (Embree 4,
# oneTBB, OpenSubdiv, NanoVDB, Catch2; see cmake/NovaStandalone.cmake). The
# Hydra delegate, the Houdini package, nova_cli and the GPU backend need
# Houdini and Windows; they are the full build. It is the default away from
# Windows, where the full build does not exist.
if(CMAKE_HOST_WIN32)
set(_nova_core_only_default OFF)
else()
set(_nova_core_only_default ON)
endif()
option(NOVA_CORE_ONLY "Build only nova_core, its unit tests and nova_bsdf_precompute, without Houdini" ${_nova_core_only_default})

# vcpkg provides Embree 4 and Catch2 (see vcpkg.json). Static libraries with
# the dynamic CRT keep extra DLLs out of the Houdini process.
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT NOVA_CORE_ONLY)
# Prefer a regular vcpkg clone. Visual Studio developer prompts point
# VCPKG_ROOT at VS's bundled, read-only vcpkg (it has vcpkg-bundle.json),
# which resolves packages differently.
Expand All @@ -18,16 +31,23 @@ if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "${_nova_vcpkg_root}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "vcpkg toolchain")
endif()
endif()
set(VCPKG_TARGET_TRIPLET "x64-windows-static-md" CACHE STRING "vcpkg triplet")
if(NOT NOVA_CORE_ONLY)
set(VCPKG_TARGET_TRIPLET "x64-windows-static-md" CACHE STRING "vcpkg triplet")
endif()

# Houdini only ships release libraries, so Debug builds are not supported.
# Houdini only ships release libraries, so Debug builds are not supported
# (a core-only build has no such limit).
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE)
endif()
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo" CACHE STRING "Build configurations" FORCE)
if(NOT NOVA_CORE_ONLY)
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo" CACHE STRING "Build configurations" FORCE)
endif()

project(Nova VERSION 0.1.0 LANGUAGES CXX)
message(STATUS "Nova: vcpkg toolchain ${CMAKE_TOOLCHAIN_FILE}")
if(NOT NOVA_CORE_ONLY)
message(STATUS "Nova: vcpkg toolchain ${CMAKE_TOOLCHAIN_FILE}")
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -36,11 +56,25 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(NovaHoudini)
include(NovaOptiX)
if(NOVA_CORE_ONLY)
include(NovaStandalone)
set(NOVA_HAS_OPTIX OFF) # the GPU backend and the OptiX denoiser load NVIDIA's Windows DLLs
else()
include(NovaHoudini)
include(NovaOptiX)
endif()
find_package(embree 4 CONFIG REQUIRED)
if(NOVA_CORE_ONLY)
# A system Embree: the features vcpkg.json asks for, as far as Embree's
# package config reports them (not the instance geometry).
foreach(_nova_embree_feature RAY_MASK FILTER_FUNCTION RAY_PACKETS GEOMETRY_TRIANGLE GEOMETRY_QUAD GEOMETRY_CURVE
GEOMETRY_POINT GEOMETRY_USER)
if(NOT EMBREE_${_nova_embree_feature})
message(FATAL_ERROR "Nova needs an Embree built with EMBREE_${_nova_embree_feature}=ON (${embree_DIR}).")
endif()
endforeach()
# A second TBB or an Embree DLL inside the Houdini process must not happen.
if(NOT EMBREE_STATIC_LIB OR NOT EMBREE_TASKING_SYSTEM STREQUAL "INTERNAL" OR NOT EMBREE_RAY_MASK)
elseif(NOT EMBREE_STATIC_LIB OR NOT EMBREE_TASKING_SYSTEM STREQUAL "INTERNAL" OR NOT EMBREE_RAY_MASK)
message(FATAL_ERROR "Nova needs a static Embree with INTERNAL tasking and ray masks (got static=${EMBREE_STATIC_LIB}, "
"tasking=${EMBREE_TASKING_SYSTEM}, ray_mask=${EMBREE_RAY_MASK}). Check vcpkg.json and the triplet.")
endif()
Expand All @@ -49,8 +83,10 @@ set(NOVA_INSTALL_DIR "${CMAKE_SOURCE_DIR}/dist" CACHE PATH "Houdini package outp
option(NOVA_BUILD_TESTS "Build unit tests" ON)

add_subdirectory(core)
add_subdirectory(hydra)
add_subdirectory(houdini)
if(NOT NOVA_CORE_ONLY)
add_subdirectory(hydra)
add_subdirectory(houdini)
endif()
add_subdirectory(tools)

if(NOVA_BUILD_TESTS)
Expand Down
30 changes: 29 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,30 @@
"inherits": "base",
"generator": "Ninja",
"cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" }
},
{
"name": "core",
"displayName": "Core only, without Houdini (Ninja, Release; system libraries)",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": { "NOVA_CORE_ONLY": "ON", "CMAKE_BUILD_TYPE": "Release" }
},
{
"name": "core-sanitize",
"displayName": "Core only with AddressSanitizer and UBSan, float casts included (GCC or Clang)",
"inherits": "core",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-fsanitize=address,undefined,float-cast-overflow -fno-sanitize-recover=all -fno-omit-frame-pointer"
}
}
],
"buildPresets": [
{ "name": "release", "configurePreset": "vs2022", "configuration": "Release" },
{ "name": "relwithdebinfo", "configurePreset": "vs2022", "configuration": "RelWithDebInfo" },
{ "name": "ninja", "configurePreset": "ninja" }
{ "name": "ninja", "configurePreset": "ninja" },
{ "name": "core", "configurePreset": "core" },
{ "name": "core-sanitize", "configurePreset": "core-sanitize" }
],
"testPresets": [
{
Expand All @@ -42,6 +60,16 @@
"name": "ninja",
"configurePreset": "ninja",
"output": { "outputOnFailure": true }
},
{
"name": "core",
"configurePreset": "core",
"output": { "outputOnFailure": true }
},
{
"name": "core-sanitize",
"configurePreset": "core-sanitize",
"output": { "outputOnFailure": true }
}
]
}
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ Nova was built milestone by milestone. The plan's milestones M0 to M10 ([`docs/P
Karma-compatibility milestone M11 ([`docs/design/M11.md`](docs/design/M11.md)) are complete, with a design note per
milestone in [`docs/design/`](docs/design/). About 690 automated tests cover it: unit
tests, husk and command-line renders, statistical comparisons against Karma references, and isolated Houdini
sessions. Known differences from Karma and remaining limitations are documented in the design notes and in
[`docs/bug-audit-2026-11.md`](docs/bug-audit-2026-11.md).
sessions. The current limitations are listed in [`docs/limitations.md`](docs/limitations.md); known differences
from Karma are documented in the design notes and in [`docs/bug-audit-2026-11.md`](docs/bug-audit-2026-11.md).

The renderer core (`nova_core`) and its unit tests also build on Linux without Houdini
([Core only, without Houdini](#core-only-without-houdini)); the Hydra delegate and Nova XPU do not yet.

Requirements at run time:

Expand Down Expand Up @@ -133,7 +136,32 @@ MSVC toolchain.

See [`tools/installer/README.md`](tools/installer/README.md).

**Tests.** The husk, reference and Houdini tests run Houdini in an isolated environment with an empty preference
### Core only, without Houdini

`nova_core`, its Catch2 unit tests (`nova_tests`) and `nova_bsdf_precompute` build against system libraries, with
GCC on Linux; neither Houdini, Windows nor vcpkg is needed. This is the default configuration away from Windows
(`-DNOVA_CORE_ONLY=ON`, [`cmake/NovaStandalone.cmake`](cmake/NovaStandalone.cmake)). On Ubuntu 24.04:

```sh
sudo apt install cmake ninja-build g++ libembree-dev libtbb-dev libosd-dev catch2
cmake --preset core
cmake --build --preset core
ctest --preset core
```

- **Libraries:** Embree 4, oneTBB, OpenSubdiv and Catch2 3 from the system. The NanoVDB 32.6 headers (the version
Houdini 22.0 ships) are fetched from the OpenVDB repository at configure time; `-DNOVA_NANOVDB_INCLUDE_DIR=<dir>`
names existing ones and `-DNOVA_FETCH_NANOVDB=OFF` turns the download off.
- **Not built:** the Hydra delegate, the Houdini package, `nova_cli`, `nova_imgcmp` and the GPU backend. Their
tests, and the unit tests that need a GPU, do not run.
- **Sanitizers:** `cmake --preset core-sanitize` builds the same targets with AddressSanitizer and UBSan (float
casts included; a finding stops the test).
- **Continuous integration:** [`.github/workflows/core.yml`](.github/workflows/core.yml) runs both presets on every
pull request.

### Tests

The husk, reference and Houdini tests run Houdini in an isolated environment with an empty preference
directory, so installed packages never interfere and a running Houdini session is never touched. Regenerating the
Karma reference images needs a Karma license. See [`docs/reference.md`](docs/reference.md#tests) and
[`tests/reference/README.md`](tests/reference/README.md).
Expand All @@ -150,14 +178,17 @@ Karma reference images needs a Karma license. See [`docs/reference.md`](docs/ref
| `tests/` | Catch2 unit tests, husk and CLI test scenes, the Karma reference scenes and images, Houdini UI tests |
| `docs/` | The plan, design notes per milestone, research notes, benchmarks, the bug audit, the [reference](docs/reference.md) |
| `third_party/` | NVIDIA FLIP (header only) and the Hošek–Wilkie sky model data |
| `cmake/` | Where the libraries come from: Houdini (`NovaHoudini.cmake`), CUDA and OptiX (`NovaOptiX.cmake`), or the system in a core-only build (`NovaStandalone.cmake`) |
| `.github/workflows/` | Continuous integration: the core-only build and its unit tests on Linux |

## Documentation

- [`docs/reference.md`](docs/reference.md): using Nova in Houdini, every setting and per-object property, the
features of each milestone with their measured differences to Karma, tools and tests.
- [`docs/design/`](docs/design/): design notes per milestone. M11 covers Karma's Solaris nodes, one note per package.
- [`docs/benchmarks.md`](docs/benchmarks.md): performance measurements, CPU and GPU.
- [`docs/bug-audit-2026-11.md`](docs/bug-audit-2026-11.md): audits, fixes and remaining limitations.
- [`docs/limitations.md`](docs/limitations.md): the current limitations in one place.
- [`docs/bug-audit-2026-11.md`](docs/bug-audit-2026-11.md): audits, fixes and the limitations they left.
- [`docs/PLAN.md`](docs/PLAN.md): the original milestone plan, in German.

## License
Expand Down
14 changes: 14 additions & 0 deletions cmake/NovaHoudini.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# HFS Houdini installation root
# Houdini::* imported targets from $HFS/toolkit/cmake/HoudiniConfig.cmake
# Nova::TBB Houdini's oneTBB without the rest of the HDK
# Nova::OpenSubdiv Houdini's OpenSubdiv (osdCPU)
# Nova::NanoVDB Houdini's header-only NanoVDB
# Nova::OIIO Houdini's OpenImageIO (namespace HOIIO_*, not part of HoudiniConfig)
# Nova::MaterialX Houdini's MaterialX Core + Format (not part of HoudiniConfig)

Expand Down Expand Up @@ -35,6 +37,18 @@ target_include_directories(nova_tbb SYSTEM INTERFACE "${HFS}/toolkit/include")
target_link_libraries(nova_tbb INTERFACE Houdini::Dep::tbb)
target_compile_definitions(nova_tbb INTERFACE __TBB_NO_IMPLICIT_LINKAGE=1)

# OpenSubdiv 3.7 comes from Houdini as a static /MD archive (libosdCPU_md.lib,
# declared as Houdini::Dep::osdCPU) and NanoVDB 32.6 as headers; both have
# their headers in $HFS/toolkit/include. A core-only build takes them from the
# system instead (NovaStandalone.cmake).
add_library(nova_opensubdiv INTERFACE)
add_library(Nova::OpenSubdiv ALIAS nova_opensubdiv)
target_include_directories(nova_opensubdiv SYSTEM INTERFACE "${HFS}/toolkit/include")
target_link_libraries(nova_opensubdiv INTERFACE Houdini::Dep::osdCPU)
add_library(nova_nanovdb INTERFACE)
add_library(Nova::NanoVDB ALIAS nova_nanovdb)
target_include_directories(nova_nanovdb SYSTEM INTERFACE "${HFS}/toolkit/include")

# OpenImageIO ships with Houdini (OpenImageIO_sidefx.dll in $HFS/bin) but has
# no target in HoudiniConfig. Its headers need Imath, which does.
foreach(_lib OpenImageIO OpenImageIO_Util)
Expand Down
87 changes: 87 additions & 0 deletions cmake/NovaStandalone.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# The libraries of a build without Houdini (NOVA_CORE_ONLY): nova_core, its
# unit tests and nova_bsdf_precompute against system packages. It defines the
# same targets NovaHoudini.cmake does for the core:
#
# Nova::TBB oneTBB (find_package(TBB))
# Nova::OpenSubdiv OpenSubdiv's osdCPU (3.5 or newer)
# Nova::NanoVDB the header-only NanoVDB 32.6 or newer of ABI 32 (OpenVDB 11), the version Houdini 22.0 ships
#
# NanoVDB comes from NOVA_NANOVDB_INCLUDE_DIR or the system; when that is
# missing or older, the headers are fetched from the OpenVDB repository
# (-DNOVA_FETCH_NANOVDB=OFF turns the download off).

find_package(TBB CONFIG REQUIRED)
add_library(nova_tbb INTERFACE)
add_library(Nova::TBB ALIAS nova_tbb)
target_link_libraries(nova_tbb INTERFACE TBB::tbb)

# OpenSubdiv's own package config names static archives that distributions
# leave out (it then fails the configure), so the library is located by hand.
find_path(NOVA_OPENSUBDIV_INCLUDE_DIR opensubdiv/version.h)
find_library(NOVA_OPENSUBDIV_LIBRARY NAMES osdCPU)
if(NOT NOVA_OPENSUBDIV_INCLUDE_DIR OR NOT NOVA_OPENSUBDIV_LIBRARY)
message(FATAL_ERROR "Nova: OpenSubdiv (osdCPU) not found. Install it (Debian/Ubuntu: libosd-dev) or set "
"NOVA_OPENSUBDIV_INCLUDE_DIR and NOVA_OPENSUBDIV_LIBRARY.")
endif()
add_library(nova_opensubdiv INTERFACE)
add_library(Nova::OpenSubdiv ALIAS nova_opensubdiv)
target_include_directories(nova_opensubdiv SYSTEM INTERFACE "${NOVA_OPENSUBDIV_INCLUDE_DIR}")
target_link_libraries(nova_opensubdiv INTERFACE "${NOVA_OPENSUBDIV_LIBRARY}")

option(NOVA_FETCH_NANOVDB "Fetch the NanoVDB headers if no usable version is installed" ON)
set(NOVA_NANOVDB_FETCH_TAG "v11.0.0" CACHE STRING "Tag of github.com/AcademySoftwareFoundation/openvdb to fetch (NanoVDB 32.6)")

# Sets _nova_nanovdb_ok when dir/nanovdb/NanoVDB.h is version 32.6 or a later
# version of ABI 32 (the grids' binary layout, core/volume/grid.h).
function(_nova_check_nanovdb dir)
set(_nova_nanovdb_ok OFF PARENT_SCOPE)
if(NOT EXISTS "${dir}/nanovdb/NanoVDB.h")
return()
endif()
file(STRINGS "${dir}/nanovdb/NanoVDB.h" _lines REGEX "^#define NANOVDB_(MAJOR|MINOR|PATCH)_VERSION_NUMBER [0-9]+")
foreach(_part MAJOR MINOR PATCH)
set(_${_part} 0)
foreach(_line IN LISTS _lines)
if(_line MATCHES "^#define NANOVDB_${_part}_VERSION_NUMBER ([0-9]+)")
set(_${_part} "${CMAKE_MATCH_1}")
endif()
endforeach()
endforeach()
set(NOVA_NANOVDB_VERSION "${_MAJOR}.${_MINOR}.${_PATCH}" PARENT_SCOPE)
# util/CreateNanoGrid.h and util/GridBuilder.h (the tests) moved in 32.7.
if(_MAJOR EQUAL 32 AND _MINOR GREATER_EQUAL 6 AND EXISTS "${dir}/nanovdb/util/CreateNanoGrid.h")
set(_nova_nanovdb_ok ON PARENT_SCOPE)
endif()
endfunction()

find_path(NOVA_NANOVDB_INCLUDE_DIR nanovdb/NanoVDB.h)
_nova_check_nanovdb("${NOVA_NANOVDB_INCLUDE_DIR}")
if(NOT _nova_nanovdb_ok)
if(NOVA_NANOVDB_INCLUDE_DIR)
message(STATUS "Nova: NanoVDB ${NOVA_NANOVDB_VERSION} at ${NOVA_NANOVDB_INCLUDE_DIR} is not 32.6 or newer of ABI 32")
endif()
if(NOT NOVA_FETCH_NANOVDB)
message(FATAL_ERROR "Nova: no NanoVDB 32.6 headers. Set NOVA_NANOVDB_INCLUDE_DIR to the directory that holds "
"nanovdb/NanoVDB.h (OpenVDB 11's nanovdb/ directory), or configure with -DNOVA_FETCH_NANOVDB=ON.")
endif()
include(FetchContent)
# Headers only: SOURCE_SUBDIR names no CMakeLists.txt, so OpenVDB's own
# build is never configured.
FetchContent_Declare(nova_openvdb
GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git
GIT_TAG "${NOVA_NANOVDB_FETCH_TAG}"
GIT_SHALLOW ON
SOURCE_SUBDIR nova-headers-only)
FetchContent_MakeAvailable(nova_openvdb)
set(NOVA_NANOVDB_INCLUDE_DIR "${nova_openvdb_SOURCE_DIR}/nanovdb" CACHE PATH "NanoVDB include directory" FORCE)
_nova_check_nanovdb("${NOVA_NANOVDB_INCLUDE_DIR}")
if(NOT _nova_nanovdb_ok)
message(FATAL_ERROR "Nova: the fetched NanoVDB (${NOVA_NANOVDB_FETCH_TAG}) is not 32.6 or newer of ABI 32.")
endif()
endif()
add_library(nova_nanovdb INTERFACE)
add_library(Nova::NanoVDB ALIAS nova_nanovdb)
target_include_directories(nova_nanovdb SYSTEM INTERFACE "${NOVA_NANOVDB_INCLUDE_DIR}")

message(STATUS "Nova: core-only build without Houdini (TBB ${TBB_VERSION}, OpenSubdiv at ${NOVA_OPENSUBDIV_LIBRARY}, "
"NanoVDB ${NOVA_NANOVDB_VERSION} at ${NOVA_NANOVDB_INCLUDE_DIR})")
17 changes: 12 additions & 5 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ add_library(nova_core STATIC

target_include_directories(nova_core PUBLIC "${PROJECT_SOURCE_DIR}")
target_compile_features(nova_core PUBLIC cxx_std_20)
# OpenSubdiv 3.7 comes from Houdini as a static /MD archive (libosdCPU_md.lib,
# declared as Houdini::Dep::osdCPU); its headers are in $HFS/toolkit/include,
# which Nova::TBB already adds.
# TBB, OpenSubdiv and NanoVDB come from Houdini (cmake/NovaHoudini.cmake) or,
# in a core-only build, from the system (cmake/NovaStandalone.cmake).
target_link_libraries(nova_core
PUBLIC Nova::TBB
PRIVATE embree Houdini::Dep::osdCPU
PUBLIC Nova::TBB Nova::NanoVDB
PRIVATE embree Nova::OpenSubdiv
)
if(NOVA_HAS_OPTIX)
target_link_libraries(nova_core PRIVATE Nova::OptiX)
Expand Down Expand Up @@ -114,4 +113,12 @@ if(MSVC)
# Generated tables: 9-digit literals round-trip to the stored floats.
set_source_files_properties(bsdf/tables/bsdf_tables.cpp PROPERTIES COMPILE_OPTIONS /wd4305)
target_compile_definitions(nova_core PUBLIC NOMINMAX _USE_MATH_DEFINES)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
# GCC and Clang: the instruction sets of /arch:AVX2 (the SIMD shading VM
# is in headers, hence PUBLIC), and no FMA contraction, as MSVC's
# /fp:precise and the GPU kernels' --fmad=false: one image on every build.
target_compile_options(nova_core PUBLIC -march=haswell -mtune=generic -ffp-contract=off)
target_compile_options(nova_core PRIVATE -Wall)
else()
message(FATAL_ERROR "Nova: nova_core needs an x86-64 CPU with AVX2 (CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}).")
endif()
Loading
Loading