Halftone lines shader - #234
Conversation
| grainOverlay: 0, | ||
| grainOverlaySize: 0.5, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Presets use contain not cover
Medium Severity
All halftoneLinesPresets spread defaultObjectSizing without overriding fit, so they keep contain. Sibling image filters (halftone-dots, halftone-cmyk, fluted-glass) set fit: 'cover', so the default and preset demos letterbox the source image instead of filling the canvas like the other filters.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit d9803b7. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 903487f. Configure here.
| float offsetScale = u_gridType < 5.5 ? 1. : cellsPerSide; | ||
| float contouringPower = abs(u_gridContouring) * ((u_gridContouring > 0. ? contouringLum : 1. - contouringLum) - 1.); | ||
|
|
||
| vec3 contouring = vec3(6., .5 * smoothstep(length(uv), 0., 1.), -5.) * contouringPower; |
There was a problem hiding this comment.
Contouring smoothstep args inverted
High Severity
smoothstep(length(uv), 0., 1.) passes edge0 >= edge1 for nearly every fragment, which is undefined in GLSL ES 3.00. That value feeds contouring.y and thus grid rotation whenever gridContouring is non-zero, so contouring rotation becomes driver-dependent instead of a defined falloff.
Reviewed by Cursor Bugbot for commit 903487f. Configure here.
| float lum = dot(vec3(0.2126, 0.7152, 0.0722), color); | ||
| lum = mix(1., lum, tex.a); | ||
| return u_strokeInverted ? (1. - lum) : lum; | ||
| } |
There was a problem hiding this comment.
Stroke invert flips palette colors
Medium Severity
toLum always applies u_strokeInverted, and inkMix uses toLum to blend colorMid and colorFront. Enabling strokeInverted therefore swaps the palette assignment, even though docs say inversion only affects stroke width and leaves colors unchanged.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 903487f. Configure here.


Note
Medium Risk
Adds a new public shader API and a non-trivial GLSL fragment shader with image sampling and many uniforms. Risk is mainly visual correctness and GPU performance, not security.
Overview
Adds Halftone Lines, an image filter that redraws a photo as a luminance-driven line grid.
The shader supports seven grid types (
lines,linesIrregular,waves,wavesIrregular,zigzag,truchet,radial), stroke width/contrast/softness, optional original-image colors vs a two-color palette, grid contouring/noise, and grain mixer/overlay. It is exported from@paper-design/shadersand@paper-design/shaders-reactasHalftoneLineswith six presets.Docs get a
/halftone-linesplayground (Leva controls, sample-image cycling, upload) plus registry and shader-def entries.Reviewed by Cursor Bugbot for commit 20adf8c. Bugbot is set up for automated code reviews on this repo. Configure here.