postext-folio 0.52.2 → 0.52.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ import { PlaneGeometry, Mesh, ShaderMaterial } from 'three';
2
+ /** Columns and rows of a leaf's mesh: fine enough for a tight roll. */
3
+ export declare const NX = 96;
4
+ export declare const NY = 120;
5
+ /** Vertical field of view: low, so a page at rest maps 1:1 onto the DOM spread. */
6
+ export declare const FOV = 26;
7
+ /** Milliseconds one leaf takes to turn. */
8
+ export declare const DURATION = 1000;
9
+ /** A leaf follows the one before it once that one is this far through its turn. */
10
+ export declare const GAP = 0.14;
11
+ export declare const ease: (t: number) => number;
12
+ export declare const easeOut: (t: number) => number;
13
+ /** A point in a leaf's own coordinates: `u` from the spine (0 … W), `v`
14
+ * from the middle of the page (−H/2 … H/2). Backward turns mirror x. */
15
+ export interface Pt {
16
+ u: number;
17
+ v: number;
18
+ }
19
+ /**
20
+ * How a leaf folds when the point `G` of it has been carried to `P`: the
21
+ * paper stays flat up to a fold line, rolls round a cylinder of radius R
22
+ * and lies over itself beyond it, back up (the page-curl cylinder). The
23
+ * fold is square to the pull, placed so the point taken lands under the
24
+ * hand, and never crosses the spine the leaf is sewn to. R grows as the
25
+ * page lifts and shrinks to nothing as it lands on the other side.
26
+ */
27
+ export declare function foldOf(G: Pt, P: Pt, W: number, H: number): {
28
+ F: {
29
+ u: number;
30
+ v: number;
31
+ };
32
+ n: {
33
+ u: number;
34
+ v: number;
35
+ };
36
+ R: number;
37
+ } | null;
38
+ type Fold = NonNullable<ReturnType<typeof foldOf>>;
39
+ /** How far through its turn a leaf is: the point taken, from where it
40
+ * was to its mirror image across the spine. */
41
+ export declare function progressFrom(G: Pt, P: Pt): number;
42
+ /** The hand can carry the point taken no farther from the spine's ends
43
+ * than the paper reaches. */
44
+ export declare function reach(G: Pt, P: Pt, H: number): Pt;
45
+ /** Lays a leaf's mesh out for a fold (flat when there is none). */
46
+ export declare function layLeaf(geometry: PlaneGeometry, fold: Fold | null, forward: boolean, W: number, H: number, z0: number): void;
47
+ export type PageMesh = Mesh<PlaneGeometry, ShaderMaterial>;
48
+ export interface Turn {
49
+ forward: boolean;
50
+ /** The point taken, and where the hand holds it now. */
51
+ G: Pt;
52
+ P: Pt;
53
+ /** Held by the reader's pointer: `P` follows `aim`. */
54
+ held?: {
55
+ aim: Pt;
56
+ samples: {
57
+ t: number;
58
+ q: number;
59
+ }[];
60
+ };
61
+ /** Carried by the animation: from → to, lifted `arc` on the way. */
62
+ anim?: {
63
+ start: number;
64
+ duration: number;
65
+ from: Pt;
66
+ to: Pt;
67
+ arc: number;
68
+ lands: boolean;
69
+ };
70
+ }
71
+ export interface Airborne {
72
+ k: number;
73
+ q: number;
74
+ forward: boolean;
75
+ fold: Fold | null;
76
+ mesh: PageMesh;
77
+ }
78
+ export {};
79
+ //# sourceMappingURL=leaf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.d.ts","sourceRoot":"","sources":["../../src/pageFlipFlat/leaf.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,uEAAuE;AACvE,eAAO,MAAM,EAAE,KAAK,CAAC;AACrB,eAAO,MAAM,EAAE,MAAM,CAAC;AACtB,mFAAmF;AACnF,eAAO,MAAM,GAAG,KAAK,CAAC;AAGtB,2CAA2C;AAC3C,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,mFAAmF;AACnF,eAAO,MAAM,GAAG,OAAO,CAAC;AAExB,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAAgE,CAAC;AAC/F,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,WAA2B,CAAC;AAM7D;yEACyE;AACzE,MAAM,WAAW,EAAE;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;;GAOG;AACH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C3F;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB"}
@@ -0,0 +1,100 @@
1
+ /** Columns and rows of a leaf's mesh: fine enough for a tight roll. */
2
+ export const NX = 96;
3
+ export const NY = 120;
4
+ /** Vertical field of view: low, so a page at rest maps 1:1 onto the DOM spread. */
5
+ export const FOV = 26;
6
+ /** Radius of the roll at mid-turn, relative to the page's width. */
7
+ const ROLL = 0.11;
8
+ /** Milliseconds one leaf takes to turn. */
9
+ export const DURATION = 1000;
10
+ /** A leaf follows the one before it once that one is this far through its turn. */
11
+ export const GAP = 0.14;
12
+ export const ease = (t) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);
13
+ export const easeOut = (t) => 1 - Math.pow(1 - t, 3);
14
+ const smooth = (a, b, x) => {
15
+ const t = Math.min(1, Math.max(0, (x - a) / (b - a)));
16
+ return t * t * (3 - 2 * t);
17
+ };
18
+ /**
19
+ * How a leaf folds when the point `G` of it has been carried to `P`: the
20
+ * paper stays flat up to a fold line, rolls round a cylinder of radius R
21
+ * and lies over itself beyond it, back up (the page-curl cylinder). The
22
+ * fold is square to the pull, placed so the point taken lands under the
23
+ * hand, and never crosses the spine the leaf is sewn to. R grows as the
24
+ * page lifts and shrinks to nothing as it lands on the other side.
25
+ */
26
+ export function foldOf(G, P, W, H) {
27
+ const du = G.u - P.u;
28
+ const dv = G.v - P.v;
29
+ const D = Math.hypot(du, dv);
30
+ if (D < 0.5)
31
+ return null;
32
+ const n = { u: du / D, v: dv / D };
33
+ const q = progressFrom(G, P);
34
+ const R = ROLL * W * (0.3 + 0.7 * smooth(0, 0.2, q)) * (1 - smooth(0.62, 1, q)) * Math.min(1, D / (0.1 * W));
35
+ const roll = Math.PI * R;
36
+ let c = (D + roll * Math.min(1, roll > 0 ? D / roll : 0)) / 2;
37
+ for (const S of [-H / 2, H / 2])
38
+ c = Math.min(c, G.u * n.u + (G.v - S) * n.v);
39
+ if (c <= 0)
40
+ return null;
41
+ return { F: { u: G.u - n.u * c, v: G.v - n.v * c }, n, R };
42
+ }
43
+ /** How far through its turn a leaf is: the point taken, from where it
44
+ * was to its mirror image across the spine. */
45
+ export function progressFrom(G, P) {
46
+ return Math.min(1, Math.max(0, (G.u - P.u) / (2 * G.u)));
47
+ }
48
+ /** The hand can carry the point taken no farther from the spine's ends
49
+ * than the paper reaches. */
50
+ export function reach(G, P, H) {
51
+ let { u, v } = P;
52
+ for (let i = 0; i < 4; i++) {
53
+ for (const S of [-H / 2, H / 2]) {
54
+ const r = Math.hypot(G.u, G.v - S);
55
+ const d = Math.hypot(u, v - S);
56
+ if (d > r) {
57
+ u *= r / d;
58
+ v = S + ((v - S) * r) / d;
59
+ }
60
+ }
61
+ }
62
+ return { u, v };
63
+ }
64
+ /** Lays a leaf's mesh out for a fold (flat when there is none). */
65
+ export function layLeaf(geometry, fold, forward, W, H, z0) {
66
+ const pos = geometry.attributes.position;
67
+ const sx = forward ? 1 : -1;
68
+ for (let iy = 0; iy <= NY; iy++) {
69
+ const v = (0.5 - iy / NY) * H;
70
+ for (let ix = 0; ix <= NX; ix++) {
71
+ const u = (ix / NX) * W;
72
+ let x = u;
73
+ let y = v;
74
+ let z = 0;
75
+ if (fold) {
76
+ const { F, n, R } = fold;
77
+ const d = (u - F.u) * n.u + (v - F.v) * n.v;
78
+ if (d > 0) {
79
+ let dd;
80
+ if (R < 1e-3)
81
+ dd = -d;
82
+ else if (d < Math.PI * R) {
83
+ dd = R * Math.sin(d / R);
84
+ z = R * (1 - Math.cos(d / R));
85
+ }
86
+ else {
87
+ dd = -(d - Math.PI * R);
88
+ z = 2 * R;
89
+ }
90
+ x = u - n.u * (d - dd);
91
+ y = v - n.v * (d - dd);
92
+ }
93
+ }
94
+ pos.setXYZ(iy * (NX + 1) + ix, sx * x, y, z + z0);
95
+ }
96
+ }
97
+ pos.needsUpdate = true;
98
+ geometry.computeVertexNormals();
99
+ }
100
+ //# sourceMappingURL=leaf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.js","sourceRoot":"","sources":["../../src/pageFlipFlat/leaf.ts"],"names":[],"mappings":"AAIA,uEAAuE;AACvE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;AACrB,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;AACtB,mFAAmF;AACnF,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;AACtB,oEAAoE;AACpE,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,2CAA2C;AAC3C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAC7B,mFAAmF;AACnF,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC;AAExB,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7D,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,EAAE;IACjD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CA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1,30 @@
1
+ import { Vector3, Texture, Vector4, ShaderMaterial } from 'three';
2
+ /** Towards the light: from above, a little to the upper left. */
3
+ export declare const LIGHT: Vector3;
4
+ export declare const VERTEX = "\n varying vec2 vUv;\n varying vec3 vNormal;\n varying vec3 vPos;\n void main() {\n vUv = uv;\n vNormal = normal;\n vPos = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n";
5
+ export declare const DESK = "\n uniform float uW;\n uniform float uH;\n uniform vec2 uPages;\n varying vec2 vUv;\n varying vec3 vNormal;\n varying vec3 vPos;\n \n uniform sampler2D uShadowMap;\n uniform vec4 uShadowBox;\n uniform vec3 uLd;\n uniform float uShadowOn;\n\n float casterAt(vec2 s) {\n vec2 uv = (s - uShadowBox.xy) / uShadowBox.zw;\n if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) return -1e4;\n return texture2D(uShadowMap, uv).r - 10.0;\n }\n\n // How much of the sky paper lifted nearby hides: 0 \u2026 1.\n float occlusionAt(vec3 p, vec2 s, float spin) {\n float occ = 0.0;\n for (int i = 0; i < 16; i++) {\n float a = float(i) * 2.39996 + spin;\n float r = sqrt((float(i) + 0.5) / 16.0) * 72.0;\n float h = casterAt(s + r * vec2(cos(a), sin(a)));\n occ += clamp((h - p.z - 2.5) / (r + 14.0), 0.0, 1.0);\n }\n return occ / 16.0;\n }\n\n // The light lost at p: 0 \u2026 about 0.6.\n float shadowAt(vec3 p) {\n if (uShadowOn < 0.5) return 0.0;\n vec2 s = p.xy - uLd.xy / uLd.z * p.z;\n float spin = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453) * 6.2831;\n float ambient = 0.34 * occlusionAt(p, s, spin);\n const float bias = 2.5;\n float sum = 0.0;\n float found = 0.0;\n for (int i = 0; i < 12; i++) {\n float a = float(i) * 2.39996 + spin;\n vec2 o = sqrt((float(i) + 0.5) / 12.0) * vec2(cos(a), sin(a));\n float h = casterAt(s + o * 16.0);\n if (h > p.z + bias) {\n sum += h;\n found += 1.0;\n }\n }\n if (found < 0.5) return ambient;\n float gap = sum / found - p.z;\n float spread = clamp(gap * 0.3, 1.5, 40.0);\n float hit = 0.0;\n for (int i = 0; i < 16; i++) {\n float a = float(i) * 2.39996 + spin;\n vec2 o = sqrt((float(i) + 0.5) / 16.0) * vec2(cos(a), sin(a));\n if (casterAt(s + o * spread) > p.z + bias) hit += 1.0;\n }\n // Paper high above casts a paler shadow (more light gets round it).\n float direct = 0.4 * hit / 16.0 * (1.0 - 0.4 * smoothstep(30.0, 300.0, gap));\n return min(0.6, 1.0 - (1.0 - direct) * (1.0 - ambient));\n }\n\n\n float erf(float x) {\n float a = abs(x);\n float t = 1.0 / (1.0 + 0.3275911 * a);\n float y = 1.0 - (((((1.061405429 * t - 1.453152027) * t) + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * exp(-a * a);\n return sign(x) * y;\n }\n float band(float x, float lo, float hi, float sigma) {\n return 0.5 * (erf((x - lo) / (sigma * 1.4142)) - erf((x - hi) / (sigma * 1.4142)));\n }\n // box-shadow: 0 1px 1px .35, 0 16px 36px -8px .65 (CSS y runs down).\n float page(vec2 p, float x0, float x1) {\n float h = uH / 2.0;\n float soft = 0.65 * band(p.x, x0 + 8.0, x1 - 8.0, 18.0) * band(p.y + 16.0, -h + 8.0, h - 8.0, 18.0);\n float hard = 0.35 * band(p.x, x0, x1, 0.5) * band(p.y + 1.0, -h, h, 0.5);\n return 1.0 - (1.0 - soft) * (1.0 - hard);\n }\n\n void main() {\n vec2 p = vPos.xy;\n float clear = 1.0;\n if (uPages.x > 0.5) clear *= 1.0 - page(p, -uW, 0.0);\n if (uPages.y > 0.5) clear *= 1.0 - page(p, 0.0, uW);\n clear *= 1.0 - 1.3 * shadowAt(vPos);\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0 - clear);\n }\n";
6
+ export declare const CASTER_VERTEX = "\n uniform vec3 uLd;\n varying float vZ;\n void main() {\n vZ = position.z;\n vec2 s = position.xy - uLd.xy / uLd.z * position.z;\n gl_Position = projectionMatrix * viewMatrix * vec4(s, 0.0, 1.0);\n }\n";
7
+ export declare const CASTER_FRAGMENT = "\n varying float vZ;\n void main() {\n gl_FragColor = vec4(vZ + 10.0, 0.0, 0.0, 1.0);\n }\n";
8
+ /** The shadow uniforms every receiving material shares (same objects). */
9
+ export declare const shadowUniforms: {
10
+ uShadowMap: {
11
+ value: Texture | null;
12
+ };
13
+ uShadowBox: {
14
+ value: Vector4;
15
+ };
16
+ uLd: {
17
+ value: Vector3;
18
+ };
19
+ uShadowOn: {
20
+ value: number;
21
+ };
22
+ };
23
+ /** The book's paper, for its blank pages (shared too). */
24
+ export declare const paperUniform: {
25
+ uPaper: {
26
+ value: Vector3;
27
+ };
28
+ };
29
+ export declare function material(lit: boolean, mirror: boolean): ShaderMaterial;
30
+ //# sourceMappingURL=shaders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shaders.d.ts","sourceRoot":"","sources":["../../src/pageFlipFlat/shaders.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAE9E,iEAAiE;AACjE,eAAO,MAAM,KAAK,SAAyC,CAAC;AAE5D,eAAO,MAAM,MAAM,0OAUlB,CAAC;AAyHF,eAAO,MAAM,IAAI,kpGAkChB,CAAC;AAIF,eAAO,MAAM,aAAa,4NAQzB,CAAC;AACF,eAAO,MAAM,eAAe,sGAK3B,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,cAAc;;eACI,OAAO,GAAG,IAAI;;;;;;;;;;;CAI5C,CAAC;AACF,0DAA0D;AAC1D,eAAO,MAAM,YAAY;;;;CAA8C,CAAC;AAExE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,kBAiBrD"}
@@ -0,0 +1,214 @@
1
+ // The flat flipper's light, its page and desk shaders with the key
2
+ // light's shadow, the shadow casters and the page material
3
+ // (#1276: split out of pageFlipFlat.ts).
4
+ import { Vector3, Vector4, ShaderMaterial, DoubleSide } from 'three';
5
+ /** Towards the light: from above, a little to the upper left. */
6
+ export const LIGHT = new Vector3(-0.22, 0.3, 1).normalize();
7
+ export const VERTEX = /* glsl */ `
8
+ varying vec2 vUv;
9
+ varying vec3 vNormal;
10
+ varying vec3 vPos;
11
+ void main() {
12
+ vUv = uv;
13
+ vNormal = normal;
14
+ vPos = position;
15
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
16
+ }
17
+ `;
18
+ // Shadows are cast for real: each frame the leaves in the air are drawn,
19
+ // seen from the light, into a height map (the highest paper over each
20
+ // point, drawn in `draw`). A surface is in shadow where paper lies between
21
+ // it and the light; the penumbra widens with the gap, as a real one does
22
+ // (a blocker search, then a filter of that width). Paper lifted nearby
23
+ // also hides part of the sky from it (ambient occlusion): the soft
24
+ // darkening along a roll and round a flap.
25
+ const SHADOW = /* glsl */ `
26
+ uniform sampler2D uShadowMap;
27
+ uniform vec4 uShadowBox;
28
+ uniform vec3 uLd;
29
+ uniform float uShadowOn;
30
+
31
+ float casterAt(vec2 s) {
32
+ vec2 uv = (s - uShadowBox.xy) / uShadowBox.zw;
33
+ if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) return -1e4;
34
+ return texture2D(uShadowMap, uv).r - 10.0;
35
+ }
36
+
37
+ // How much of the sky paper lifted nearby hides: 0 … 1.
38
+ float occlusionAt(vec3 p, vec2 s, float spin) {
39
+ float occ = 0.0;
40
+ for (int i = 0; i < 16; i++) {
41
+ float a = float(i) * 2.39996 + spin;
42
+ float r = sqrt((float(i) + 0.5) / 16.0) * 72.0;
43
+ float h = casterAt(s + r * vec2(cos(a), sin(a)));
44
+ occ += clamp((h - p.z - 2.5) / (r + 14.0), 0.0, 1.0);
45
+ }
46
+ return occ / 16.0;
47
+ }
48
+
49
+ // The light lost at p: 0 … about 0.6.
50
+ float shadowAt(vec3 p) {
51
+ if (uShadowOn < 0.5) return 0.0;
52
+ vec2 s = p.xy - uLd.xy / uLd.z * p.z;
53
+ float spin = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453) * 6.2831;
54
+ float ambient = 0.34 * occlusionAt(p, s, spin);
55
+ const float bias = 2.5;
56
+ float sum = 0.0;
57
+ float found = 0.0;
58
+ for (int i = 0; i < 12; i++) {
59
+ float a = float(i) * 2.39996 + spin;
60
+ vec2 o = sqrt((float(i) + 0.5) / 12.0) * vec2(cos(a), sin(a));
61
+ float h = casterAt(s + o * 16.0);
62
+ if (h > p.z + bias) {
63
+ sum += h;
64
+ found += 1.0;
65
+ }
66
+ }
67
+ if (found < 0.5) return ambient;
68
+ float gap = sum / found - p.z;
69
+ float spread = clamp(gap * 0.3, 1.5, 40.0);
70
+ float hit = 0.0;
71
+ for (int i = 0; i < 16; i++) {
72
+ float a = float(i) * 2.39996 + spin;
73
+ vec2 o = sqrt((float(i) + 0.5) / 16.0) * vec2(cos(a), sin(a));
74
+ if (casterAt(s + o * spread) > p.z + bias) hit += 1.0;
75
+ }
76
+ // Paper high above casts a paler shadow (more light gets round it).
77
+ float direct = 0.4 * hit / 16.0 * (1.0 - 0.4 * smoothstep(30.0, 300.0, gap));
78
+ return min(0.6, 1.0 - (1.0 - direct) * (1.0 - ambient));
79
+ }
80
+ `;
81
+ // Colours are passed through untouched (textures and output both without
82
+ // colour management) so a page at rest matches the <img> pixel for pixel,
83
+ // spine gradient included (the CSS one, blended the way CSS blends it).
84
+ // Lighting never brightens: a page facing the reader is as the <img> is,
85
+ // turned from the light it darkens. On a mirrored stage (a right-bound
86
+ // book) the images are read back the right way round.
87
+ const FRAGMENT = /* glsl */ `
88
+ uniform sampler2D uFront;
89
+ uniform sampler2D uBack;
90
+ // 0 no page, 1 its image, 2 blank paper.
91
+ uniform float uHasFront;
92
+ uniform float uHasBack;
93
+ uniform vec3 uPaper;
94
+ uniform float uBlank;
95
+ uniform float uLit;
96
+ uniform float uMirror;
97
+ varying vec2 vUv;
98
+ varying vec3 vNormal;
99
+ varying vec3 vPos;
100
+ ${SHADOW}
101
+
102
+ float spine(float u, float a0, float a1) {
103
+ if (u < 0.03) return mix(a0, a1, u / 0.03);
104
+ if (u < 0.09) return mix(a1, 0.0, (u - 0.03) / 0.06);
105
+ return 0.0;
106
+ }
107
+
108
+ void main() {
109
+ bool front = gl_FrontFacing;
110
+ float has = front ? uHasFront : uHasBack;
111
+ vec3 col;
112
+ if (has < 0.5 && uBlank < 0.5) discard;
113
+ if (has < 0.5 || has > 1.5) {
114
+ col = uPaper;
115
+ } else {
116
+ float u = uMirror > 0.5 ? 1.0 - vUv.x : vUv.x;
117
+ col = front ? texture2D(uFront, vec2(u, vUv.y)).rgb : texture2D(uBack, vec2(1.0 - u, vUv.y)).rgb;
118
+ }
119
+ // uv.x is the distance from the spine on both faces.
120
+ col *= 1.0 - (front ? spine(vUv.x, 0.18, 0.05) : spine(vUv.x, 0.16, 0.04));
121
+
122
+ vec3 p = vPos;
123
+ if (uLit > 0.5) {
124
+ vec3 n = normalize(vNormal) * (front ? 1.0 : -1.0);
125
+ col *= mix(0.6, 1.0, clamp(dot(n, uLd) / uLd.z, 0.0, 1.0));
126
+ // Look the shadow up a little off the surface (no self-shadow acne).
127
+ p += n * 2.0;
128
+ }
129
+ col *= 1.0 - shadowAt(p);
130
+ gl_FragColor = vec4(col, 1.0);
131
+ }
132
+ `;
133
+ // The desk under the book: the pages' drop shadow (the CSS box-shadow of
134
+ // `.cb-lt-page`, a gaussian-blurred rectangle) and the leaves'.
135
+ export const DESK = /* glsl */ `
136
+ uniform float uW;
137
+ uniform float uH;
138
+ uniform vec2 uPages;
139
+ varying vec2 vUv;
140
+ varying vec3 vNormal;
141
+ varying vec3 vPos;
142
+ ${SHADOW}
143
+
144
+ float erf(float x) {
145
+ float a = abs(x);
146
+ float t = 1.0 / (1.0 + 0.3275911 * a);
147
+ float y = 1.0 - (((((1.061405429 * t - 1.453152027) * t) + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * exp(-a * a);
148
+ return sign(x) * y;
149
+ }
150
+ float band(float x, float lo, float hi, float sigma) {
151
+ return 0.5 * (erf((x - lo) / (sigma * 1.4142)) - erf((x - hi) / (sigma * 1.4142)));
152
+ }
153
+ // box-shadow: 0 1px 1px .35, 0 16px 36px -8px .65 (CSS y runs down).
154
+ float page(vec2 p, float x0, float x1) {
155
+ float h = uH / 2.0;
156
+ float soft = 0.65 * band(p.x, x0 + 8.0, x1 - 8.0, 18.0) * band(p.y + 16.0, -h + 8.0, h - 8.0, 18.0);
157
+ float hard = 0.35 * band(p.x, x0, x1, 0.5) * band(p.y + 1.0, -h, h, 0.5);
158
+ return 1.0 - (1.0 - soft) * (1.0 - hard);
159
+ }
160
+
161
+ void main() {
162
+ vec2 p = vPos.xy;
163
+ float clear = 1.0;
164
+ if (uPages.x > 0.5) clear *= 1.0 - page(p, -uW, 0.0);
165
+ if (uPages.y > 0.5) clear *= 1.0 - page(p, 0.0, uW);
166
+ clear *= 1.0 - 1.3 * shadowAt(vPos);
167
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0 - clear);
168
+ }
169
+ `;
170
+ // Draws the leaves as the light sees them: each point where its shadow
171
+ // falls on the desk plane, keeping the highest paper (max blending).
172
+ export const CASTER_VERTEX = /* glsl */ `
173
+ uniform vec3 uLd;
174
+ varying float vZ;
175
+ void main() {
176
+ vZ = position.z;
177
+ vec2 s = position.xy - uLd.xy / uLd.z * position.z;
178
+ gl_Position = projectionMatrix * viewMatrix * vec4(s, 0.0, 1.0);
179
+ }
180
+ `;
181
+ export const CASTER_FRAGMENT = /* glsl */ `
182
+ varying float vZ;
183
+ void main() {
184
+ gl_FragColor = vec4(vZ + 10.0, 0.0, 0.0, 1.0);
185
+ }
186
+ `;
187
+ /** The shadow uniforms every receiving material shares (same objects). */
188
+ export const shadowUniforms = {
189
+ uShadowMap: { value: null },
190
+ uShadowBox: { value: new Vector4(0, 0, 1, 1) },
191
+ uLd: { value: LIGHT },
192
+ uShadowOn: { value: 0 },
193
+ };
194
+ /** The book's paper, for its blank pages (shared too). */
195
+ export const paperUniform = { uPaper: { value: new Vector3(1, 1, 1) } };
196
+ export function material(lit, mirror) {
197
+ return new ShaderMaterial({
198
+ vertexShader: VERTEX,
199
+ fragmentShader: FRAGMENT,
200
+ side: DoubleSide,
201
+ uniforms: {
202
+ uFront: { value: null },
203
+ uBack: { value: null },
204
+ uHasFront: { value: 0 },
205
+ uHasBack: { value: 0 },
206
+ uBlank: { value: lit ? 1 : 0 },
207
+ uLit: { value: lit ? 1 : 0 },
208
+ uMirror: { value: mirror ? 1 : 0 },
209
+ ...shadowUniforms,
210
+ ...paperUniform,
211
+ },
212
+ });
213
+ }
214
+ //# sourceMappingURL=shaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shaders.js","sourceRoot":"","sources":["../../src/pageFlipFlat/shaders.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,2DAA2D;AAC3D,yCAAyC;AACzC,OAAO,EAAE,OAAO,EAAW,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9E,iEAAiE;AACjE,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AAE5D,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;;;;;;;;;;CAUhC,CAAC;AAEF,yEAAyE;AACzE,sEAAsE;AACtE,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,mEAAmE;AACnE,2CAA2C;AAC3C,MAAM,MAAM,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDzB,CAAC;AAEF,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE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C,EAAE;YACvB,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;YACtB,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAC9B,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAC5B,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YAClC,GAAG,cAAc;YACjB,GAAG,YAAY;SAChB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type SpreadSrc } from "./pageFlip.js";
1
+ import { type SpreadSrc } from './pageFlip.js';
2
2
  /**
3
3
  * Turns the pages of the light table's DOM spread. The book is a stack of
4
4
  * leaves: leaf k has spread k's recto on its front and spread k + 1's verso
@@ -1 +1 @@
1
- {"version":3,"file":"pageFlipFlat.d.ts","sourceRoot":"","sources":["../src/pageFlipFlat.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAoW7E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,eAAe;IAmDxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IAEZ,OAAO,CAAC,QAAQ;IAChB,2DAA2D;IAC3D,OAAO,CAAC,QAAQ;IAxDlB,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,MAAM,CAA2C;IACzD,OAAO,CAAC,IAAI,CAAW;IACvB,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,IAAI,CAAW;IACvB;6BACyB;IACzB,OAAO,CAAC,KAAK,CAAe;IAC5B,yDAAyD;IACzD,OAAO,CAAC,IAAI,CAAS;IACrB,oDAAoD;IACpD,OAA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