Skip to content

Commit f41df33

Browse files
committed
Merge branch 'topic/ch11_voxel' into develop
2 parents 40c9857 + 6f25fb2 commit f41df33

File tree

136 files changed

+7942
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+7942
-136
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ git clone [email protected]:Adnn/realtime_rendering_assets.git assets
1414

1515
The repository contains several standalone applications demonstrating real-time rendering techniques.
1616

17+
18+
### ch11_voxel
19+
20+
Implements a GPU-accelerated voxelization pipeline, accumulations in voxel space,
21+
compute-based mipmap filtering, and cone tracing to achieve different GI effects
22+
(radiance accumulation, AO, visibility).
23+
24+
[![intel_sponza-directional_vxgi](https://adnn.github.io/assets/rtr_prototypes/ch11_voxel/rtr_11-intel_sponza-864.jpg)](https://adnn.github.io/assets/rtr_prototypes/ch11_voxel/rtr_11-intel_sponza-1920.jpg)
25+
26+
1727
### ch11_ssao
1828

1929
Implement Screen-Space Ambient Occlusion (SSAO) in a viewer supporting PBR shading and image-based lighting (IBL).

conan/conanfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@ class GraphicsConan(ConanFile):
2323
default_options = {
2424
"shared": False,
2525
"fPIC": True,
26+
"tracy/*:on_demand": True,
2627
}
2728

2829
generators = "CMakeToolchain"
2930
revision_mode = "scm"
3031

3132
def requirements(self):
32-
self.requires("graphics/a842a03bf7@adnn", transitive_headers=True)
33+
self.requires("graphics/8b6fc11949@adnn", transitive_headers=True)
3334
self.requires("handy/97edf2bb4f@adnn", transitive_headers=True)
34-
self.requires("math/ee8b6fb1ed@adnn", transitive_headers=True)
35+
self.requires("math/56d3b88bbf@adnn", transitive_headers=True)
3536

3637
self.requires("assimp/5.4.3", transitive_headers=False)
3738
self.requires("imgui/1.91.5-docking", transitive_headers=True)
3839
# Note: we do not want spdlog to be a public dependency
3940
self.requires("spdlog/1.15.1", transitive_headers=False)
41+
self.requires("tracy/0.12.1", transitive_headers=False)
4042

4143

4244
# There exist automatic alternatives.

scripts/convert_dds.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!python
2+
3+
# Taking an input JSON file with categories (key) and array of images (values),
4+
# apply nvtt_export to each files under each category.
5+
# Parameters to nvtt_export are defined by category in `params_by_key`.
6+
# Note: The loader code produce a categorized output in `sorted_textures.json`
7+
8+
import json
9+
import os
10+
import subprocess
11+
import sys
12+
13+
# Parameters for each key
14+
params_by_key = {
15+
"diffuse": ["--format", "bc7", "--dx10", "--quality", "normal", "--mips", "--mip-filter", "box", "--save-flip-y", "--export-transfer-function", "srgb", "--zcmp", "5"],
16+
"normal": ["--format", "bc5", "--dx10", "--quality", "normal", "--mips", "--mip-filter", "box", "--no-mip-gamma-correct", "--save-flip-y", "--export-transfer-function", "linear", "--zcmp", "5"],
17+
"mrao": ["--format", "bc7", "--dx10", "--quality", "normal", "--mips", "--mip-filter", "box", "--save-flip-y", "--export-transfer-function", "linear", "--zcmp", "5"],
18+
}
19+
20+
# Parse JSON
21+
data_path = sys.argv[1]
22+
data = json.load(open(data_path))
23+
prefix = os.path.dirname(os.path.abspath(data_path))
24+
25+
for key, values in data.items():
26+
params = params_by_key.get(key, [])
27+
for val in values:
28+
cmd = ["nvtt_export"] + params + [os.path.join(prefix, val)]
29+
subprocess.run(cmd)

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ add_subdirectory(libs/scenic/scenic)
88
add_subdirectory(apps/ch10_area_lights/ch10_area_lights)
99
add_subdirectory(apps/ch10_ltc/ch10_ltc)
1010
add_subdirectory(apps/ch11_ssao/ch11_ssao)
11+
add_subdirectory(apps/ch11_voxel/ch11_voxel)
12+
add_subdirectory(apps/sandbox/sandbox)
1113

1214
if(BUILD_TESTING)
1315
#add_subdirectory()

src/apps/ch10_area_lights/ch10_area_lights/CameraSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
namespace ad {
55

66

7-
void OrbitalCamera::update(int aWindowHeight)
7+
void OrbitalCamera::update(float aDeltaTime, int aWindowHeight)
88
{
9-
mOrbitalControl.update(mViewHeightInWorld, aWindowHeight);
9+
mOrbitalControl.update(aDeltaTime, mViewHeightInWorld, aWindowHeight);
1010
}
1111

1212

src/apps/ch10_area_lights/ch10_area_lights/CameraSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace ad {
88

99
struct OrbitalCamera
1010
{
11-
void update(int aWindowHeight);
11+
void update(float aDeltaTime, int aWindowHeight);
1212

1313
void setRatio(float aAspectRatio);
1414

src/apps/ch10_area_lights/ch10_area_lights/Scene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ void Scene::loadPrograms()
245245
}
246246

247247

248-
void Scene::step(const graphics::Timer & /*aTimer*/,
248+
void Scene::step(const graphics::Timer & aTimer,
249249
math::Size<2, int> aWindowResolution)
250250
{
251-
mOrbitalCamera.update(aWindowResolution.height());
251+
mOrbitalCamera.update(aTimer.delta(), aWindowResolution.height());
252252
}
253253

254254

src/apps/ch10_area_lights/ch10_area_lights/main.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ int main(int argc, const char * argv[])
4949

5050
while(application.nextFrame())
5151
{
52-
application.getAppInterface()->clear();
53-
scene.step(timer, application.getAppInterface()->getWindowSize());
54-
scene.render(application.getAppInterface()->getFramebufferSize());
55-
timer.mark(glfwGetTime());
52+
if (application.getAppInterface()->isWindowOnDisplay())
53+
{
54+
application.getAppInterface()->clear();
55+
scene.step(timer, application.getAppInterface()->getWindowSize());
56+
scene.render(application.getAppInterface()->getFramebufferSize());
5657

57-
ad::imguiui::newFrame();
58-
ui.present("Root", scene);
59-
ad::imguiui::renderFrame();
58+
ad::imguiui::newFrame();
59+
ui.present("Root", scene);
60+
ad::imguiui::renderFrame();
61+
}
62+
timer.mark(glfwGetTime());
6063
}
6164
}
6265
catch(const std::exception & e)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"vertex": "shaders/Forward.vert",
2+
"vertex": "shaders/ForwardTess.vert",
33
"tes": "shaders/TessellateSphere.tes",
44
"fragment": "shaders/ch10_area_lights_Pbr.frag"
55
}

src/apps/ch10_ltc/ch10_ltc/CameraSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
namespace ad {
55

66

7-
void OrbitalCamera::update(int aWindowHeight)
7+
void OrbitalCamera::update(float aDeltaTime, int aWindowHeight)
88
{
9-
mOrbitalControl.update(mViewHeightInWorld, aWindowHeight);
9+
mOrbitalControl.update(aDeltaTime, mViewHeightInWorld, aWindowHeight);
1010
}
1111

1212

0 commit comments

Comments
 (0)