Skip to content

chams

Render occlusion-aware mesh overlays (chams) on MeshParts, with custom shader materials.

chams.RegisterMaterial(name: string, source: { vertex: string, fragment: string }) -> ok: boolean, errorLog: string?

Compiles and registers a named GLSL material (vertex and fragment shader source) usable as the material option in chams.Apply, returning false plus a compile log on failure.

local ok, err = chams.RegisterMaterial("outline", { vertex = vsSource, fragment = fsSource })
if not ok then warn(err) end

chams.Apply(target: Instance, opts: { fill: Color3?, occludedFill: Color3?, alpha: number?, material: string?, occlusion: boolean?, uniforms: {[string]: number|Color3|Vector3}? }) -> ()

Queues a chams overlay for the given Player, Character root, or MeshPart (and its MeshPart descendants) to be drawn this frame, using the fill colors, alpha (0-255), named material, optional through-wall occlusion, and optional shader uniforms in opts.

chams.Apply(player, { fill = Color3.new(1,0,0), occludedFill = Color3.new(0,0,1), alpha = 200, occlusion = true })