Browse Source

Preventing rare pixel holes between triangles in dense models.

David Piuva 5 years ago
parent
commit
2963423b83
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/SDK/SpriteEngine/spriteAPI.cpp

+ 1 - 1
Source/SDK/SpriteEngine/spriteAPI.cpp

@@ -1248,7 +1248,7 @@ static IRect renderDenseModel(const DenseModel& model, OrthoView view, ImageF32
 					FVector2D weightBC = offsetToWeight.transform(FVector2D(x + 0.5f, y + 0.5f) - cornerA);
 					FVector2D weightBC = offsetToWeight.transform(FVector2D(x + 0.5f, y + 0.5f) - cornerA);
 					FVector3D weight = FVector3D(1.0f - (weightBC.x + weightBC.y), weightBC.x, weightBC.y);
 					FVector3D weight = FVector3D(1.0f - (weightBC.x + weightBC.y), weightBC.x, weightBC.y);
 					// Check if the pixel is inside the triangle
 					// Check if the pixel is inside the triangle
-					if (weight.x >= 0.0f && weight.y >= 0.0f && weight.z >= 0.0f ) {
+					if (weight.x >= -0.00001f && weight.y >= -0.00001f && weight.z >= -0.00001f ) {
 						float height = interpolateUsingAffineWeight(projectedA.z, projectedB.z, projectedC.z, weight);
 						float height = interpolateUsingAffineWeight(projectedA.z, projectedB.z, projectedC.z, weight);
 						if (height > *heightPixel) {
 						if (height > *heightPixel) {
 							FVector3D vertexColor = interpolateUsingAffineWeight(triangle.colorA, triangle.colorB, triangle.colorC, weight);
 							FVector3D vertexColor = interpolateUsingAffineWeight(triangle.colorA, triangle.colorB, triangle.colorC, weight);