Skip to content

Commit

Permalink
Fixed autoexposure and median shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Jun 29, 2024
1 parent 06268bb commit 0bfcb05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions shaders/cAutoExposure.fx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ float4 PS_Blit(VS2PS_Quad Input) : SV_TARGET0
float3 PS_Exposure(VS2PS_Quad Input) : SV_TARGET0
{
float4 Color = tex2D(CShade_SampleColorTex, Input.Tex0);
float Luma = tex2Dlod(SampleLumaTex, float4(Tex, 0.0, 99.0)).r;
float3 ExposedColor = ApplyAutoExposure(Color.rgb, Luma, _ManualBias);
float Luma = tex2Dlod(SampleLumaTex, float4(Input.Tex0, 0.0, 99.0)).r;
float3 ExposedColor = ApplyAutoExposure(Color.rgb, Luma);

if (_Debug)
{
// Unpack screen coordinates
float2 Pos = (Expand(Input.Tex0) - float2(_Offset.x, -_Offset.y)) * BUFFER_SIZE_0;
float2 Pos = (Input.Tex0 * 2.0) - 1.0;
Pos = (Pos - float2(_Offset.x, -_Offset.y)) * BUFFER_SIZE_0;
float Factor = BUFFER_SIZE_0.y * _Scale;

// Create the needed mask
Expand Down
2 changes: 1 addition & 1 deletion shaders/cMedian.fx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ float4 Med9(float4 X0, float4 X1, float4 X2,
return Med3(A, B, C);
}

float4 PS_Median(VS2PS_Median Input) : SV_TARGET0
float4 PS_Median(VS2PS_Quad Input) : SV_TARGET0
{
float2 PixelSize = fwidth(Input.Tex0.xy);
float4 Tex0 = Input.Tex0.xyyy + (float4(-1.0, 1.0, 0.0, -1.0) * PixelSize.xyyy);
Expand Down
2 changes: 1 addition & 1 deletion shaders/shared/cTonemap.fxh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
ui_tooltip = "Select a tonemap operator for the output";
ui_type = "combo";
ui_items = "None\0Reinhard\0DirectX Graphics Tonemap\0ACES Filmic Approximation\0";
> = 1;
> = 2;

float3 ApplyTonemap(float3 HDR)
{
Expand Down

0 comments on commit 0bfcb05

Please sign in to comment.