fix: removed z-fighting

This commit is contained in:
TrèsAbhi committed 2024-01-22 19:38:45 -06:00
1 parent 7b6e291a0a
commit b47e6436e7
3 files changed
+5 -6

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ export default function Page({ params }: { params: { id: string } }) {
mutateTankopediaTemporary((draft) => {
draft.model.pose.yaw = 0;
draft.model.pose.pitch = 0;
draft.mode = 'model';
draft.mode = 'armor';
});
function handleKeyDown(event: KeyboardEvent) {
@@ -143,11 +143,11 @@ export function ArmorMesh({
explosionRadius: { value: initialShell.explosionRadius ?? 0 },
}}
/>
<meshBasicMaterial
{/* <meshBasicMaterial
transparent
color="#ff0000"
opacity={Math.random()}
/>
/> */}
</mesh>
</>
);
@@ -1,14 +1,13 @@
varying vec3 vNormal;
varying vec3 vViewPosition;
varying float vZ;
varying mat4 vProjectionMatrix;
void main() {
vec4 vViewPosition4 = modelViewMatrix * vec4(position, 1.0);
vViewPosition = vViewPosition4.xyz;
vZ = -(modelViewMatrix * vec4(position, 1.0)).z;
vProjectionMatrix = projectionMatrix;
vNormal = normalMatrix * normal;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
gl_Position = projectionMatrix * vViewPosition4;
}