Create NPR painterly filter
create_npr_filterTransform any TOP into painterly art using oil, pencil, or watercolor effects. Creates a live-tweakable filter chain with radius, smoothness, and strength controls.
Instructions
Apply a non-photorealistic painterly filter to an existing TOP. A generalized Kuwahara (sector-based local variance smoothing) runs in a single GLSL TOP and branches into three looks selected by mode: oil (flat color regions, preserved edges), pencil (graphite sketch via luminance × edge magnitude), or watercolor (quantized chroma + low-frequency bleed). Creates a Select TOP → GLSL TOP → Null TOP chain under parent_path and exposes Radius / Smoothness / Strength as custom parent params bound by expression for live tweaking. Returns the GLSL TOP path, the bind-ready output null path, the fragment DAT path, exposed controls, and an glsl_compile_verified flag (always false offline — verify post-cook with get_td_node_errors).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_path | Yes | Absolute path of an existing TOP to filter (e.g. '/project1/render1'). Pulled in via a Select TOP (no cross-COMP wire). | |
| parent_path | No | Parent COMP path to create the glslTOP + textDAT + nullTOP inside. | /project1 |
| name | No | Base name for the glslTOP (textDAT becomes `<name>_frag`, output becomes `<name>_out`, source select becomes `<name>_src`). | npr1 |
| mode | No | Painterly look. oil: full Kuwahara → flat color regions with preserved edges. pencil: luminance + edge-mag → graphite sketch. watercolor: quantize chroma + low-freq bleed. | oil |
| radius | No | Sampling radius in texels. Cost is O(radius² · sectors) — keep modest on 4K. | |
| sectors | No | Number of generalized-Kuwahara sectors. 8 = smoother painterly; 4 = classic Kuwahara (cheaper). | 8 |
| smoothness | No | Blend between hard min-variance sector pick (0) and softmax-weighted average across sectors (1). Live control. | |
| strength | No | Wet/dry mix between source (0) and filtered output (1). Live control. | |
| resolution | No | Output resolution: 'input' inherits from the source (default), or '720p' (1280x720), '1080p' (1920x1080), '4K' (3840x2160). | input |