mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
- removed backend dependencies on game data.
This commit is contained in:
parent
c8b3d95d6f
commit
bafd6be342
6 changed files with 35 additions and 27 deletions
|
@ -4,6 +4,15 @@
|
|||
|
||||
struct HWDrawInfo;
|
||||
|
||||
enum class ELightBlendMode : uint8_t
|
||||
{
|
||||
CLAMP = 0,
|
||||
CLAMP_COLOR = 1,
|
||||
NOCLAMP = 2,
|
||||
|
||||
DEFAULT = CLAMP,
|
||||
};
|
||||
|
||||
struct HWViewpointUniforms
|
||||
{
|
||||
VSMatrix mProjectionMatrix;
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
|
||||
#include "stats.h"
|
||||
|
||||
#include "g_levellocals.h"
|
||||
|
||||
Postprocess hw_postprocess;
|
||||
|
||||
PPResource *PPResource::First = nullptr;
|
||||
|
@ -601,9 +599,9 @@ void PPTonemap::UpdateTextures()
|
|||
|
||||
void PPTonemap::Render(PPRenderState *renderstate)
|
||||
{
|
||||
ETonemapMode level_tonemap = (level.info && level.info->tonemap != ETonemapMode::None) ? level.info->tonemap : ETonemapMode((int)gl_tonemap);
|
||||
ETonemapMode current_tonemap = (level_tonemap != ETonemapMode::None) ? level_tonemap : ETonemapMode((int)gl_tonemap);
|
||||
|
||||
if (level_tonemap == ETonemapMode::None)
|
||||
if (current_tonemap == ETonemapMode::None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -611,7 +609,7 @@ void PPTonemap::Render(PPRenderState *renderstate)
|
|||
UpdateTextures();
|
||||
|
||||
PPShader *shader = nullptr;
|
||||
switch (level_tonemap)
|
||||
switch (current_tonemap)
|
||||
{
|
||||
default:
|
||||
case ETonemapMode::Linear: shader = &LinearShader; break;
|
||||
|
@ -627,7 +625,7 @@ void PPTonemap::Render(PPRenderState *renderstate)
|
|||
renderstate->Shader = shader;
|
||||
renderstate->Viewport = screen->mScreenViewport;
|
||||
renderstate->SetInputCurrent(0);
|
||||
if (level_tonemap == ETonemapMode::Palette)
|
||||
if (current_tonemap == ETonemapMode::Palette)
|
||||
renderstate->SetInputTexture(1, &PaletteTexture);
|
||||
renderstate->SetOutputNext();
|
||||
renderstate->SetNoBlend();
|
||||
|
|
|
@ -13,6 +13,19 @@ typedef IntRect PPViewport;
|
|||
class PPTexture;
|
||||
class PPShader;
|
||||
|
||||
enum class ETonemapMode : uint8_t
|
||||
{
|
||||
None,
|
||||
Uncharted2,
|
||||
HejlDawson,
|
||||
Reinhard,
|
||||
Linear,
|
||||
Palette,
|
||||
NumTonemapModes
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum class PPFilterMode { Nearest, Linear };
|
||||
enum class PPWrapMode { Clamp, Repeat };
|
||||
enum class PPTextureType { CurrentPipelineTexture, NextPipelineTexture, PPTexture, SceneColor, SceneFog, SceneNormal, SceneDepth, SwapChain, ShadowMap };
|
||||
|
@ -541,6 +554,7 @@ private:
|
|||
class PPTonemap
|
||||
{
|
||||
public:
|
||||
void SetTonemapMode(ETonemapMode tm) { level_tonemap = tm; }
|
||||
void Render(PPRenderState *renderstate);
|
||||
void ClearTonemapPalette() { PaletteTexture = {}; }
|
||||
|
||||
|
@ -554,7 +568,7 @@ private:
|
|||
PPShader HejlDawsonShader = { "shaders/pp/tonemap.fp", "#define HEJLDAWSON\n", {} };
|
||||
PPShader Uncharted2Shader = { "shaders/pp/tonemap.fp", "#define UNCHARTED2\n", {} };
|
||||
PPShader PaletteShader = { "shaders/pp/tonemap.fp", "#define PALETTE\n", {} };
|
||||
|
||||
ETonemapMode level_tonemap = ETonemapMode::None;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -830,8 +844,11 @@ public:
|
|||
PPCustomShaders customShaders;
|
||||
|
||||
|
||||
void SetTonemapMode(ETonemapMode tm) { tonemap.SetTonemapMode(tm); }
|
||||
void Pass1(PPRenderState *state, int fixedcm, int sceneWidth, int sceneHeight);
|
||||
void Pass2(PPRenderState* state, int fixedcm, float flash, int sceneWidth, int sceneHeight);
|
||||
};
|
||||
|
||||
|
||||
extern Postprocess hw_postprocess;
|
||||
|
||||
|
|
|
@ -53,24 +53,4 @@ enum class ELightMode : int8_t
|
|||
DoomSoftware = 16
|
||||
};
|
||||
|
||||
enum class ELightBlendMode : uint8_t
|
||||
{
|
||||
CLAMP = 0,
|
||||
CLAMP_COLOR = 1,
|
||||
NOCLAMP = 2,
|
||||
|
||||
DEFAULT = CLAMP,
|
||||
};
|
||||
|
||||
enum class ETonemapMode : uint8_t
|
||||
{
|
||||
None,
|
||||
Uncharted2,
|
||||
HejlDawson,
|
||||
Reinhard,
|
||||
Linear,
|
||||
Palette,
|
||||
NumTonemapModes
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
#include "sc_man.h"
|
||||
#include "file_zip.h"
|
||||
#include "screenjob.h"
|
||||
#include "hwrenderer/postprocessing/hw_postprocess.h"
|
||||
#include "hw_viewpointuniforms.h"
|
||||
|
||||
struct level_info_t;
|
||||
struct cluster_info_t;
|
||||
|
|
|
@ -273,6 +273,7 @@ void WriteSavePic(player_t* player, FileWriter* file, int width, int height)
|
|||
screen->SetSaveBuffers(true);
|
||||
screen->ImageTransitionScene(true);
|
||||
|
||||
hw_postprocess.SetTonemapMode(level.info ? level.info->tonemap : ETonemapMode::None);
|
||||
hw_ClearFakeFlat();
|
||||
screen->mVertexData->Reset();
|
||||
RenderState.SetVertexBuffer(screen->mVertexData);
|
||||
|
@ -317,6 +318,7 @@ sector_t* RenderView(player_t* player)
|
|||
auto RenderState = screen->RenderState();
|
||||
RenderState->SetVertexBuffer(screen->mVertexData);
|
||||
screen->mVertexData->Reset();
|
||||
hw_postprocess.SetTonemapMode(level.info ? level.info->tonemap : ETonemapMode::None);
|
||||
|
||||
sector_t* retsec;
|
||||
if (!V_IsHardwareRenderer())
|
||||
|
|
Loading…
Reference in a new issue