Skip to content

Commit

Permalink
feat(engine): make bloom toggleable with settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 10, 2023
1 parent f77a547 commit 7581753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions engine/include/cubos/engine/renderer/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace cubos::engine
///
/// ## Settings
/// - `cubos.renderer.ssao.enabled` - whether SSAO is enabled.
/// - `cubos.renderer.bloom.enabled` - whether bloom is enabled.
///
/// ## Resources
/// - @ref Renderer - handle to the renderer.
Expand Down
6 changes: 5 additions & 1 deletion engine/src/cubos/engine/renderer/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ static void init(Write<Renderer> renderer, Read<Window> window, Write<Settings>
{
auto& renderDevice = (*window)->renderDevice();
*renderer = std::make_shared<DeferredRenderer>(renderDevice, (*window)->framebufferSize(), *settings);
(*renderer)->pps().addPass<PostProcessingBloom>();

if (settings->getBool("cubos.renderer.bloom.enabled", false))
{
(*renderer)->pps().addPass<PostProcessingBloom>();
}
}

static void resize(Write<Renderer> renderer, EventReader<WindowEvent> evs)
Expand Down

0 comments on commit 7581753

Please sign in to comment.