Skip to content

Commit

Permalink
1.7.0 (#68)
Browse files Browse the repository at this point in the history
OMM Viewer: new tool to view OMM build results.
Renaming the core lib from omm-sdk to omm-lib (OMM_USE_LEGACY_OMM_LIB_NAME to use old name).
Cpu baker: General performance optimzations
Cpu baker: Option to set maximum ommArraySize, to make sure bake results fit within a certain budget.
Cpu baker: Option to set the near-duplicate detection threshold when near-duplicate detection is enabled.
General repo folder structure cleanup
  • Loading branch information
nv-jdeligiannis authored Feb 5, 2025
1 parent af92a7d commit 36549c2
Show file tree
Hide file tree
Showing 155 changed files with 7,322 additions and 590 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name : Checkout
uses: actions/checkout@v3
with:
submodules: true
submodules: 'recursive'
-
name: Install dependencies
uses: crazy-max/ghaction-chocolatey@v2
Expand All @@ -36,7 +36,7 @@ jobs:
$Env:Path += ";C:/VulkanSDK/Bin"
mkdir "build"
cd "build"
cmake .. -A x64
cmake -DOMM_VIEWER_INSTALL=OFF -A x64 ..
cd ..
-
name: Build Debug
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
cd ..
-
name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Opacity Micro-Map SDK Windows
path: build/install
Expand All @@ -76,7 +76,7 @@ jobs:
name : Checkout
uses: actions/checkout@v3
with:
submodules: true
submodules: 'recursive'
-
name: Setup CMake
uses: jwlawson/[email protected]
Expand All @@ -93,14 +93,20 @@ jobs:
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt install libwayland-dev wayland-protocols
sudo apt install libxkbcommon-dev
sudo apt install libxrandr-dev
sudo apt install libxinerama-dev
sudo apt install libxcursor-dev
sudo apt install libxi-dev
sudo apt install -y vulkan-sdk
-
name: CMake Generate
run: |
mkdir "build"
cd "build"
cmake -G Ninja ..
cmake -G Ninja -DOMM_VIEWER_INSTALL=OFF ..
cd ..
-
name: Build Debug
Expand Down Expand Up @@ -128,7 +134,7 @@ jobs:
cd ..
-
name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Opacity Micro-Map SDK Linux
path: build/install
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake_install.cmake
Makefile

# ShaderMake
shaders.cfg
omm-lib/shaders.cfg

# VS
*.vcxproj*
Expand Down
27 changes: 12 additions & 15 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
[submodule "thirdparty/glm"]
path = thirdparty/glm
url = https://github.com/g-truc/glm.git
[submodule "test/thirdparty/gtest"]
path = thirdparty/gtest
path = external/gtest
url = https://github.com/google/googletest.git
[submodule "benchmark/thirdparty/gbenchmark"]
path = benchmark/thirdparty/gbenchmark
url = https://github.com/google/benchmark.git
[submodule "thirdparty/xxHash"]
path = thirdparty/xxHash
path = external/xxHash
url = https://github.com/Cyan4973/xxHash.git
[submodule "thirdparty/stb"]
path = thirdparty/stb
path = external/stb
url = https://github.com/nothings/stb.git
[submodule "thirdparty/nvrhi"]
path = thirdparty/nvrhi
url = https://github.com/NVIDIAGameWorks/nvrhi.git
[submodule "thirdparty/ShaderMake"]
path = thirdparty/ShaderMake
url = https://github.com/NVIDIAGameWorks/ShaderMake.git
[submodule "thirdparty/lz4"]
path = thirdparty/lz4
url = https://github.com/lz4/lz4.git
[submodule "thirdparty/imgui-filebrowser"]
path = external/imgui-filebrowser
url = https://github.com/AirGuanZ/imgui-filebrowser.git
[submodule "external/glm"]
path = external/glm
url = https://github.com/g-truc/glm.git
[submodule "external/donut"]
path = external/donut
url = https://github.com/NVIDIA-RTX/Donut.git
44 changes: 36 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
cmake_minimum_required(VERSION 3.12)

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gtest)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/gtest)
option(OMM_ENABLE_TESTS "Enable unit test" ON)
endif()

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/omm-sdk/src/version.h" ver_h)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/donut)
option(OMM_BUILD_VIEWER "Build omm viewer tool" ON)
else()
option(OMM_BUILD_VIEWER "Build omm viewer tool" OFF)
endif()


