mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- Add new "scene" target for custom postprocess shaders
- Add "gl_custompost" cvar to turn off custom postprocess shaders completely - Made "scene" affect the screen before 2D drawing, made "screen" affect the entire screen after 2D drawing
This commit is contained in:
parent
e161bba146
commit
1cfaae78d9
1 changed files with 8 additions and 1 deletions
|
@ -147,6 +147,8 @@ CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CVAR(Bool, gl_custompost, true, 0)
|
||||||
|
|
||||||
EXTERN_CVAR(Float, vid_brightness)
|
EXTERN_CVAR(Float, vid_brightness)
|
||||||
EXTERN_CVAR(Float, vid_contrast)
|
EXTERN_CVAR(Float, vid_contrast)
|
||||||
|
|
||||||
|
@ -175,7 +177,7 @@ void FGLRenderer::PostProcessScene(int fixedcm)
|
||||||
ColormapScene(fixedcm);
|
ColormapScene(fixedcm);
|
||||||
LensDistortScene();
|
LensDistortScene();
|
||||||
ApplyFXAA();
|
ApplyFXAA();
|
||||||
RunCustomPostProcessShaders("screen");
|
RunCustomPostProcessShaders("scene");
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
|
@ -214,6 +216,9 @@ DEFINE_ACTION_FUNCTION(_Shader, SetUniform1i)
|
||||||
|
|
||||||
void FGLRenderer::RunCustomPostProcessShaders(FString target)
|
void FGLRenderer::RunCustomPostProcessShaders(FString target)
|
||||||
{
|
{
|
||||||
|
if (!gl_custompost)
|
||||||
|
return;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < PostProcessShaders.Size(); i++)
|
for (unsigned int i = 0; i < PostProcessShaders.Size(); i++)
|
||||||
{
|
{
|
||||||
PostProcessShader &shader = PostProcessShaders[i];
|
PostProcessShader &shader = PostProcessShaders[i];
|
||||||
|
@ -864,6 +869,8 @@ void FGLRenderer::CopyToBackbuffer(const GL_IRECT *bounds, bool applyGamma)
|
||||||
m2DDrawer->Draw(); // draw all pending 2D stuff before copying the buffer
|
m2DDrawer->Draw(); // draw all pending 2D stuff before copying the buffer
|
||||||
m2DDrawer->Clear();
|
m2DDrawer->Clear();
|
||||||
|
|
||||||
|
RunCustomPostProcessShaders("screen");
|
||||||
|
|
||||||
FGLDebug::PushGroup("CopyToBackbuffer");
|
FGLDebug::PushGroup("CopyToBackbuffer");
|
||||||
if (FGLRenderBuffers::IsEnabled())
|
if (FGLRenderBuffers::IsEnabled())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue