M MY Multiplayer: Wiki
Side
Kind

engineSetModelStencil

Client

Marks every instance of a model with a stencil value, which post shaders read for outlines, highlights and similar effects.

bool engineSetModelStencil(string|element model, int value [, bool seeThrough = false, int priority = 0])

Parameters

NameTypeDescription
modelstring|elementThe model's name or a model element.
valueintThe mark, an integer from 1 to 255.
seeThroughboolAn extra flag post shaders read with stencil_see_through.default false
priorityintWhen several resources mark the same target, the highest priority wins; between equals, the newest.default 0

Returns

true when the mark was applied.

Example

local outline = engineCreateMaterial(engineCreateShader("shaders/outline.shader"))
engineAddPostProcess(outline)
engineSetModelStencil("kmb_atm1", 3, true)
NoteThe value takes 1 to 255, but post shaders read only its low 7 bits (stencil gives 0 to 127): from 128 on the top bit is lost, and 128 reads as unmarked. A name that is not a model is an error.

See also