if (NOT OMM_LIB_TARGET_NAME)
option(OMM_USE_LEGACY_OMM_LIB_NAME "Use the legacy target name of omm-lib: \"omm-sdk\"" OFF)

if (OMM_USE_LEGACY_OMM_LIB_NAME)
set(OMM_LIB_TARGET_NAME omm-sdk)
else()
set(OMM_LIB_TARGET_NAME omm-lib)
endif()
endif()

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/libraries/omm-lib/src/version.h" ver_h)
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${ver_h})
set(ver_major ${CMAKE_MATCH_1})
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${ver_h})
Expand All @@ -28,14 +45,25 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (NOT DEFINED OMM_PROJECT_FOLDER)
set(OMM_PROJECT_FOLDER "Opacity Micro-Map SDK")
set(OMM_PROJECT_FOLDER "Libraries")
endif()

add_subdirectory(thirdparty)
add_subdirectory(shared)
add_subdirectory(omm-sdk)
add_subdirectory(integration)
add_subdirectory(external)
add_subdirectory(libraries/omm-lib)
add_subdirectory(libraries/omm-gpu-nvrhi)

if (OMM_BUILD_VIEWER)
add_subdirectory(tools/viewer)
endif()

if (OMM_ENABLE_TESTS)
add_subdirectory(tests)
add_subdirectory(support/tests)
endif()

add_subdirectory(support/scripts)

