Skip to main content

THRESHOLD

Constant THRESHOLD 

Source
pub const THRESHOLD: &str = "// White where the gray is above `level`, black below, ramped over `softness`.\nfn effect(_uv: vec2f, src: vec4f) -> vec4f {\n    let half_soft = params.softness * 0.5;\n    let gray = builtin_gray(builtin_straight(src));\n    let value = builtin_smoothstep(params.level - half_soft, params.level + half_soft, gray);\n    return builtin_output(vec3f(value), src.a);\n}\n";
Expand description

Built-in black-and-white threshold body.