Strata - v1.4.10
    Preparing search index...

    Function createSkyMaterial

    • Create a shader material for procedural sky rendering.

      Generates a THREE.ShaderMaterial configured for GPU-accelerated atmospheric scattering, day/night cycles, and dynamic weather integration. The material uses custom vertex and fragment shaders for Rayleigh/Mie scattering simulation.

      Performance: Single material instance per sky; uniforms update per frame (sub-millisecond cost).

      Parameters

      Returns ShaderMaterial

      Configured shader material ready for rendering

      If sunIntensity is outside [0, 1] range

      If sunAngle is outside [0, 180] range

      // Basic day sky
      const daySky = createSkyMaterial({
      timeOfDay: {
      sunAngle: 60,
      sunIntensity: 1.0
      }
      });

      // Night sky with stars
      const nightSky = createSkyMaterial({
      timeOfDay: {
      sunAngle: 0,
      sunIntensity: 0,
      starVisibility: 1.0
      }
      });

      // Stormy weather
      const stormSky = createSkyMaterial({
      timeOfDay: { sunAngle: 45, sunIntensity: 0.3 },
      weather: { intensity: 0.8 }
      });

      // Update uniforms per frame
      function animate(time) {
      daySky.uniforms.uTime.value = time;
      daySky.uniforms.uSunAngle.value = (time % 24) * 7.5;
      }