Skip to content

Paper texture 2.0 - #220

Open
uuuulala wants to merge 155 commits into
mainfrom
paper-texture-adjustments
Open

Paper texture 2.0#220
uuuulala wants to merge 155 commits into
mainfrom
paper-texture-adjustments

Conversation

@uuuulala

@uuuulala uuuulala commented Oct 31, 2025

Copy link
Copy Markdown
Member

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: colorFront becomes colorShadow; contrast, crumples/crumpleSize, and fade/blur are removed. New params include creases (plus size/offset), lightAngle, roughnessSize, blending, distortion, and background. Deprecated crumplesScale/blur aliases are dropped; fiberScale/foldsNumber remain.

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.maxFoldCount follow the new params.

Reviewed by Cursor Bugbot for commit 7fc2fb3. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Oct 31, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shaders-docs Ready Ready Preview Aug 23, 2026 7:33pm

Request Review

# 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
Comment thread docs/src/shader-defs/paper-texture-def.ts
Comment thread packages/shaders/src/shaders/paper-texture.ts Outdated
Comment thread packages/shaders-react/src/shader-mount.tsx
Comment thread docs/src/app/(shaders)/water/page.tsx
Comment thread docs/src/app/(shaders)/paper-texture/page.tsx Outdated
Comment thread packages/shaders/src/shaders/paper-texture.ts
Comment thread packages/shaders/src/shaders/paper-texture.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7fc2fb3. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant