Class Terrain
java.lang.Object
com.codename1.gpu.shaders.Terrain
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
FieldsModifier and TypeFieldDescriptionstatic final StringVEC3colour of flat ground.static final StringVEC4: sand top height, snow line height, the slope (normal y) below which rock shows, and the blend width.static final StringVEC3colour of steep ground.static final StringVEC3colour belowLEVELS.x: beach, mud.static final StringFLOATrepeats of the detail noise per world unit.static final StringVEC3colour aboveLEVELS.y.static final StringFLOATworld height of the waterline, under which ground darkens as if wet. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShaderMateriallayered()Sand, grass, rock and snow by height and slope, with noise breaking up every boundary and wet ground along the waterline.static ShaderMaterialrock()Bare stone on every face, its strata and grain mapped byShading.boxUvso cliffs and boulders need no UVs.
-
Field Details
-
SAND
-
GRASS
-
ROCK
-
SNOW
-
LEVELS
VEC4: sand top height, snow line height, the slope (normal y) below which rock shows, and the blend width.- See Also:
-
SCALE
-
WATERLINE
FLOATworld height of the waterline, under which ground darkens as if wet. Set it below the terrain to turn it off.- See Also:
-
-
Method Details
-
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
Bare stone on every face, its strata and grain mapped by
Shading.boxUvso cliffs and boulders need no UVs.Returns
a new shader material
-