Skip to content

Commit 00ea683

Browse files
committed
basic gamma correction
1 parent c1d7eef commit 00ea683

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/engine/shaders/basic.ps.hlsl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ PS_OUTPUT main(BASIC_PS_INPUT input)
5353
// cook-torrance microfacet model
5454
float3 specular = fresnel * normalDistribution * visibility;
5555

56-
output.color = float4(diffuse + specular, 1.0);
56+
float3 color = diffuse + specular;
57+
58+
// gamma correction
59+
color = sqrt(color);
60+
61+
output.color = float4(color, 1.0);
5762

5863
return output;
5964
}

0 commit comments

Comments
 (0)