Paper texture 2.0 - #220
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # docs/src/app/(shaders)/lens-distortion/page.tsx # docs/src/app/(shaders)/paper-texture/page.tsx # docs/src/shader-defs/lens-distortion-def.ts # docs/src/shader-defs/paper-texture-def.ts # packages/shaders/src/shaders/lens-distortion.ts # packages/shaders/src/shaders/paper-texture.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7fc2fb3. Configure here.
| float edge = lst(0., .5, lb - l); | ||
| vec2 edgeGrad = (uv - nearPb) / max(lb, 1e-4) - (uv - nearP) / max(l, 1e-4); | ||
|
|
||
| return vec4(getCellTilt(idx, rad) + FACET_CURVE * (1. - edge) * edgeGrad, .2 * l, edge); |
There was a problem hiding this comment.
Single fold uses bogus neighbor
Medium Severity
In getFolds, when foldCount rounds to 1 only one site is considered, so nearB stays at the sentinel 9 and nearPb stays at the origin. Edge and edgeGrad are then computed against that fake second neighbor, which warps facet tilt, shading, and distortion for a supported minimum foldCount.
Reviewed by Cursor Bugbot for commit 7fc2fb3. Configure here.


Note
Medium Risk
Public PaperTexture params and presets change, so existing consumers will break. Shader-only visual rewrite with no auth or data-handling impact.
Overview
Rewrites the Paper Texture shader into a more physically shaded paper surface: directional lighting, facet folds, straight creases, and image print/distortion.
Breaking API:
colorFrontbecomescolorShadow;contrast,crumples/crumpleSize, andfade/blurare removed. New params includecreases(plus size/offset),lightAngle,roughnessSize,blending,distortion, andbackground. DeprecatedcrumplesScale/bluraliases are dropped;fiberScale/foldsNumberremain.The fragment shader now builds relief from folds and creases, then multiplies the image with paper ink and warps UVs with the surface. Presets are replaced (Default, Spread, Grid, Colored). Docs/Leva controls and
paperTextureMeta.maxFoldCountfollow the new params.Reviewed by Cursor Bugbot for commit 7fc2fb3. Bugbot is set up for automated code reviews on this repo. Configure here.