Fix gamma slider via pixel shader #178 (#481)

* Fix gamma slider via pixel shader #178

* LCE-like gamma using postprocess shader
This commit is contained in:
ModMaker101
2026-03-05 14:41:17 -05:00
committed by GitHub
parent 55231bb8d3
commit cbcf3de358
8 changed files with 800 additions and 109 deletions

View File

@@ -1,4 +1,9 @@
#pragma once
#ifdef _WIN64
#include <d3d11.h>
#endif
class Minecraft;
class Entity;
class Random;
@@ -72,6 +77,14 @@ private:
float darkenWorldAmount;
float darkenWorldAmountO;
// Gamma caching
float m_cachedGammaPerPlayer[NUM_LIGHT_TEXTURES];
static float ComputeGammaFromSlider(float slider0to100);
void CachePlayerGammas();
void ApplyGammaPostProcess() const;
bool ComputeViewportForPlayer(int j, D3D11_VIEWPORT& outViewport) const;
uint32_t BuildPlayerViewports(D3D11_VIEWPORT* outViewports, float* outGammas, UINT maxCount) const;
bool isInClouds;
float m_fov;