fix: reintroduce some frame invalidations

This commit is contained in:
tresabhi committed 2024-11-10 22:19:05 -06:00
1 parent b893409a0a
commit e68b4bea5d
8 files changed
+5 -27

No files matched your search

@@ -85,8 +85,6 @@ export function PrimaryArmorSceneComponent({
true,
);
// console.log('handleShellChange');
invalidate();
}
function handleGreenPenetrationChange(greenPenetration: boolean) {
@@ -94,8 +92,6 @@ export function PrimaryArmorSceneComponent({
}
function handleOpaqueChange(opaque: boolean) {
material.uniforms.opaque.value = opaque;
// invalidate();
}
function handleWireframeChange(wireframe: boolean) {
material.wireframe = wireframe;
@@ -185,8 +181,6 @@ export function PrimaryArmorSceneComponent({
spacedArmorRenderTarget.depthTexture;
material.uniforms.inverseProjectionMatrix.value =
camera.projectionMatrixInverse;
// invalidate();
});
return (
@@ -1,7 +1,7 @@
import { J_HAT, K_HAT } from '@blitzkit/core';
import { Box, Flex, Text } from '@radix-ui/themes';
import { Html } from '@react-three/drei';
import { useFrame } from '@react-three/fiber';
import { invalidate, useFrame } from '@react-three/fiber';
import { clamp } from 'lodash-es';
import { useEffect, useRef, type ComponentProps } from 'react';
import {
@@ -105,7 +105,7 @@ export function ShotDisplay() {
outTracer.current.position.set(0, tracerT2 * outLength, 0);
}
// invalidate();
invalidate();
}
if (
@@ -122,7 +122,7 @@ export function ShotDisplay() {
splashRadiusWrapper.current.scale.set(scale, scale, scale);
splashRadiusMaterial.current.opacity = opacity;
// invalidate();
invalidate();
}
});
@@ -53,7 +53,6 @@ export function SpacedArmorSubExternal({
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
material.uniforms.penetration.value = shell.penetration.near;
// invalidate();
}
async function handleProtagonistEquipmentChange(
equipment: EquipmentMatrix,
@@ -67,8 +66,6 @@ export function SpacedArmorSubExternal({
material.uniforms.thickness.value = hasEnhancedArmor
? thickness * 1.03
: thickness;
// invalidate();
}
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();
@@ -84,8 +81,6 @@ export function SpacedArmorSubExternal({
material.uniforms.penetration.value =
penetration *
resolvePenetrationCoefficient(hasCalibratedShells, shell.type);
// invalidate();
}
handleShellChange();
@@ -63,8 +63,6 @@ export function SpacedArmorSubSpaced({
material.uniforms.normalization.value = degToRad(
shell.normalization ?? 0,
);
// invalidate();
}
async function handleProtagonistEquipmentChange(
equipment: EquipmentMatrix,
@@ -78,8 +76,6 @@ export function SpacedArmorSubSpaced({
material.uniforms.thickness.value = hasEnhancedArmor
? thickness * 1.03
: thickness;
// invalidate();
}
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();