Log inGet started
Package

roleGlaze.styleBlock

README.md

Roles glaze (styleBlock, Colour)

A transparent glaze of one colour over the objects of one group of game roles, keeping each surface's own light and dark. It is what makes the hero, the enemies and the pickups read apart when they share a material: under a pencil, ink or watercolor look every object would otherwise come out the same grey, and a darker shade or a heavier line alone is not enough to tell them apart at a glance.

You rarely add it by hand. StyleRoles.use(set) adds one entry per group from the role set's glazes (for example enemy: { tint: "#b02030", amount: 0.6, lightness: 0.8 }), each drawn only on that group. By hand:

StyleKit.add("roleGlaze", { id = "enemyGlaze", variant = "enemy", settings = { tint = "#b02030", amount = 0.6, lightness = 0.8 } })

Settings: tint (the colour), amount (0.7), saturation (1), lightness (1; below 1 deepens the group, above 1 lightens it).

What it gives up in motion

Nothing extra: it colours each pixel on its own from the object mask, so it adds no marks that could slide or flicker. The glaze follows its objects as they move, because the mask is drawn from their geometry every frame (rebuilt at most four times a second while roles keep changing, so a role given in play reaches the glaze within a quarter of a second).

How it treats content

  • Objects of its variant: glazed, light and shade kept, so form still reads. Black stays black.
  • Everything else (props, scenery, the sky): untouched.
  • Skinned characters: glazed like any surface; a player and the enemies keep their own colour as they animate.
  • Transparent things (glass, water) and particles and smoke: they draw no depth and are not in the object mask, so they are not glazed; what shows through glass in front of a glazed object keeps the glaze.
  • Fog: a glazed object deep in fog keeps its glaze, laid over the fogged colour, so a far enemy still reads red but as pale as the fog makes it.
  • Foliage: leaves with a role are glazed; cutout leaves keep their holes.
  • World text: glazed only when its object has a role; give labels and in-world HUD the asRendered role to keep them exactly as rendered.
  • Lines and marks laid before it (the Colour slot runs after Fill, Tone and Line) take the glaze too, which keeps a group's line and fill in one family of colour; paper laid after it shows its grain over the glaze.

Known limits

  • Per-object settings reach it through the shared object mask, at most eight distinct settings a scene; a per-object value cannot reach a geometry pass (#24549).
  • Its pass is queued again every frame (#24548). With no role set on, StyleRoles.use adds none and it costs nothing.