trying to a add automatic exposure

This commit is contained in:
Dynamitos
2025-03-11 22:08:23 +01:00
parent a957b05615
commit 80f86ca95c
10 changed files with 254 additions and 112 deletions
@@ -19,13 +19,31 @@ class ToneMappingPass : public RenderPass {
private:
// non-hdr swapchain output
Gfx::RenderTargetAttachment colorAttachment;
Gfx::OShaderBuffer histogramBuffer;
Gfx::OShaderBuffer luminanceBuffer;
float minLogLum = 1;
float inverseLogLumRange = 1;
float timeCoeff = 1;
uint32 numPixels;
UVector2 threadGroups;
Gfx::ODescriptorLayout histogramLayout;
Gfx::PDescriptorSet histogramSet;
Gfx::OPipelineLayout histogramPipelineLayout;
Gfx::OComputeShader histogramShader;
Gfx::PComputePipeline histogramPipeline;
Gfx::OComputeShader exposureShader;
Gfx::PComputePipeline exposurePipeline;
Gfx::RenderTargetAttachment hdrInputTexture;
Gfx::OSampler sampler;
Gfx::ODescriptorLayout layout;
Gfx::PDescriptorSet set;
Gfx::OPipelineLayout pipelineLayout;
Vector4 offset = Vector4(0.0);
Vector4 slope = Vector4(1.0);
Vector4 power = Vector4(1.0);
float sat = 1.0;
Gfx::ODescriptorLayout tonemappingLayout;
Gfx::OPipelineLayout tonemappingPipelineLayout;
Gfx::OVertexShader vert;
Gfx::OFragmentShader frag;
Gfx::PGraphicsPipeline pipeline;