Resource Docs

WGSL Shaders

Resource Map

Perro composes custom WGSL files with engine prelude and wrapper entry points for materials and post effects.

Key rules

Custom material files implement shade_material.

Optional shade_vertex can modify output before wrapper entry points.

Use custom_f_param/custom_v_param to read packed custom params.

Post shaders implement post_process(uv, color, depth).

Example

fn shade_material(in: FragmentInput) -> vec4<f32> {    let glow = custom_f_param(in, 0u).x;    let tint = custom_f_param(in, 1u);    return vec4<f32>(in.color.rgb * tint.rgb + glow, in.color.a);}

Related Resource Docs

Use these links for adjacent formats or runtime systems used with WGSL Shaders.