Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commita2fece03a2

README.md

avatarSurface.shader

The surface a person chooses for one part of their avatar: the material it wore (colour map, roughness, metalness, normal map, emission, occlusion, clearcoat and sheen, lit by the engine's metallic-roughness model) with a pattern laid over it and an image placed on it. avatarAppearance makes one per mesh of a body region, avatar part or worn item whose look names a pattern or a decal; nothing else needs to set it by hand.

The pattern and the image are laid in the space of the thing they cover (surface_row_x/y/z carry the mesh's rest positions there, surface_min / surface_max are its box), so they move with the skeleton. pattern_kind 1 to 6 are worked out on the surface and hold no texture (stripes, checks, dots, camouflage, spots, tabby), 7 wraps pattern_texture around the thing; pattern_color is the second colour, the surface's own (entity tint included) the first. decal_texture is placed by decal_place (degrees around from the front, centre height and width as shares of the thing's height, turn) while decal_on is 1. glow 1 makes the surface glow in its own colours, pattern and image included.

The vertex stage carries each vertex's place in the vertex colour channel, so the mesh's own vertex colour reaches the surface as its brightness.