Terrible postprocessing and start of Editor GUI for lights

This commit is contained in:
Simon Lübeß
2022-05-11 22:49:36 +02:00
parent 56e92a7d67
commit b1a1268319
7 changed files with 166 additions and 56 deletions
@@ -0,0 +1,37 @@
Texture2D CameraTarget : register(t0);
SamplerState CameraTargetSampler : register(s0);
struct VS_IN
{
float2 Position : POSITION;
float2 TexCoord : TEXCOORD0;
};
struct PS_IN
{
float4 Position : SV_POSITION;
float2 TexCoord : TEXCOORD;
};
PS_IN VS(VS_IN input)
{
PS_IN output;
output.Position = float4(input.Position, 0, 1);
output.TexCoord = input.TexCoord;
return output;
}
float4 PS(PS_IN input) : SV_TARGET
{
float4 rawColor = CameraTarget.Sample(CameraTargetSampler, input.TexCoord);
float3 color = rawColor.rgb / (rawColor.rgb + 1.0f);
color = pow(color, 1.0f / 2.2f);
return float4(color, 1);
}
#effect[VS = VS, PS = PS]
+2 -10
View File
@@ -108,16 +108,8 @@ float4 PS(PS_IN input) : SV_TARGET
float3 luminanceColor = LightColor * Illuminance;
float3 cook = (kd * diffuse + specular) * luminanceColor * n_dot_l;
float3 final = cook;
// Tone mapping // TODO: do in postprocessing
final = final / (final + 1.0f);
// Gamma correction // TODO: do in postprocessing/hardware
final = pow(final, 1.0f / 2.2f);
float3 final = (kd * diffuse + specular) * luminanceColor * n_dot_l;
#if OUTPUT == Inspect_NormalDistribution
final = max(final - 10000000, nrmDist.xxx);
#elif OUTPUT == Inspect_GeometryFunction