fix: spaced armor bleeding

This commit is contained in:
TrèsAbhi committed 2024-01-20 12:08:30 -06:00
1 parent 871b746cce
commit 86fd714923
2 files changed
+13 -7

No files matched your search

@@ -10,6 +10,7 @@ type ArmorMeshSpacedArmorDepthProps = MeshProps &
(
| {
include?: false;
isExternalModule: boolean;
}
| {
include: true;
@@ -23,8 +24,14 @@ export function ArmorMeshSpacedArmorDepth(
) {
return (
<>
{!props.include && (
<mesh {...props} renderOrder={props.isExternalModule ? 2 : 0}>
<meshBasicMaterial colorWrite={false} />
</mesh>
)}
{props.include && (
<mesh {...props} renderOrder={0}>
<mesh {...props} renderOrder={1}>
<ThreeCustomShaderMaterial
silent
depthWrite={false}
@@ -38,12 +45,6 @@ export function ArmorMeshSpacedArmorDepth(
/>
</mesh>
)}
{!props.include && (
<mesh {...props} renderOrder={1}>
<meshBasicMaterial colorWrite={false} />
</mesh>
)}
</>
);
}