Skip to content

Commit

Permalink
AMD Capsaicin Framework v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kurbeco committed Mar 19, 2024
1 parent 7e3beea commit d642e5d
Show file tree
Hide file tree
Showing 189 changed files with 19,708 additions and 6,402 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
.DS_Store
imgui.ini
.vscode
.vs
out
8 changes: 1 addition & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
[submodule "third_party/CLI11"]
path = third_party/CLI11
url = https://github.com/CLIUtils/CLI11
[submodule "third_party/tinyexr"]
path = third_party/tinyexr
url = https://github.com/syoyo/tinyexr
[submodule "third_party/miniz"]
path = third_party/miniz
url = https://github.com/richgel999/miniz.git
[submodule "assets/CapsaicinTestMedia"]
path = assets/CapsaicinTestMedia
url = ../CapsaicinTestMedia.git
url = https://github.com/GPUOpen-LibrariesAndSDKs/CapsaicinTestMedia.git
42 changes: 17 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.24.0)

project(Capsaicin
VERSION 1.0.0
VERSION 1.1.0
DESCRIPTION "AMD experimental real-time rendering framework designed for graphics research and development"
)

set(GFX_BUILD_EXAMPLES OFF CACHE BOOL "Build gfx examples")
set(TINYGLTF_BUILD_LOADER_EXAMPLE OFF CACHE BOOL "Build loader_example")

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Set preprocessor definitions
add_definitions(/MP
-D_HAS_ITERATOR_DEBUGGING=0
add_definitions(
/MP
)

# Gather dependencies
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/gfx)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/CLI11)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/miniz)
# Disable unused parameters from 3rd party directories
set(GFX_BUILD_EXAMPLES OFF CACHE BOOL "")
set(BUILD_TESTING OFF CACHE BOOL "")

# Set linker flags
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
# Enable gfx options
set(GFX_ENABLE_SCENE ON CACHE BOOL "")
set(GFX_ENABLE_GUI ON CACHE BOOL "")

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Gather dependencies
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/gfx EXCLUDE_FROM_ALL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/CLI11 EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)

# Organize third party projects
set_target_properties(uninstall PROPERTIES FOLDER "third_party")
set_target_properties(miniz PROPERTIES FOLDER "third_party")
set_target_properties(gfx PROPERTIES FOLDER "third_party")
set_target_properties(CLI11 PROPERTIES FOLDER "third_party")
set_target_properties(tinyobjloader PROPERTIES FOLDER "third_party/gfx_deps")
set_target_properties(tinyexr PROPERTIES FOLDER "third_party/gfx_deps")
set_target_properties(ktx PROPERTIES FOLDER "third_party/gfx_deps")
set_target_properties(astcenc-avx2-static PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
set_target_properties(ktx_read PROPERTIES FOLDER "third_party/gfx_deps/ktx_deps")
Expand Down Expand Up @@ -65,18 +64,11 @@ ELSE()
SET(CAPSAICIN_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} CACHE STRING "Path for archive output files")
ENDIF()

set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install")

# Build Capsaicin
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)

# Set up startup project
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT scene_viewer)

# Install assets and shaders directories
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION . FILES_MATCHING PATTERN "*.*")
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/core/shaders DESTINATION src/core FILES_MATCHING PATTERN "*.*")

# Configure CPack
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}")
include(CPack)
77 changes: 77 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"version": 3,
"configurePresets": [
{
"name": "msvc-base",
"description": "Target Windows with the Visual Studio development environment.",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64-Debug",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
"inherits": "msvc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release-with-debug-info",
"displayName": "x64-RelWithDebInfo",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Release with Debug Info)",
"inherits": "msvc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "x64-release",
"displayName": "x64-Release",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Release)",
"inherits": "msvc-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"buildPresets": [
{
"name": "debug-build-windows",
"displayName": "x64-Debug",
"configurePreset": "x64-debug",
"description": "Debug Windows build"
},
{
"name": "release-with-debug-info-build-windows",
"displayName": "x64-RelWithDebInfo",
"configurePreset": "x64-release-with-debug-info",
"description": "Release with Debug Info Windows build"
},
{
"name": "release-build-windows",
"displayName": "x64-Release",
"configurePreset": "x64-release",
"description": "Release Windows build"
}
]
}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ Features:

