add compute shader to auto calculate screen exposure, add SSBO impl

This commit is contained in:
2026-03-12 23:42:52 +08:00
parent 8ba00467fd
commit 5cb9b04ab0
16 changed files with 511 additions and 199 deletions

View File

@ -23,7 +23,14 @@ in vec2 v_TexCoord;
uniform sampler2DMS u_Texture;
uniform float u_Exposure;
uniform bool u_EnableAutoExposure;
uniform float u_ManualExposure;
layout(std430, binding = 2) buffer Exposure
{
float u_Exposure;
};
uniform int u_TextureSamples;
uniform bool u_EnableBloom;
@ -64,7 +71,10 @@ void main()
color += bloomColor;
}
color *= u_Exposure;
if(u_EnableAutoExposure)
color *= u_Exposure;
else
color *= u_ManualExposure;
// Reinhard tonemapping operator.
// see: "Photographic Tone Reproduction for Digital Images", eq. 4