Skip to content

Commit

Permalink
fix: fix "debug_hdr_bloom" console command not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Mar 27, 2023
1 parent f3744d7 commit a5ceec4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions core/client/src/console/c_cvar_glowmap.cpp
Expand Up @@ -31,5 +31,6 @@ void CMD_debug_glow_bloom(NetworkState *, pragma::BasePlayerComponent *, std::ve
return;
pEl->SetName(name);
pEl->SetSize(256, 256);
pEl->SetZPos(std::numeric_limits<int>::max());
pEl->Update();
}
1 change: 1 addition & 0 deletions core/client/src/console/c_cvar_hdr.cpp
Expand Up @@ -31,5 +31,6 @@ void CMD_debug_hdr_bloom(NetworkState *, pragma::BasePlayerComponent *, std::vec
return;
pEl->SetName(name);
pEl->SetSize(256, 256);
pEl->SetZPos(std::numeric_limits<int>::max());
pEl->Update();
}
9 changes: 6 additions & 3 deletions core/client/src/gui/debug/widebughdrbloom.cpp
Expand Up @@ -35,11 +35,14 @@ WIDebugHDRBloom::~WIDebugHDRBloom()
void WIDebugHDRBloom::UpdateBloomImage()
{
auto &drawCmd = c_engine->GetDrawCommandBuffer();
auto *scene = c_game->GetScene();
auto *renderer = scene ? dynamic_cast<pragma::CRasterizationRendererComponent *>(scene->GetRenderer()) : nullptr;
auto *scene = c_game->GetRenderScene();
auto *renderer = scene ? dynamic_cast<pragma::CRendererComponent *>(scene->GetRenderer()) : nullptr;
if(renderer == nullptr)
return;
auto &bloomTexture = renderer->GetHDRInfo().bloomBlurRenderTarget->GetTexture();
auto raster = renderer->GetEntity().GetComponent<pragma::CRasterizationRendererComponent>();
if(raster.expired())
return;
auto &bloomTexture = raster->GetHDRInfo().bloomBlurRenderTarget->GetTexture();
auto &imgSrc = bloomTexture.GetImage();
auto &imgDst = m_renderTarget->GetTexture().GetImage();

Expand Down

0 comments on commit a5ceec4

Please sign in to comment.