ソースを参照

Always enable per-sample lighting with MSAA, as it is causing visible aliasing otherwise

BearishSun 8 年 前
コミット
27251d2837
1 ファイル変更4 行追加1 行削除
  1. 4 1
      Data/Raw/Engine/Includes/SurfaceData.bslinc

+ 4 - 1
Data/Raw/Engine/Includes/SurfaceData.bslinc

@@ -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;
 				}
 				}