feat: reconstruct the chase-view grand tourer

This commit is contained in:
2026-09-02 15:06:14 +03:00
parent 5c52de9134
commit e4c832356b
5 changed files with 475 additions and 81 deletions

View File

@@ -70,19 +70,27 @@ export function createAtmosphere(
uniforms: {
uVisibility: { value: night.starVisibility },
uDistance: { value: 0 },
uPointScale: { value: 18 },
uMaxPointSize: { value: 4.5 },
uColor: { value: new THREE.Color(0xb9ecf2) },
},
vertexShader: `
attribute float starSize;
attribute float brightness;
uniform float uDistance;
uniform float uPointScale;
uniform float uMaxPointSize;
varying float vBrightness;
void main() {
vec3 star = position;
star.x += sin(position.z * 0.017 + uDistance * 0.004) * 0.08;
vec4 viewPosition = modelViewMatrix * vec4(star, 1.0);
vBrightness = brightness;
gl_PointSize = starSize * (250.0 / max(1.0, -viewPosition.z));
gl_PointSize = clamp(
starSize * (uPointScale / max(1.0, -viewPosition.z)),
0.75,
uMaxPointSize
);
gl_Position = projectionMatrix * viewPosition;
}
`,