Skip to content

Commit

Permalink
Update cAutoExposure.fx
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Jul 9, 2024
1 parent bca8500 commit e5eac55
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions shaders/cAutoExposure.fx
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,21 @@ float3 PS_Exposure(VS2PS_Quad Input) : SV_TARGET0
LumaTex.y *= ASPECT_RATIO;
#endif

// Get luma masks
// Create luma masks
float LumaTexLength = length(LumaTex);
float LumaTexMask = GetAntiAliasShape(LumaTexLength, 0.05);
float ShadowMask = smoothstep(0.1, 0.0, LumaTexLength);

// Composite the drop-shadow into the output
Output = lerp(Output, 0.0, ShadowMask);
// Create LumaIcon through alpha compositing
float4 LumaIcon = 0.0;
float4 Shadow = float4(0.0, 0.0, 0.0, 1.0);
float4 ExpLuma = float4((float3)exp(Luma), 1.0);

// Composite the masked luma into the output
Output = lerp(exp(Luma), Output, LumaTexMask);
LumaIcon = lerp(LumaIcon, Shadow, ShadowMask);
LumaIcon = lerp(ExpLuma, LumaIcon, LumaTexMask);

// Composite LumaIcon into Output
Output = lerp(Output, LumaIcon.rgb, LumaIcon.a);
}

return Output;
Expand Down

0 comments on commit e5eac55

Please sign in to comment.