Add theme settings, and remove the old theme system

This commit is contained in:
tyuXX 2026-11-15 20:48:49 +03:00
parent 567ac1a26d
commit 9f4a3197de
22 changed files with 2301 additions and 463 deletions

View file

@ -1,7 +1,7 @@
// Volumetric GLSL shader exhaust plumes, mach shock diamonds (this doesn't look so much better than p1), and altitude/throttle plume scaling.
import * as THREE from "three";
import { getSoftParticleTexture } from "../sceneManager.js";
import { isReducedEffects } from "../../theme.js";
import { isReducedMotionEffects } from "../../theme.js";
import { getPlumeStyle, type NozzleEmitter } from "./materials.js";
const PLUME_VERTEX_SHADER = `
@ -76,7 +76,7 @@ export function setPlumeAtmosphere(
mat.uniforms.uVacuum.value = vacuum;
mat.uniforms.uThrottle.value = thr;
if (mat.uniforms.uReduced) {
mat.uniforms.uReduced.value = isReducedEffects() ? 1.0 : 0.0;
mat.uniforms.uReduced.value = isReducedMotionEffects() ? 1.0 : 0.0;
}
}
});
@ -129,7 +129,7 @@ export function buildStagePlume(
uTime: { value: 0 },
uVacuum: { value: 0 },
uThrottle: { value: 1 },
uReduced: { value: isReducedEffects() ? 1.0 : 0.0 },
uReduced: { value: isReducedMotionEffects() ? 1.0 : 0.0 },
uCoreColor: { value: new THREE.Color(style.core).multiplyScalar(1.35) },
uInnerColor: {
value: new THREE.Color(style.inner).multiplyScalar(1.15),
@ -153,7 +153,7 @@ export function buildStagePlume(
);
envelope.position.y = -plumeLen * 0.5;
envelope.onBeforeRender = () => {
if (!isReducedEffects()) {
if (!isReducedMotionEffects()) {
shaderMat.uniforms.uTime.value = performance.now() * 0.001;
}
};