Skip to content

Commit

Permalink
Client: Disable old Bloom filter with Gloom
Browse files Browse the repository at this point in the history
Gloom has its own HDR bloom pass.
  • Loading branch information
skyjake committed Feb 14, 2020
1 parent 8d78762 commit 8ef666f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions doomsday/apps/client/include/clientapp.h
Expand Up @@ -106,6 +106,7 @@ class ClientApp : public de::BaseGuiApp, public DoomsdayApp
static bool hasInput();
static bool hasRender();
static bool hasAudio();
static bool hasClassicWorld();

#if defined (DE_HAVE_UPDATER)
static Updater &updater();
Expand Down
5 changes: 5 additions & 0 deletions doomsday/apps/client/src/clientapp.cpp
Expand Up @@ -1045,6 +1045,11 @@ bool ClientApp::hasAudio()
return ClientApp::app().d->audioSys != nullptr;
}

bool ClientApp::hasClassicWorld()
{
return ClientApp::app().d->classicWorld != nullptr;
}

ClientResources &ClientApp::resources()
{
ClientApp &a = ClientApp::app();
Expand Down
20 changes: 13 additions & 7 deletions doomsday/apps/client/src/render/cameralensfx.cpp
Expand Up @@ -62,17 +62,21 @@ using namespace de;

static int fxFramePlayerNum; ///< Player view currently being drawn.

#define IDX_LENS_FLARES 2
//#define IDX_LENS_FLARES 2

void LensFx_Init()
{
for (int i = 0; i < DDMAXPLAYERS; ++i)
{
ConsoleEffectStack &stack = DD_Player(i)->fxStack();
stack.effects
<< new fx::Bloom(i)
<< new fx::Vignette(i)
<< new fx::LensFlares(i) // IDX_LENS_FLARES

if (ClientApp::hasClassicWorld()) // Gloom does its own HDR bloom.
{
stack.effects << new fx::Bloom(i);
}

stack.effects << new fx::Vignette(i)
// << new fx::LensFlares(i) // IDX_LENS_FLARES
<< new fx::ColorFilter(i)
<< new fx::Ramp(i);
}
Expand Down Expand Up @@ -140,18 +144,20 @@ void LensFx_Draw(int playerNum)
effect->draw();
}

for (int i = effects.size() - 1; i >= 0; --i)
for (int i = effects.sizei() - 1; i >= 0; --i)
{
effects.at(i)->endFrame();
}

GLState::pop();
}

void LensFx_MarkLightVisibleInFrame(const IPointLightSource &lightSource)
void LensFx_MarkLightVisibleInFrame(const IPointLightSource &/*lightSource*/)
{
/*
const auto &effects = DD_Player(fxFramePlayerNum)->fxStack().effects;
static_cast<fx::LensFlares *>(effects.at(IDX_LENS_FLARES))->
markLightPotentiallyVisibleForCurrentFrame(&lightSource);
*/
}
10 changes: 4 additions & 6 deletions doomsday/apps/client/src/render/fx/vignette.cpp
Expand Up @@ -104,14 +104,12 @@ Vignette::Vignette(int console) : ConsoleEffect(console)

void Vignette::draw()
{
if (!ClientApp::world().hasMap())
if (ClientApp::world().hasMap())
{
return;
}

/// @todo Field of view should be console-specific.
/// @todo Field of view should be console-specific.

Vignette_Render(viewRect(), Rend_FieldOfView());
Vignette_Render(viewRect(), Rend_FieldOfView());
}
}

void Vignette::consoleRegister()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/render/rendersystem.cpp
Expand Up @@ -238,7 +238,7 @@ DE_PIMPL(RenderSystem)

// Load the required packages.
pkgLoader.load("net.dengine.client.renderer");
pkgLoader.load("net.dengine.client.renderer.lensflares");
// pkgLoader.load("net.dengine.client.renderer.lensflares");
pkgLoader.load("net.dengine.gloom");

loadImages();
Expand Down
1 change: 1 addition & 0 deletions doomsday/libs/gloom/src/world.cpp
Expand Up @@ -393,6 +393,7 @@ void World::render(const ICamera &camera)

if (d->renderContext.uDebugMode.toInt() != 0)
{
d->debugQuad.state().setTarget(GLState::current().target());
d->debugQuad.render();
}

Expand Down

0 comments on commit 8ef666f

Please sign in to comment.