Class Terrain

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

public final class Terrain extends Object
Ground. Layers are chosen per pixel from height and slope, so any mesh (a heightfield, a Primitives.grid displaced by VERTEX_OFFSET, a level built from boxes) is painted without UVs or splat textures. Use with Material.Type.PBR or Material.Type.LAMBERT.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    VEC3 colour of flat ground.
    static final String
    VEC4: sand top height, snow line height, the slope (normal y) below which rock shows, and the blend width.
    static final String
    VEC3 colour of steep ground.
    static final String
    VEC3 colour below LEVELS.x: beach, mud.
    static final String
    FLOAT repeats of the detail noise per world unit.
    static final String
    VEC3 colour above LEVELS.y.
    static final String
    FLOAT world height of the waterline, under which ground darkens as if wet.
  • Method Summary

    Modifier and Type
    Method
    Description
    Sand, grass, rock and snow by height and slope, with noise breaking up every boundary and wet ground along the waterline.
    Bare stone on every face, its strata and grain mapped by Shading.boxUv so cliffs and boulders need no UVs.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • layered

      public static ShaderMaterial layered()

      Sand, grass, rock and snow by height and slope, with noise breaking up every boundary and wet ground along the waterline.

      Returns

      a new shader material

    • rock

      public static ShaderMaterial rock()

      Bare stone on every face, its strata and grain mapped by Shading.boxUv so cliffs and boulders need no UVs.

      Returns

      a new shader material