|
@@ -15,6 +15,9 @@ mixin SurfaceData
|
|
|
#if MSAA_COUNT > 1
|
|
#if MSAA_COUNT > 1
|
|
|
bool needsPerSampleShading(SurfaceData samples[MSAA_COUNT])
|
|
bool needsPerSampleShading(SurfaceData samples[MSAA_COUNT])
|
|
|
{
|
|
{
|
|
|
|
|
+ // Always shade all samples, otherwise there is visible aliasing. It could be enabled if HDR is not used.
|
|
|
|
|
+ return true;
|
|
|
|
|
+
|
|
|
float3 albedo = samples[0].albedo.xyz;
|
|
float3 albedo = samples[0].albedo.xyz;
|
|
|
float3 normal = samples[0].worldNormal.xyz;
|
|
float3 normal = samples[0].worldNormal.xyz;
|
|
|
float depth = samples[0].depth;
|
|
float depth = samples[0].depth;
|
|
@@ -27,7 +30,7 @@ mixin SurfaceData
|
|
|
float otherDepth = samples[i].depth;
|
|
float otherDepth = samples[i].depth;
|
|
|
|
|
|
|
|
[branch]
|
|
[branch]
|
|
|
- if(abs(depth - otherDepth) > 0.1f || abs(dot(abs(normal - otherNormal), float3(1, 1, 1))) > 0.1f || abs(dot(albedo - otherAlbedo, float3(1, 1, 1))) > 0.1f)
|
|
|
|
|
|
|
+ if((abs(depth - otherDepth) > 0.01f) || (dot(normal, otherNormal) < 0.99f) || (abs(dot(albedo - otherAlbedo, float3(1, 1, 1))) > 0.01f))
|
|
|
{
|
|
{
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|