▣
module · drop-in viewer
paint
The greasepaint, generated. No clown's face in this game is a painted image: each one is drawn here from a description, into a base-colour / normal / roughness set that its material binds.
by·posted 1mo ago
What it does
game.clowns.paint
The greasepaint, generated. No clown's face in this game is a painted image: each one is drawn here from a description, into a base-colour / normal / roughness set that its material binds.
Exports
Paint.head(spec) -> base, normal, roughnessMetallic, buffer— a face. The head texture is a cylindrical unwrap with the FACE at u = 0.5 and v running up the head's own lathe profile by arc length, so every feature in the spec is written in centimetres of real face:mouthY,mouthHalf,eyeSep,browY,cheekXand the rest.mouthLiftlifts both corners of the smile andmouthSkewtilts the whole line, so one corner rides higher than the other.spec.profileis the head profile the figure was lathed from andspec.radiusits widest radius. OptionalmuzzleandeyePatchlay white ground under the red, which is what separates an Auguste from a whiteface; optionaltearpaints a stripe straight down from the socket.Paint.cloth(spec) -> base, normal, roughnessMetallic, buffer— a bolt of cloth.spec.patternis"diamond" | "stripe" | "plain"; the weave, the wear and the grime are always there. Woven neutral so a material's ownbase_colordyes it.Paint.mapping(profile) -> toV, toY— the height/v conversions a caller needs to place something on a head by where it sits in metres.Paint.at(buffer, w, h, u, v) -> r, g, b— what the generator put at one point, straight out of the buffer, so a face that looks wrong on screen can be told from a face that was drawn wrong.
Notes
- A face costs a second or two of pure Luau. Pass
spec.chunkRowsto spend it a band at a time and hand the frame back between bands;game.clowns.Rosterdoes that so a spawn never freezes the game.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.