Fog in ubershader

This commit is contained in:
offtkp 2024-07-21 03:16:15 +03:00
parent a6e3d41628
commit 4176a19256
9 changed files with 110 additions and 20 deletions

View file

@ -92,6 +92,9 @@ class GPU {
// Set to false by the renderer when the lighting_lut is uploaded ot the GPU
bool lightingLUTDirty = false;
std::array<uint32_t, 128> fogLUT;
bool fogLUTDirty = false;
GPU(Memory& mem, EmulatorConfig& config);
void display() { renderer->display(); }
void screenshot(const std::string& name) { renderer->screenshot(name); }

View file

@ -51,6 +51,18 @@ namespace PICA {
#undef defineTexEnv
// clang-format on
// Fog registers
FogColor = 0xE1,
FogLUTIndex = 0xE6,
FogLUTData0 = 0xE8,
FogLUTData1 = 0xE9,
FogLUTData2 = 0xEA,
FogLUTData3 = 0xEB,
FogLUTData4 = 0xEC,
FogLUTData5 = 0xED,
FogLUTData6 = 0xEE,
FogLUTData7 = 0xEF,
// Framebuffer registers
ColourOperation = 0x100,
BlendFunc = 0x101,

View file

@ -63,7 +63,7 @@ class RendererGL final : public Renderer {
OpenGL::VertexBuffer dummyVBO;
OpenGL::Texture screenTexture;
OpenGL::Texture lightLUTTexture;
OpenGL::Texture LUTTexture;
OpenGL::Framebuffer screenFramebuffer;
OpenGL::Texture blankTexture;
// The "default" vertex shader to use when using specialized shaders but not PICA vertex shader -> GLSL recompilation
@ -90,6 +90,7 @@ class RendererGL final : public Renderer {
void setupUbershaderTexEnv();
void bindTexturesToSlots();
void updateLightingLUT();
void updateFogLUT();
void initGraphicsContextInternal();
public: