Class Sky

java.lang.Object
com.codename1.gpu.shaders.Sky

public final class Sky extends Object

Sky domes: draw an inside-out sphere (Primitives.sphere(r, 24, 32, true)) around the camera with a Material.Type.UNLIT material and setFogged(false). The colour depends only on the direction from the camera, so the dome's size and position do not matter. The sun follows the scene's light.

For the sky to light the scene as well, give the Environment matching hemisphere colours; ScenePresets does both.

  • Field Details

  • Method Details

    • gradient

      public static ShaderMaterial gradient()

      A clear or hazy sky with a sun disc, a wide glow around it, the horizon band and drifting clouds.

      Returns

      a new shader material

    • day

      public static ShaderMaterial day(ShaderMaterial sky)

      Sets a gradient sky to a clear midday.

      Parameters
      • sky: a material from gradient
      Returns

      the material

    • dusk

      public static ShaderMaterial dusk(ShaderMaterial sky)

      Sets a gradient sky to a warm dusk: deep blue overhead, apricot at the horizon, a big rose glow around a low sun, first stars.

      Parameters
      • sky: a material from gradient
      Returns

      the material

    • night

      public static ShaderMaterial night(ShaderMaterial sky)

      Sets a gradient sky to night: dark blue, a cold moon glow, stars.

      Parameters
      • sky: a material from gradient
      Returns

      the material

    • overcast

      public static ShaderMaterial overcast(ShaderMaterial sky)

      Sets a gradient sky to a grey overcast.

      Parameters
      • sky: a material from gradient
      Returns

      the material