Step 1: The surface
A material is one HLSL function. It gets the pixel (position, normal, how much it faces you, time…) and returns a color. Createsrc/index.ts:
params become fields of p. Each keeps its type: speed is a float, rimColor a float4 in 0..1.
Step 2: Draw it on enemies
replace: true switches the cheat’s own chams off for those players while you draw them. Drop it and
you get both, one on top of the other.
The model comes from the same skinned pose the cheat’s chams use, in the same frame, so it doesn’t
trail behind the player.
Step 3: X-ray with its own look
Turn onxray and the material runs a second time for the parts behind walls, with
s.occluded = true and s.color set to occludedColor. Branch on it:
camera is the frame camera from gpu.hlsli, already declared for you.
Step 4: A menu
Material properties and parameters can change any time; the upload happens once a frame.ui.effect re-runs whenever a value it reads changes, so the material follows the menu with no polling.
When it doesn’t show up
- A compile error goes to the log once, with your line numbers. Until the material compiles, its draws are skipped.
- Return straight alpha: the scene premultiplies for you.
scene.playeronly works insideon("render"), like every draw call.