Skip to content

Commit

Permalink
Add replay renderer flag to enable ambient occlusion. (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
0mdc authored Oct 2, 2023
1 parent 30f4cc7 commit c5f38b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/esp/bindings/SimBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ void initSimBindings(py::module& m) {
.def_readwrite("enable_frustum_culling",
&ReplayRendererConfiguration::enableFrustumCulling,
R"(Controls whether frustum culling is enabled.)")
.def_readwrite(
"enable_hbao", &ReplayRendererConfiguration::enableHBAO,
R"(Controls whether horizon-based ambient occlusion is enabled.)")
.def_readwrite(
"force_separate_semantic_scene_graph",
&ReplayRendererConfiguration::forceSeparateSemanticSceneGraph,
Expand Down
2 changes: 2 additions & 0 deletions src/esp/sim/AbstractReplayRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class ReplayRendererConfiguration {

bool enableFrustumCulling = true;

bool enableHBAO = false;

std::vector<std::shared_ptr<sensor::SensorSpec>> sensorSpecifications;

ESP_SMART_POINTERS(ReplayRendererConfiguration)
Expand Down
4 changes: 4 additions & 0 deletions src/esp/sim/ClassicReplayRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ ClassicReplayRenderer::ClassicReplayRenderer(
}

gfx::Renderer::Flags flags;

if (config_.enableHBAO)
flags |= gfx::Renderer::Flag::HorizonBasedAmbientOcclusion;

#ifdef ESP_BUILD_WITH_BACKGROUND_RENDERER
if (context_)
flags |= gfx::Renderer::Flag::BackgroundRenderer;
Expand Down

0 comments on commit c5f38b3

Please sign in to comment.