mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 13:09:51 +01:00
fix: remainging pen going negative
This commit is contained in:
1 parent
6f42e2835c
commit
2acee91524
1 file changed
+2
-2
@@ -60,12 +60,14 @@ void main() {
|
|||||||
float externalModuleThickness = externalModuleMaskColor.g * maxThickness;
|
float externalModuleThickness = externalModuleMaskColor.g * maxThickness;
|
||||||
remainingPenetration -= externalModuleThickness;
|
remainingPenetration -= externalModuleThickness;
|
||||||
}
|
}
|
||||||
|
remainingPenetration = max(remainingPenetration, 0.0);
|
||||||
|
|
||||||
if (isUnderSpacedArmor) {
|
if (isUnderSpacedArmor) {
|
||||||
// spaced armor on the other hand, does care about angle
|
// spaced armor on the other hand, does care about angle
|
||||||
float spacedArmorThickness = spacedArmorNominalThickness / cos(spacedArmorAngle);
|
float spacedArmorThickness = spacedArmorNominalThickness / cos(spacedArmorAngle);
|
||||||
remainingPenetration -= spacedArmorThickness;
|
remainingPenetration -= spacedArmorThickness;
|
||||||
}
|
}
|
||||||
|
remainingPenetration = max(remainingPenetration, 0.0);
|
||||||
|
|
||||||
float spacedArmorDepth = texture2D(spacedArmorDepth, screenCoordinates).r;
|
float spacedArmorDepth = texture2D(spacedArmorDepth, screenCoordinates).r;
|
||||||
float spacedArmorDistance = depthToDistance(spacedArmorDepth);
|
float spacedArmorDistance = depthToDistance(spacedArmorDepth);
|
||||||
@@ -75,8 +77,6 @@ void main() {
|
|||||||
// there is a 50% penetration loss per meter for HE based shells
|
// there is a 50% penetration loss per meter for HE based shells
|
||||||
remainingPenetration -= 0.5 * remainingPenetration * distanceFromSpacedArmor;
|
remainingPenetration -= 0.5 * remainingPenetration * distanceFromSpacedArmor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clamp to 0 because negative penetration causes guaranteed penetrations for some reason
|
|
||||||
remainingPenetration = max(remainingPenetration, 0.0);
|
remainingPenetration = max(remainingPenetration, 0.0);
|
||||||
|
|
||||||
bool coreArmorTwoCalibersRule = caliber > 2.0 * thickness;
|
bool coreArmorTwoCalibersRule = caliber > 2.0 * thickness;
|
||||||
|
|||||||
Reference in new issue
Block a user