mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: uhhh I forgot
This commit is contained in:
1 parent
785e9650e5
commit
dbbde066f8
5 files changed
+82
-91
No files matched your search
@@ -8,7 +8,7 @@ interface ArmorMeshProps extends MeshProps {
|
||||
isExplosive: boolean;
|
||||
canSplash: boolean;
|
||||
isSpaced: boolean;
|
||||
isArmor: boolean;
|
||||
isExternalModule?: boolean;
|
||||
thickness: number;
|
||||
penetration: number;
|
||||
caliber: number;
|
||||
@@ -20,7 +20,7 @@ export function ArmorMesh({
|
||||
isExplosive,
|
||||
canSplash,
|
||||
isSpaced,
|
||||
isArmor,
|
||||
isExternalModule = false,
|
||||
thickness,
|
||||
penetration,
|
||||
caliber,
|
||||
@@ -36,7 +36,7 @@ export function ArmorMesh({
|
||||
</mesh>
|
||||
)}
|
||||
|
||||
<mesh {...props} renderOrder={1}>
|
||||
<mesh {...props}>
|
||||
<CustomShaderMaterial
|
||||
silent
|
||||
baseMaterial={MeshStandardMaterial}
|
||||
@@ -48,7 +48,7 @@ export function ArmorMesh({
|
||||
isExplosive: { value: isExplosive },
|
||||
canSplash: { value: canSplash },
|
||||
isSpaced: { value: isSpaced },
|
||||
isArmor: { value: isArmor },
|
||||
isExternalModule: { value: isExternalModule },
|
||||
thickness: { value: thickness },
|
||||
penetration: { value: penetration },
|
||||
caliber: { value: caliber },
|
||||
|
||||
@@ -4,7 +4,7 @@ varying vec3 vCSMViewPosition;
|
||||
uniform bool isExplosive;
|
||||
uniform bool canSplash;
|
||||
uniform bool isSpaced;
|
||||
uniform bool isArmor;
|
||||
uniform bool isExternalModule;
|
||||
uniform float thickness;
|
||||
uniform float penetration;
|
||||
uniform float caliber;
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
float splashChance = -1.0;
|
||||
bool threeCalibersRule = caliber > 3.0 * thickness;
|
||||
|
||||
if (isArmor && !isExplosive && !threeCalibersRule && angle >= ricochet) {
|
||||
if (!isExternalModule && !isExplosive && !threeCalibersRule && angle >= ricochet) {
|
||||
penetrationChance = 0.0;
|
||||
splashChance = 0.0;
|
||||
} else {
|
||||
@@ -56,14 +56,14 @@ void main() {
|
||||
}
|
||||
|
||||
if (isSpaced) {
|
||||
if (isArmor) {
|
||||
if (isExternalModule) {
|
||||
csm_FragColor = vec4(0.5, 0.0, 1.0, 0.5);
|
||||
} else {
|
||||
if (isExplosive) {
|
||||
csm_FragColor = vec4(1.0, 0.0, 1.0, 0.5);
|
||||
} else {
|
||||
csm_FragColor = vec4(1.0, 0.0, 1.0, (1.0 - penetrationChance) * 0.5);
|
||||
}
|
||||
} else {
|
||||
csm_FragColor = vec4(0.5, 0.0, 1.0, 0.5);
|
||||
}
|
||||
} else {
|
||||
csm_FragColor = vec4(1.0, splashChance * 0.392, 0.0, (1.0 - penetrationChance) * 0.5);
|
||||
|
||||
Reference in new issue
Block a user