feat(scene): add destination skyline, traffic, wet-road light and a saturated sun

This commit is contained in:
2026-10-10 19:50:38 +03:00
parent 2080265568
commit 604a7765ff
4 changed files with 336 additions and 4 deletions

View File

@@ -80,9 +80,9 @@ export function createSun(resources: SceneResourceBag): SunWorld {
float lip = exp(-abs(phase - gap - 0.025) * 90.0) * step(solar.y, 0.65);
float convection = sin(solar.x * 19.0 + sin(solar.y * 23.0 + uTime * 0.055))
* sin(solar.y * 31.0 - uTime * 0.032);
vec3 vermilion = mix(vec3(0.85, 0.018, 0.28), vec3(1.0, 0.24, 0.12), uArrival);
vec3 coral = mix(uColor, vec3(1.0, 0.16, 0.13), 0.48);
vec3 crown = mix(vec3(1.0, 0.63, 0.24), vec3(1.0, 0.88, 0.64), uArrival);
vec3 vermilion = mix(vec3(1.0, 0.03, 0.4), vec3(1.0, 0.24, 0.12), uArrival);
vec3 coral = mix(uColor, vec3(1.0, 0.3, 0.06), 0.6);
vec3 crown = mix(vec3(1.0, 0.8, 0.12), vec3(1.0, 0.9, 0.6), uArrival);
vec3 core = mix(vermilion, coral, smoothstep(0.0, 0.58, solar.y));
core = mix(core, crown, smoothstep(0.47, 1.0, solar.y));
float filament = pow(abs(sin(solar.x * 39.0 + solar.y * 25.0 + convection * 2.4)), 16.0);
@@ -91,7 +91,8 @@ export function createSun(resources: SceneResourceBag): SunWorld {
core += vec3(1.0, 0.24, 0.095) * (limb * 0.22 + lip * 0.20);
float extinction = smoothstep(0.025, 0.19, solar.y);
if(softEdge * bandMask * extinction < 0.02) discard;
gl_FragColor = vec4(core * (1.0 + uWarmth * 0.10), softEdge * bandMask * extinction);
// Kept below ACES's shoulder so the disc stays saturated instead of cream.
gl_FragColor = vec4(core * (0.74 + uWarmth * 0.08), softEdge * bandMask * extinction);
#include <tonemapping_fragment>
#include <colorspace_fragment>
}