Skip to content

CustomMonsters RenderFlags

wezzzyrek1 edited this page Sep 24, 2026 · 2 revisions

Render flags

The mask the monster's body is drawn with. A script sets it in OnRender; without a script it comes from the monster's config (<Render Flags="CHROME2|LIGHTMAP|BRIGHT" />). The two never both apply: a monster with a script is driven only by Lua.

m.renderFlags = Enums.RenderFlags.METAL + Enums.RenderFlags.BRIGHT
m.bright      = 1.0

Plain addition is correct because every flag is a distinct bit - just build the mask from distinct names, never the same one twice.

Flag Effect
COLOR untextured, flat body colour
TEXTURE plain textured pass, the ordinary default
CHROME environment / chrome reflection
CHROME2 chrome variant; binds the chrome texture when the mesh has none
CHROME3 as above, the "set item" effect
CHROME4 as above, the "+13" effect
CHROME5 soft light variant
CHROME6 CHROME7 chrome variants
CHROME8 lucky item effect
CHROME9 chrome variant of its own, scrolled on two axes at once
METAL metallic reflection, brighter than CHROME
OIL oily sheen
LIGHTMAP modulate with the light map instead of alpha blending
SHADOWMAP shadow pass
BRIGHT additive blend; body light is scaled by alpha
DARK subtractive blend
EXTRA extra pass on top, to stack a second effect
WAVE wave / distortion pass
NODEPTH skip the depth test, so the model draws over everything
DOPPELGANGER doppelganger tint
MULTIPLY multiply the scene by the model: by the texture's alpha where it has one, by its colour where it has not
HEIGHT_CLIP cut the model off at a height - see below

Two rules about how the mask is read:

  • BRIGHT, DARK, MULTIPLY and LIGHTMAP are alternatives. The first found wins, in that order, and the rest are ignored.
  • Any of CHROME* / METAL / OIL moves the whole draw onto the chrome path, where meshes marked as non-blending are skipped entirely.

HEIGHT_CLIP cuts the model off at a height

With HEIGHT_CLIP in the mask, a triangle whose three corners all sit below a given height is not drawn. The height is a world Z, taken from m.blendMeshTexCoordV, so it is the same number a position uses - not a fraction of the model.

m.renderFlags = Enums.RenderFlags.TEXTURE + Enums.RenderFlags.HEIGHT_CLIP
m.blendMeshTexCoordV = m.positionZ + 80    -- only what is 80 units above its feet is drawn

That field is also the blend mesh's texture offset, so a monster that already animates its blend mesh with it cannot use both at once.

LIGHTMAP throws your colour away

LIGHTMAP overwrites the body colour with white before anything is drawn. With it in the mask, both <Glow ColorR/G/B> and m.bodyLightR/G/B are discarded and the monster renders uncoloured.

That is why a monster with a <Glow> colour is drawn CHROME|BRIGHT by default. If a glow colour does not show up, this is almost always the reason.

See Also

Clone this wiki locally