Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
bb08a49
default fit cover => contain
uuuulala Oct 31, 2025
ccf2650
blending param added + default blending improved
uuuulala Oct 31, 2025
453d717
params order swap
uuuulala Oct 31, 2025
9fc23a4
opacity added
uuuulala Oct 31, 2025
d24cfa3
roughness to use save UV as other pattern components
uuuulala Oct 31, 2025
9211b7e
new u_distortion control
uuuulala Nov 3, 2025
b3f79fc
Merge branch 'main' into paper-texture-adjustments
uuuulala Nov 18, 2025
83dc796
Merge branch 'main' into paper-texture-adjustments
uuuulala Nov 19, 2025
fec0d3d
opacity removes, 3 x sizes adjusted
uuuulala Nov 19, 2025
9142700
glsl clean-up
uuuulala Nov 19, 2025
f135cee
tweaking blending
uuuulala Nov 19, 2025
43cc2cd
weights readjustment
uuuulala Nov 19, 2025
feae82c
fiber to distort the image less
uuuulala Nov 19, 2025
ab97445
saving progress on straight folds
uuuulala Nov 21, 2025
f1aab32
grids!
uuuulala Nov 21, 2025
e6b4288
both shader and presets adjustments
uuuulala Nov 22, 2025
09646b3
various adjustments
uuuulala Nov 23, 2025
78277df
various adjustments
uuuulala Nov 23, 2025
2fa0f07
various adjustments
uuuulala Nov 23, 2025
83c4b83
various adjustments
uuuulala Nov 23, 2025
f82a18c
Merge remote-tracking branch 'origin/main' into paper-texture-adjustm…
uuuulala Dec 9, 2025
3ba5c58
JSDcs update
uuuulala Dec 9, 2025
935d260
removing defs (to be taken from JSDocs once the list is approved)
uuuulala Dec 9, 2025
ede418a
post-merge fix
uuuulala Dec 9, 2025
978f6e4
Merge remote-tracking branch 'origin/main' into paper-texture-adjustm…
uuuulala Dec 17, 2025
aa83ad4
post-merging tweaks
uuuulala Dec 17, 2025
8cfb80f
Merge remote-tracking branch 'origin/main' into paper-texture-adjustm…
uuuulala Jan 13, 2026
4193916
profiler added
uuuulala Jan 13, 2026
164e5bf
fiber noise opt
uuuulala Jan 13, 2026
5b079b2
fiber seed remove
uuuulala Jan 13, 2026
bfe17fa
save res
uuuulala Jan 13, 2026
6ba8791
RF opt
uuuulala Jan 13, 2026
4fa8e7e
getCrumples opt
uuuulala Jan 13, 2026
2910fd3
small rearrangement
uuuulala Jan 13, 2026
67083c3
folds opt1
uuuulala Jan 13, 2026
8d895ec
folds opt2
uuuulala Jan 13, 2026
34abca5
grid opt1
uuuulala Jan 13, 2026
3a6fca3
pattern construct
uuuulala Jan 13, 2026
fbcc3f7
grid progr
uuuulala Jan 13, 2026
f6589fd
roughness small opt
uuuulala Jan 13, 2026
0bd2060
texture tweaks
uuuulala Jan 13, 2026
bf44250
normal preset back
uuuulala Jan 13, 2026
154e964
folds tweaks
uuuulala Jan 14, 2026
a498fc9
tweaks
uuuulala Jan 18, 2026
ebbacaa
gridShape to affect folds
uuuulala Jan 18, 2026
2dcba0b
gridShape => foldsShape renaming
uuuulala Jan 18, 2026
7c4bbd7
merging folds and grid
uuuulala Jan 18, 2026
a9e462a
branching folds selector
uuuulala Jan 18, 2026
e226469
contrast removed + tweaks
uuuulala Jan 18, 2026
c5a171c
tweaks
uuuulala Jan 18, 2026
1f87255
saving image distortion options
uuuulala Jan 19, 2026
7353c68
saving blending (not final)
uuuulala Jan 19, 2026
904ff3a
tweaks
uuuulala Jan 21, 2026
0758076
simplification
uuuulala Jan 21, 2026
f6b8541
crumples second layer removed
uuuulala Jan 21, 2026
e827da8
frame simplification
uuuulala Jan 21, 2026
bf7dc6a
small optimisations
uuuulala Jan 21, 2026
77d54da
output back
uuuulala Jan 21, 2026
52e3978
presets tweaks
uuuulala Jan 21, 2026
a89fb08
clamping fiber
uuuulala Jan 21, 2026
5b1640a
folds tweak
uuuulala Jan 21, 2026
c5f895f
Merge remote-tracking branch 'origin/main' into paper-texture-adjustm…
uuuulala Jan 21, 2026
fc40482
removing performance profiling
uuuulala Jan 21, 2026
2f6fbb5
tweaks
uuuulala Jan 21, 2026
3053fad
distortion to -1..1
uuuulala Jan 21, 2026
3d28192
scd folds line w/ distortion
uuuulala Jan 22, 2026
94bedcd
soft image frame edges
uuuulala Jan 22, 2026
adb2eca
soft image frame edges: fix
uuuulala Jan 22, 2026
162e185
soft image frame edges: fix #2
uuuulala Jan 22, 2026
122112b
soft image frame edges: another amount calculation
uuuulala Jan 22, 2026
b7e566f
normalising foldCount
uuuulala Jan 22, 2026
acac5a2
reversed foldCount in creases mode
uuuulala Jan 22, 2026
812e382
tweaking edge blur amount
uuuulala Jan 22, 2026
ada1e16
crumples to almost not affect the distortion
uuuulala Jan 22, 2026
ca4bed6
distortion polishing
uuuulala Jan 25, 2026
b85f104
test param for folds distortion curviness
uuuulala Jan 26, 2026
435e173
edge softness fix prep
uuuulala Jan 26, 2026
0a53937
edge distortion fixed
uuuulala Jan 26, 2026
0f1a85d
edge distortion tweaking
uuuulala Jan 26, 2026
cb0df04
edge distortion tweaking
uuuulala Jan 26, 2026
519f68a
edge softness param added
uuuulala Jan 26, 2026
aa297b6
edge softness tweaking
uuuulala Jan 26, 2026
a307d2c
edge softness tweaking
uuuulala Jan 26, 2026
cd053b9
pure blendMultiply
uuuulala Jan 26, 2026
0064951
blending reworked
uuuulala Jan 26, 2026
a120c6e
tweaking test2
uuuulala Jan 26, 2026
34c4e1f
backing test & test2
uuuulala Jan 26, 2026
44188ef
60% fade for folds
uuuulala Jan 26, 2026
e9c4e4d
40% fade for folds, 0% fade for creases
uuuulala Jan 26, 2026
6f849eb
fade logic fix
uuuulala Jan 26, 2026
3fb266a
fade logic update + img fade
uuuulala Jan 26, 2026
97c81be
creases fix
uuuulala Jan 26, 2026
c7bf9e5
spreadPreset as it was meant to be
uuuulala Jan 26, 2026
a8d6a35
multiple changes
uuuulala Jan 27, 2026
a507061
presets tweaks
uuuulala Jan 27, 2026
7b2a23f
maxFoldCount to metadata
uuuulala Jan 28, 2026
99b2c31
backgroundFade added
uuuulala Jan 28, 2026
558dafe
distortion refine
uuuulala Jan 28, 2026
7f35d0d
clean up
uuuulala Jan 28, 2026
248d9cc
vert distortion cleanup
uuuulala Jan 28, 2026
bc5c02f
tweaking distortion and presets
uuuulala Mar 19, 2026
19dab53
backgroundFade => boolean background
uuuulala Mar 21, 2026
372f816
smoother distortion on folds
uuuulala Mar 21, 2026
de93150
conditional UI
uuuulala Mar 21, 2026
d25ca08
saving some PT progress
uuuulala Mar 25, 2026
1311c2a
LOD saved
uuuulala Apr 26, 2026
3240f5f
LOD working fine
uuuulala Apr 26, 2026
4bc7265
small opt
uuuulala Apr 26, 2026
1299164
roughness to share
uuuulala Apr 26, 2026
d276282
roughnessSize added
uuuulala Apr 27, 2026
517922c
upd
uuuulala Apr 27, 2026
70cb710
upd
uuuulala Apr 27, 2026
06372cd
zero conditions wrap
uuuulala Apr 27, 2026
9a5f493
saving prog
uuuulala Apr 27, 2026
97272c8
to share
uuuulala Apr 28, 2026
193e732
preset tweaks
uuuulala Apr 28, 2026
2339405
crumples removed
uuuulala May 4, 2026
9c66c16
shadow removed
uuuulala May 4, 2026
2c3aa3c
Merge branch 'main' into paper-texture-adjustments
uuuulala Jul 9, 2026
625af59
more on conditional params
uuuulala Jul 9, 2026
5a8b853
colorBack #00000000 support
uuuulala Jul 10, 2026
cd8be99
colorBack #00000000 support (full)
uuuulala Jul 10, 2026
d5d1d51
presets update
uuuulala Jul 10, 2026
328cf15
back to fixing the color mix
uuuulala Jul 10, 2026
d081c1f
only FG color to use for blending, better hor shape, 2-dir offset
uuuulala Jul 12, 2026
52b143b
conditional props to docs website
uuuulala Jul 12, 2026
3d1a42a
Merge branch 'docs-conditional-params' into paper-texture-adjustments
uuuulala Jul 12, 2026
803f0f5
build fix
uuuulala Jul 12, 2026
5b272b2
sync with main
uuuulala Aug 14, 2026
bdcb999
ControlRules removal
uuuulala Aug 14, 2026
f748c82
Merge branch 'main' into paper-texture-adjustments
uuuulala Aug 14, 2026
d00439c
foldsShape backed to 1
uuuulala Aug 14, 2026
920b64a
control rules full removal
uuuulala Aug 15, 2026
7b8e7e6
defs update
uuuulala Aug 15, 2026
66b9b87
remove conditional relations between props
uuuulala Aug 15, 2026
f94c128
big update
uuuulala Aug 17, 2026
7a41e14
no fade
uuuulala Aug 17, 2026
7fce1fa
-
uuuulala Aug 17, 2026
50b05f6
-
uuuulala Aug 17, 2026
bfb6640
-
uuuulala Aug 17, 2026
46600dc
presets
uuuulala Aug 17, 2026
8f1e8ae
tweaks and presets
uuuulala Aug 18, 2026
72bcbd2
hash22 for drops
uuuulala Aug 18, 2026
0720189
colorShadow
uuuulala Aug 19, 2026
25e270f
merging issue on Water
uuuulala Aug 19, 2026
f3e43c3
defs apss 1
uuuulala Aug 19, 2026
5cac77d
defs pass 1
uuuulala Aug 19, 2026
6713625
folds upd
uuuulala Aug 23, 2026
2e865f8
preset adjusted
uuuulala Aug 23, 2026
f5cf08b
preset adjusted
uuuulala Aug 23, 2026
8f82ed7
small opt
uuuulala Aug 23, 2026
389adac
folds 2nd UV removed
uuuulala Aug 23, 2026
9f6b9ee
lightAngle as a single uniform
uuuulala Aug 23, 2026
87bcef4
preset
uuuulala Aug 23, 2026
7fc2fb3
preset
uuuulala Aug 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions docs/src/app/(shaders)/paper-texture/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useControls, button, folder } from 'leva';
import { setParamsSafe, useResetLevaParams } from '@/helpers/use-reset-leva-params';
import { usePresetHighlight } from '@/helpers/use-preset-highlight';
import { cleanUpLevaParams } from '@/helpers/clean-up-leva-params';
import { ShaderFit } from '@paper-design/shaders';
import { ShaderFit, paperTextureMeta } from '@paper-design/shaders';
import { levaImageButton, levaDeleteImageButton } from '@/helpers/leva-image-button';
import { useState, useEffect, useCallback } from 'react';
import { toHsla } from '@/helpers/color-utils';
Expand Down Expand Up @@ -68,20 +68,27 @@ const PaperTextureWithControls = () => {
);
return {
colorBack: { value: toHsla(defaults.colorBack), order: 100 },
colorFront: { value: toHsla(defaults.colorFront), order: 101 },
contrast: { value: defaults.contrast, min: 0, max: 1, order: 200 },
roughness: { value: defaults.roughness, min: 0, max: 1, order: 201 },
fiber: { value: defaults.fiber, min: 0, max: 1, order: 202 },
fiberSize: { value: defaults.fiberSize, min: 0.01, max: 1, order: 203 },
crumples: { value: defaults.crumples, min: 0, max: 1, order: 204 },
crumpleSize: { value: defaults.crumpleSize, min: 0.01, max: 1, order: 205 },
folds: { value: defaults.folds, min: 0, max: 1, order: 206 },
foldCount: { value: defaults.foldCount, min: 1, max: 15, step: 1, order: 207 },
drops: { value: defaults.drops, min: 0, max: 1, order: 209 },
fade: { value: defaults.fade, min: 0, max: 1, order: 208 },
seed: { value: defaults.seed, min: 0, step: 1, max: 1000, order: 250 },
scale: { value: defaults.scale, min: 0.1, max: 4, order: 300 },
fit: { value: defaults.fit, options: ['contain', 'cover'] as ShaderFit[], order: 301 },
colorShadow: { value: toHsla(defaults.colorShadow), order: 101 },
seed: { value: defaults.seed, min: 0, step: 1, max: 1000, order: 200 },
lightAngle: { value: defaults.lightAngle, min: 0, max: 360, order: 201 },
roughness: { value: defaults.roughness, min: 0, max: 1, order: 300 },
roughnessSize: { value: defaults.roughnessSize, min: 0, max: 1, order: 301 },
fiber: { value: defaults.fiber, min: 0, max: 1, order: 310 },
fiberSize: { value: defaults.fiberSize, min: 0, max: 1, order: 311 },
folds: { value: defaults.folds, min: 0, max: 1, order: 320 },
foldCount: { value: defaults.foldCount, min: 1, max: paperTextureMeta.maxFoldCount, step: 1, order: 321 },
creases: { value: defaults.creases, min: 0, max: 1, order: 330 },
creaseSizeX: { value: defaults.creaseSizeX, min: 0, max: 1, order: 331 },
creaseOffsetX: { value: defaults.creaseOffsetX, min: 0, max: 1, order: 332 },
creaseSizeY: { value: defaults.creaseSizeY, min: 0, max: 1, order: 333 },
creaseOffsetY: { value: defaults.creaseOffsetY, min: 0, max: 1, order: 334 },
drops: { value: defaults.drops, min: 0, max: 1, order: 340 },
blending: { value: defaults.blending, min: 0, max: 1, order: 350 },
distortion: { value: defaults.distortion, min: -1, max: 1, order: 351 },
background: { value: defaults.background, order: 352 },

scale: { value: defaults.scale, min: 0.5, max: 10, order: 400 },
fit: { value: defaults.fit, options: ['contain', 'cover'] as ShaderFit[], order: 401 },
Image: folder(
{
'Upload image': levaImageButton(setImageWithoutStatus),
Expand Down
113 changes: 81 additions & 32 deletions docs/src/shader-defs/paper-texture-def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const defaultParams = paperTexturePresets[0].params;
export const paperTextureDef: ShaderDef = {
name: 'Paper Texture',
description:
'A static texture built from multiple noise layers, usable for a realistic paper and cardboard surfaces. Can be used as a image filter or as a texture.',
'Static paper-like texture built from a combination of grain, noise and multiple fold patterns. Works as an image filter or as a standalone texture.',
params: [
{
name: 'image',
Expand All @@ -19,70 +19,78 @@ export const paperTextureDef: ShaderDef = {
type: 'string',
defaultValue: defaultParams.colorBack,
isColor: true,
description: 'Background color',
description: 'The color behind the image, usually light',
},
{
name: 'colorFront',
name: 'colorShadow',
type: 'string',
defaultValue: defaultParams.colorFront,
defaultValue: defaultParams.colorShadow,
isColor: true,
description: 'Foreground color',
description: 'The color used for folds, creases, grain and speckles, blends into the image',
},
{
name: 'contrast',
name: 'blending',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.contrast,
description: 'Blending behavior (sharper vs. smoother color transitions)',
defaultValue: defaultParams.blending,
description:
'How much the image is printed into the paper (0 = exact image, 1 = image multiplied with the pattern), needs image',
},
{
name: 'roughness',
name: 'distortion',
type: 'number',
min: 0,
min: -1,
max: 1,
defaultValue: defaultParams.roughness,
description: 'Pixel noise, related to canvas (not scalable)',
defaultValue: defaultParams.distortion,
description:
'How much the image bends with the paper surface; negative values bend it the opposite direction (needs image)',
},
{
name: 'fiber',
name: 'background',
type: 'boolean',
defaultValue: defaultParams.background,
description: 'Shows or hides the paper texture outside the distorted image frame (needs image)',
},
{
name: 'roughness',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.fiber,
description: 'Curly-shaped noise',
defaultValue: defaultParams.roughness,
description: 'Grain noise, sized independently of scaling, with its level of detail depending on the scale',
},
{
name: 'fiberSize',
name: 'roughnessSize',
type: 'number',
min: 0.01,
min: 0,
max: 1,
defaultValue: defaultParams.fiberSize,
description: 'Curly-shaped noise scale (needs fiber > 0)',
defaultValue: defaultParams.roughnessSize,
description: 'Scale of the roughness noise (needs roughness > 0)',
},
{
name: 'crumples',
name: 'fiber',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.crumples,
description: 'Cell-based crumple pattern',
defaultValue: defaultParams.fiber,
description: 'Curly fiber noise, simulating the real paper',
},
{
name: 'crumpleSize',
name: 'fiberSize',
type: 'number',
min: 0.01,
min: 0,
max: 1,
defaultValue: defaultParams.crumpleSize,
description: 'Cell-based crumple pattern scale (needs crumples > 0)',
defaultValue: defaultParams.fiberSize,
description: 'Scale of the fiber noise (needs fiber > 0)',
},
{
name: 'folds',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.folds,
description: 'Depth of the folds (needs contrast > 0 to shade the surface)',
description: 'Depth of the centered, irregular field of facets across the sheet',
},
{
name: 'foldCount',
Expand All @@ -94,28 +102,69 @@ export const paperTextureDef: ShaderDef = {
description: 'Number of folds (15 max), needs folds > 0',
},
{
name: 'fade',
name: 'creases',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.fade,
description: 'Big-scale noise mask applied to the pattern',
defaultValue: defaultParams.creases,
description: 'Depth of the straight creases, alternating between ridges and valleys',
},
{
name: 'creaseSizeX',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.creaseSizeX,
description: 'Size of the vertical creases (needs creases > 0)',
},
{
name: 'creaseSizeY',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.creaseSizeY,
description: 'Size of the horizontal creases (needs creases > 0)',
},
{
name: 'creaseOffsetX',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.creaseOffsetX,
description: 'Shifts the vertical creases across the surface (needs creases > 0)',
},
{
name: 'creaseOffsetY',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.creaseOffsetY,
description: 'Shifts the horizontal creases across the surface (needs creases > 0)',
},
{
name: 'lightAngle',
type: 'number',
min: 0,
max: 360,
defaultValue: defaultParams.lightAngle,
description:
'Direction the surface is lit from, clockwise from the top of the canvas, needs folds or creases > 0',
},
{
name: 'drops',
type: 'number',
min: 0,
max: 1,
defaultValue: defaultParams.drops,
description: 'The visibility of speckle pattern',
description: 'Visibility of the speckle pattern',
},
{
name: 'seed',
type: 'number',
min: 0,
max: 1000,
defaultValue: defaultParams.seed,
description: 'Seed applied to folds, crumples, dots and fade',
description: 'Seed applied to folds and drops',
},
...staticImageCommonParams,
],
Expand Down
1 change: 1 addition & 0 deletions packages/shaders-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export {
grainGradientMeta,
meshGradientMeta,
metaballsMeta,
paperTextureMeta,
pulsingBorderMeta,
simplexNoiseMeta,
smokeRingMeta,
Expand Down
Loading
Loading