// Pastel sky dome (pink horizon to soft blue), shared by every scene. import * as THREE from 'three'; export function makeSky(top = '0.62,0.8,1.0', bottom = '1.0,0.85,0.93'): THREE.Mesh { return new THREE.Mesh(new THREE.SphereGeometry(200, 24, 12), new THREE.ShaderMaterial({ side: THREE.BackSide, depthWrite: false, vertexShader: 'varying vec3 vP; void main(){ vP = position; gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0); }', fragmentShader: `varying vec3 vP; void main(){ float h = normalize(vP).y; vec3 a = vec3(${bottom}); vec3 b = vec3(${top}); vec3 c = mix(a,b,smoothstep(-0.05,0.55,h)); gl_FragColor = vec4(c,1.0);\n#include \n}` })); }