fix: min penetration chance 0

This commit is contained in:
TrèsAbhi committed 2024-01-19 23:33:27 -06:00
1 parent 59abda933f
commit 3cd23cd718
7 files changed
+21 -42

No files matched your search

@@ -40,7 +40,6 @@ void main() {
float dotProduct = dot(normalizedNormal, -normalizedViewPosition);
float angle = acos(dotProduct);
float spacedArmorAngle = spacedArmorMaskColor.r * PI;
float penetrationChance = -1.0;
float splashChance = -1.0;
bool threeCalibersRule = caliber > 3.0 * thickness;
@@ -85,7 +84,7 @@ void main() {
} else if (delta < -randomRadius) {
penetrationChance = 1.0;
} else {
penetrationChance = 1.0 - (delta + randomRadius) / (2.0 * randomRadius);
penetrationChance = max(1.0 - (delta + randomRadius) / (2.0 * randomRadius), 0.0);
}
if (canSplash) {