pub fn register_window_shader(passes: &[&str]) -> Option<u8>Expand description
Register a multi-pass GLSL shader with the compositor.
Each element of passes is a complete sample_to_rgba(vec2 texcoord) function.
The compositor chains them so that pass i samples the output of pass i-1:
- Pass 0 —
texis the window’s content texture;tex_sourceis the same. - Pass i (i > 0) —
texis the output of pass i-1;tex_sourceis always the original window content, useful for combining a processed result with the untouched original (e.g. bloom = blur + original). - Final pass — the alpha mask, rounded-corner SDF, and window transform are
applied after
sample_to_rgbareturns, exactly as with a single-pass shader. surfaceSize(the window size in pixels) is available in every pass.
Returns the shader ID on success (pass to crate::window::Window::set_shader),
or None if registration failed.