Class Surface
Material.Type.PBR. Patterns are laid
out by Shading.boxUv, in world units, so they need no UVs and stay the
same size on every mesh; SCALE sets repeats per unit.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFLOAThow much of the second layer shows, 0 to 1.static final StringVEC3the main colour: paint, wood, stone or tint.static final StringVEC3the second colour: bare metal, rust, grain or flakes.static final intThe most paint splatspaintSplatskeeps.static final StringFLOATopacity of glass and ice facing the camera.static final StringFLOATpattern repeats per world unit. -
Method Summary
Modifier and TypeMethodDescriptionstatic ShaderMaterialcarPaint()Car paint: a glossy coat over a metallic base with sparkling flakes.static ShaderMaterialconcrete()Cast concrete: mottled grey, pores and darker stains low down.static ShaderMaterialfabric()Woven cloth: a fine cross weave and a soft sheen at grazing angles.static ShaderMaterialglass()Clear glass: see through facing the camera, mirror-like at the edges.static ShaderMaterialice()Ice: blue translucent depths, frosted cracks and a cold rim.static ShaderMaterialPainted metal worn through to bare steel in patches: containers, hulls, railings.static ShaderMaterialPaint splats on any surface: up toMAX_SPLATSblobs with ragged edges and drips, glossier than what they cover.static ShaderMaterialrust()Rust eating into metal: orange-brown blotches, rough where rusted.static voidsetSplat(ShaderMaterial splats, int index, float x, float y, float z, float radius, int rgb) Places or clears a splat of apaintSplatsmaterial.static ShaderMaterialwood()Wood planks along the texture's u: grain lines, knots and a board pattern.
-
Field Details
-
COLOR
-
COLOR2
VEC3the second colour: bare metal, rust, grain or flakes.- See Also:
-
AMOUNT
-
SCALE
-
OPACITY
-
MAX_SPLATS
public static final int MAX_SPLATSThe most paint splatspaintSplatskeeps.- See Also:
-
-
Method Details
-
paintedMetal
Painted metal worn through to bare steel in patches: containers, hulls, railings.
COLORis the paint,COLOR2the metal,AMOUNTthe wear.Returns
a new shader material
-
rust
Rust eating into metal: orange-brown blotches, rough where rusted.
COLORis the metal,COLOR2the rust,AMOUNThow far it has spread.Returns
a new shader material
-
wood
Wood planks along the texture's u: grain lines, knots and a board pattern. Uses the mesh's UVs so the grain follows each plank.
COLORis the light wood,COLOR2the dark grain,SCALEboards per unit of v.Returns
a new shader material
-
concrete
Cast concrete: mottled grey, pores and darker stains low down.
Returns
a new shader material
-
glass
Clear glass: see through facing the camera, mirror-like at the edges. Use an alpha blended render state.
COLORtints it.Returns
a new shader material
-
ice
Ice: blue translucent depths, frosted cracks and a cold rim. Use an alpha blended render state for thin ice, opaque for blocks.
Returns
a new shader material
-
fabric
Woven cloth: a fine cross weave and a soft sheen at grazing angles. Uses the mesh's UVs.
Returns
a new shader material
-
carPaint
Car paint: a glossy coat over a metallic base with sparkling flakes.
COLORis the paint,COLOR2the flake colour.Returns
a new shader material
-
paintSplats
Paint splats on any surface: up to
MAX_SPLATSblobs with ragged edges and drips, glossier than what they cover. Place them withsetSplat; the surface underneath keeps its own colour and texture.Returns
a new shader material
-
setSplat
public static void setSplat(ShaderMaterial splats, int index, float x, float y, float z, float radius, int rgb) Places or clears a splat of a
paintSplatsmaterial.Parameters
-
splats: a material frompaintSplats -
index: 0 toMAX_SPLATS - 1; reuse the oldest when full -
x: world centre -
y: world centre -
z: world centre -
radius: world radius, 0 to clear the slot -
rgb: paint colour as0xRRGGBB
-
-