From 985a23751e73d15d0019222d5cfc5117cb895a77 Mon Sep 17 00:00:00 2001 From: keyhan Date: Tue, 23 Jun 2026 00:48:49 +0330 Subject: [PATCH] fix(landing): merge the final scene's two suns into one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The closing sky drew two suns: the 3D sun mesh (corona + GodRays) at a fixed world point, and a disc/halo painted by the sky shader aimed at a fixed direction. As the camera flew forward, parallax split them apart — the mesh rode high while the painted halo stayed low. Aim the sky shader's uSunDir at the real camera→sun direction each frame so the halo locks onto the mesh (one sun), and lower SUN_POS.y 34→13 so that single sun sits at the lower, near-horizon spot. Co-Authored-By: Claude Opus 4.8 --- frontend/src/components/landing/SceneCanvas.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/landing/SceneCanvas.tsx b/frontend/src/components/landing/SceneCanvas.tsx index c1d7987..8b220c3 100644 --- a/frontend/src/components/landing/SceneCanvas.tsx +++ b/frontend/src/components/landing/SceneCanvas.tsx @@ -15,7 +15,7 @@ import { rainVertexShader, rainFragmentShader, skyVertexShader, skyFragmentShade // (mounted first) and read by every other piece of the scene. const weather = makeWeatherSample(); -const SUN_POS = new THREE.Vector3(0, 34, -205); +const SUN_POS = new THREE.Vector3(0, 13, -205); const SKY_RADIUS = 400; function WeatherClock() { @@ -49,6 +49,10 @@ function GradientSky() { m.uniforms.uSunColor.value.copy(weather.sunColor); m.uniforms.uSunReveal.value = weather.sunReveal; m.uniforms.uCameraPos.value.copy(state.camera.position); + // Aim the painted sky-sun along the real camera→sun direction so its halo + // stays locked onto the 3D sun mesh. Using a fixed direction made it drift + // into a second, lower disc as the camera flew forward (parallax). + m.uniforms.uSunDir.value.subVectors(SUN_POS, state.camera.position); if (meshRef.current) { meshRef.current.position.x = state.camera.position.x; meshRef.current.position.z = state.camera.position.z;