Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks
- ..
- .metadata154 B
- README.md2.3 KB
- preview.png50.6 KB
- properties.yaml2.1 KB
- shader.wgsl8.9 KB
README.md
paperSurface (paperBlocks surface shader)
A paperBlocks paper on an object's own material, for a hero object, a character or a chosen set that should sit on the same paper as the rest of the picture. It takes the same named settings every paperBlocks paper has (tint, toothHeight, toothSharpness, toothSize, fibre, fibreLength, fibreTone, weave, mottle, foxing, rule, ruleColour, ruleSpacing, emboss, sheen, lights, lightColour, lightTint, lightsFrom), so a paper's defaults copy across as they are, plus the object's own base_color, base_color_texture and metallic, sheet (1 lays the whole paper on the object, 0 only the tooth's relief and tone) and pixelsPerRef (screen height / 1080, kept current by the PaperSurface component that PaperMaterial.paint adds).
The tooth, fibres, weave, blotches, spots and rules are laid on the object's own position, so they stay on it when it moves or animates as a whole, and they keep about the full-frame paper's size in the picture (two octaves blended by how many metres one pixel covers), fading any part finer than about two drawn pixels. The tooth bends the surface normal, so every light in the scene rakes across it through the engine's own PBR lighting; sheen lowers the roughness so the sheet shines where light reaches it. The picture is laid on the sheet by the full-frame paper pass's own rule (darks into the sheet and its valleys, lights put on on toned and dark papers), and nothing is ever brighter than the light that reached it, so an unlit object stays black.
Apply it with PaperMaterial.paint(entityId, "paperColdPress") rather than by hand: that writes derived materials that keep each original's colour and texture, copies the paper's defaults, keeps pixelsPerRef current, and PaperMaterial.unpaint puts the originals back. Skinned characters: the position is the bind-pose position, so the tooth stays on the body as it animates. Post-process shaders aside, a surface shader preview shows it on a sphere.
Known limits
- A post-process shader has no surface preview image.
- A pass reads the scene's depth only when it also writes the scene picture (#24550), and an unknown blend name draws as replace (#24551).
- A per-object value cannot reach a geometry pass (#24549).
The package README's Known limits lists the rest.