if (OMM_BUILD_VIEWER)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT viewer)
elseif(OMM_ENABLE_TESTS)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT tests)
endif()
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
[![Build Opacity Micro-Map SDK](https://github.com/NVIDIAGameWorks/Opacity-MicroMap-SDK/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/NVIDIAGameWorks/Opacity-MicroMap-SDK/actions/workflows/build.yml)

# New in 1.7.0: Opacity Micro-Map Viewer Tool

Version 1.7.0 introcuces the new Opacity Micro-Map Viewer Tool
<p align="center">
<img src="docs/images/viewer/viewer.png" width=100% height=auto alt="varying triangle subdivision levels">
</p>

Use the new serialization API to view your OMM assets and experiment with different bake settings to achive optimal performance and quality trade-offs. You can view and inspect your existing assets, zoom down to the micro-triangle level all the way out to the macro-triangle scale, highlights specific triangles, understand OMM block re-use and much more.

# Runnable Samples
Get the OMM SDK demo app: [https://github.com/NVIDIAGameWorks/Opacity-MicroMap-Samples](https://github.com/NVIDIAGameWorks/Opacity-MicroMap-Samples)

Expand Down
Binary file added assets/omm_example_data/leaves.bin
Binary file not shown.
File renamed without changes
Binary file added docs/images/viewer/viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/integration_guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# NVIDIA Opacity Micro-Map SDK

<p align="center">
<img src="images/header/omm_off.png" alt="shader execution without OMMs">
<img src="images/header/omm_on.png" alt="shader with OMMs">
Expand Down
94 changes: 94 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

option(NVRHI_INSTALL OFF)
set (SHADERMAKE_BIN_OUTPUT_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" CACHE STRING "")
# donut & nvrhi & lz4

option(BUILD_SHARED_LIBS "" OFF)
option(LZ4_BUILD_CLI "" OFF)

option(DONUT_WITH_AUDIO "" OFF)
option(DONUT_WITH_ASSIMP "" OFF)
option(DONUT_WITH_DX11 "" OFF)
option(DONUT_WITH_LZ4 "" ON) # dependency of omm-lib
option(DONUT_WITH_MINIZ "" OFF)
option(DONUT_WITH_STATIC_SHADERS "" ON)
option(DONUT_WITH_TASKFLOW "" OFF)
option(DONUT_WITH_TINYEXR "" OFF)
option(DONUT_WITH_STREAMLINE "" OFF)

set(DONUT_SHADERS_OUTPUT_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders/framework")
add_subdirectory(donut)

set_property(TARGET donut_app PROPERTY FOLDER "External/Donut")
set_property(TARGET donut_core PROPERTY FOLDER "External/Donut")
set_property(TARGET donut_engine PROPERTY FOLDER "External/Donut")
set_property(TARGET donut_render PROPERTY FOLDER "External/Donut")
set_property(TARGET donut_shaders PROPERTY FOLDER "External/Donut")
set_property(TARGET update_mappings PROPERTY FOLDER "External/GLFW3")

if (TARGET nvrhi)
set_property(TARGET nvrhi PROPERTY FOLDER "External")
endif()

if (TARGET nvrhi_d3d12)
set_property(TARGET nvrhi_d3d12 PROPERTY FOLDER "External")
endif()
if (TARGET nvrhi_vk)
set_property(TARGET nvrhi_vk PROPERTY FOLDER "External")
endif()

set_property(TARGET imgui PROPERTY FOLDER "External")
set_property(TARGET jsoncpp_static PROPERTY FOLDER "External")
set_property(TARGET glfw PROPERTY FOLDER "External")

# GLM
add_subdirectory("glm")
set_property(TARGET glm PROPERTY FOLDER "External")

if(BUILD_STATIC_LIBS)
set_property(TARGET glm_static PROPERTY FOLDER "External")
endif()

if(BUILD_SHARED_LIBS)
set_property(TARGET glm_shared PROPERTY FOLDER "External")
endif()

# xxHash
set(XXHASH_BUILD_XXHSUM OFF)
add_subdirectory("xxHash/cmake_unofficial")
set_property(TARGET xxhash PROPERTY FOLDER "External")

# stb
add_library(stb_lib INTERFACE)
target_include_directories(stb_lib INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/stb>)

# lz4
if (TARGET lz4)
set_property(TARGET lz4 PROPERTY FOLDER "External")
endif()
if (TARGET lz4_static)
set_property(TARGET lz4_static PROPERTY FOLDER "External")
endif()

if (TARGET ShaderMake)
set_property(TARGET ShaderMake PROPERTY FOLDER "External")
set_property(TARGET ShaderMakeBlob PROPERTY FOLDER "External")
endif()

# nvrhi
if (TARGET nvrhi)
set_target_properties(nvrhi PROPERTIES FOLDER "External")
endif()

if (TARGET nvrhi_d3d12)
set_target_properties(nvrhi_d3d12 PROPERTIES FOLDER "External")
endif()

# gtest
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/gtest AND OMM_ENABLE_TESTS)
set(BUILD_GMOCK OFF)
set(INSTALL_GTEST OFF)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory("gtest")
set_target_properties("gtest_main" "gtest" PROPERTIES FOLDER "External")
endif()
1 change: 1 addition & 0 deletions external/donut
Submodule donut added at 04c9b2
1 change: 1 addition & 0 deletions external/glm
Submodule glm added at 69b130
1 change: 1 addition & 0 deletions external/imgui-filebrowser
Submodule imgui-filebrowser added at 60d4e0
1 change: 1 addition & 0 deletions external/stb
Submodule stb added at 5c2057
1 change: 1 addition & 0 deletions external/xxHash
Submodule xxHash added at e626a7
18 changes: 0 additions & 18 deletions integration/CMakeLists.txt

This file was deleted.

18 changes: 18 additions & 0 deletions libraries/omm-gpu-nvrhi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

if (WIN32 AND TARGET nvrhi)
option(OMM_INTEGRATION_LAYER_NVRHI "Build nvrhi integration layer" ON)
set(EXTRA_LIBS nvrhi_d3d12 d3d12.lib dxgi.lib)
else()
option(OMM_INTEGRATION_LAYER_NVRHI "Build nvrhi integration layer" OFF)
set(EXTRA_LIBS )
endif()

if (OMM_INTEGRATION_LAYER_NVRHI)
set(OMM_LIB_NVRHI_HEADERS omm-gpu-nvrhi.h)
set(OMM_LIB_NVRHI_SOURCE omm-gpu-nvrhi.cpp)
add_library(omm-gpu-nvrhi STATIC ${OMM_LIB_NVRHI_HEADERS} ${OMM_LIB_NVRHI_SOURCE})
target_include_directories(omm-gpu-nvrhi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(omm-gpu-nvrhi ${OMM_LIB_TARGET_NAME} nvrhi ${EXTRA_LIBS})
set_target_properties(omm-gpu-nvrhi PROPERTIES FOLDER "${OMM_PROJECT_FOLDER}")
endif()

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ distribution of this software and related documentation without an express
license agreement from NVIDIA CORPORATION is strictly prohibited.
*/

#include <omm-sdk-nvrhi.h>
#include "omm-gpu-nvrhi.h"

#include <nvrhi/common/misc.h>
#include <nvrhi/utils.h>
Expand Down
File renamed without changes.
Loading

0 comments on commit 36549c2

Please sign in to comment.