Skip to main content

Module advanced_blend

Module advanced_blend 

Source
Expand description

Advanced (Tier C) blend modes โ€” implemented as offscreen filter passes that sample backdrop + foreground and run a per-mode blend function in the fragment shader.

The shared template lives at shaders/advanced_blend.wgsl. For each advanced BlendMode, blend_fn_body returns the per-mode blend_fn(base, blend) -> vec3<f32> snippet that gets substituted into the template before pipeline compilation.

AdvancedBlendPipelines pre-builds one pipeline per advanced mode at construction time. AdvancedBlendPipelines::apply runs the right one.

Structsยง

AdvancedBlendPipelines ๐Ÿ”’
Cache of one [wgpu::RenderPipeline] per advanced BlendMode.

Constantsยง

PLACEHOLDER ๐Ÿ”’
TEMPLATE ๐Ÿ”’

Functionsยง

blend_fn_body ๐Ÿ”’
Per-mode blend_fn(base: vec3<f32>, blend: vec3<f32>) -> vec3<f32>.