![Capsaicin](docs/images/scene_viewer.png)

## GI-1.0
## GI-1.1

We used Capsaicin to implement our GI-1.0 technique for estimating diffuse indirect illumination in real-time.
We used Capsaicin to implement our GI-1.1 technique for estimating diffuse and specular indirect illumination in real-time.

The technique uses two levels of radiance caching to allow for reduced sampling rate in order to improve performance while making the most of every ray through better sampling.

Please refer to our [publication](https://gpuopen.com/download/publications/GPUOpen2022_GI1_0.pdf) for more technical details.
Please refer to our [GI-1.0 technical report](https://gpuopen.com/download/publications/GPUOpen2022_GI1_0.pdf) and [GI-1.1 paper](https://gpuopen.com/download/publications/SA2023_RealTimeReflection.pdf) for more technical details.

#### Note on light support

GI-1.0 is primarily an indirect lighting solution and as such is expected to be combined with an existing direct lighting technique for integration into a rendering pipeline.
GI-1.1 is primarily an indirect lighting solution and as such is expected to be combined with an existing direct lighting technique for integration into a rendering pipeline.

All common light types are supported when evaluating the indirect lighting component (e.g., point lights, spot lights, etc.) using our grid-based light sampler and (optional) reservoir-based resampling.

Expand Down Expand Up @@ -60,15 +60,43 @@ Capsaicin uses the [CMake](https://cmake.org/) build system. See the [Getting St

## Citation

If Capsaicin is used any any published work, ensure to cite it using:
If Capsaicin is used in any published work, please ensure to cite it using:

```bibtex
@Misc{Capsaicin23,
author = {Guillaume Boissé, Matthew Oliver, Sylvain Meunier, Héloïse Dupont de Dinechin and Kenta Eto},
author = {Boissé, Guillaume and Oliver, Matthew and Meunier, Sylvain and Dupont de Dinechin, Héloïse and Eto, Kenta},
title = {The {AMD Capsaicin Framework}},
year = {2023},
month = {5},
month = {8},
url = {https://github.com/GPUOpen-LibrariesAndSDKs/Capsaicin},
note = {\url{https://github.com/GPUOpen-LibrariesAndSDKs/Capsaicin}}
}
```

If our techniques are referenced in any published work, please ensure to cite them using:

```bibtex
@inproceedings{10.1145/3610543.3626167,
author = {Eto, Kenta and Meunier, Sylvain and Harada, Takahiro and Boiss\'{e}, Guillaume},
title = {Real-Time Rendering of Glossy Reflections Using Ray Tracing and Two-Level Radiance Caching},
year = {2023},
isbn = {9798400703140},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3610543.3626167},
doi = {10.1145/3610543.3626167},
abstract = {Estimation of glossy reflections remains a challenging topic for real-time renderers. Ray tracing is a robust solution for evaluating the specular lobe of a given BRDF; however, it is computationally expensive and introduces noise that requires filtering. Other solutions, such as light probe systems, offer to approximate the signal with little to no noise and better performance but tend to introduce additional bias in the form of overly blurred visuals. This paper introduces a novel approach to rendering reflections in real time that combines the radiance probes of an existing diffuse global illumination framework with denoised ray-traced reflections calculated at a low sampling rate. We will show how combining these two sources allows producing an efficient and high-quality estimation of glossy reflections that is suitable for real-time applications such as games.},
booktitle = {SIGGRAPH Asia 2023 Technical Communications},
articleno = {4},
numpages = {4},
keywords = {real-time, ray tracing, rendering},
location = {<conf-loc>, <city>Sydney</city>, <state>NSW</state>, <country>Australia</country>, </conf-loc>},
series = {SA '23}
}
@misc{gi10,
author = {Guillaume Boissé and Sylvain Meunier and Heloise de Dinechin and Pieterjan Bartels and Alexander Veselov and Kenta Eto and Takahiro Harada},
title = {GI-1.0: A Fast Scalable Two-Level Radiance Caching Scheme for Real-Time Global Illumination},
year = {2023},
url = {https://gpuopen.com/download/publications/GPUOpen2022_GI1_0.pdf}
}
```
2 changes: 1 addition & 1 deletion assets/CapsaicinTestMedia
Loading

0 comments on commit d642e5d

Please sign in to comment.