postext-folio 0.81.0 → 0.82.0
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.
- package/dist/bookGeometry.d.ts +5 -0
- package/dist/bookGeometry.d.ts.map +1 -1
- package/dist/bookGeometry.js +20 -4
- package/dist/bookGeometry.js.map +1 -1
- package/dist/pageFlip/leaf.d.ts +2 -5
- package/dist/pageFlip/leaf.d.ts.map +1 -1
- package/dist/pageFlip/leaf.js +2 -4
- package/dist/pageFlip/leaf.js.map +1 -1
- package/dist/pageFlip/materials.d.ts.map +1 -1
- package/dist/pageFlip/materials.js +5 -1
- package/dist/pageFlip/materials.js.map +1 -1
- package/dist/pageFlip/occlusion.d.ts +5 -2
- package/dist/pageFlip/occlusion.d.ts.map +1 -1
- package/dist/pageFlip/occlusion.js +9 -4
- package/dist/pageFlip/occlusion.js.map +1 -1
- package/dist/pageFlip/picture.d.ts +43 -0
- package/dist/pageFlip/picture.d.ts.map +1 -0
- package/dist/pageFlip/picture.js +210 -0
- package/dist/pageFlip/picture.js.map +1 -0
- package/dist/pageFlip.d.ts +1 -1
- package/dist/pageFlip.d.ts.map +1 -1
- package/dist/pageFlip.js +10 -22
- package/dist/pageFlip.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// The finished picture (#503, #1676): the scene drawn into a float
|
|
2
|
+
// picture, toned for the screen and smoothed; and, once the book lies at
|
|
3
|
+
// rest, the same view drawn a few more times, each a fraction of a pixel
|
|
4
|
+
// aside, and averaged. Kept out of pageFlip.ts for its size budget.
|
|
5
|
+
import { ConstantAlphaFactor, CustomBlending, HalfFloatType, LinearFilter, Mesh, OneMinusConstantAlphaFactor, OrthographicCamera, PlaneGeometry, Scene, ShaderMaterial, WebGLRenderTarget } from 'three';
|
|
6
|
+
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
7
|
+
import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass.js';
|
|
8
|
+
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
|
|
9
|
+
import { SMAAPass } from 'three/examples/jsm/postprocessing/SMAAPass.js';
|
|
10
|
+
import { occlusionUniforms } from './occlusion.js';
|
|
11
|
+
/** How many pictures of the book at rest are averaged. */
|
|
12
|
+
export const REST_SAMPLES = 16;
|
|
13
|
+
/** The average is shown from this many on: fewer still show steps the
|
|
14
|
+
* smoothed frame under it does not. */
|
|
15
|
+
const SHOW_FROM = 4;
|
|
16
|
+
/** The book lies at rest once nothing has drawn it for this long (ms): a
|
|
17
|
+
* hand turning the view draws a frame for each move it makes. */
|
|
18
|
+
const REST_MS = 120;
|
|
19
|
+
/** The `i`th term (from 1) of the Halton sequence in base `b`, 0 … 1. */
|
|
20
|
+
export function halton(i, b) {
|
|
21
|
+
let f = 1;
|
|
22
|
+
let r = 0;
|
|
23
|
+
for (let k = i; k > 0; k = Math.floor(k / b)) {
|
|
24
|
+
f /= b;
|
|
25
|
+
r += f * (k % b);
|
|
26
|
+
}
|
|
27
|
+
return r;
|
|
28
|
+
}
|
|
29
|
+
/** Where in its pixel the `i`th picture (from 1) is taken: an offset
|
|
30
|
+
* within half a pixel each way, the 16 of them spread evenly over it. */
|
|
31
|
+
export function restOffset(i) {
|
|
32
|
+
return [halton(i, 2) - 0.5, halton(i, 3) - 0.5];
|
|
33
|
+
}
|
|
34
|
+
const QUAD_VERTEX = /* glsl */ `
|
|
35
|
+
varying vec2 vUv;
|
|
36
|
+
void main() {
|
|
37
|
+
vUv = uv;
|
|
38
|
+
gl_Position = vec4(position.xy, 0.0, 1.0);
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
// One more picture into the average. They are averaged as light (the
|
|
42
|
+
// screen's curve undone): a page's edge half over a dark desk is half the
|
|
43
|
+
// page's light, which the curve's own values would darken into a step.
|
|
44
|
+
// Colour is kept times its alpha, as the canvas takes it.
|
|
45
|
+
const ADD_FRAGMENT = /* glsl */ `
|
|
46
|
+
uniform sampler2D tPicture;
|
|
47
|
+
varying vec2 vUv;
|
|
48
|
+
void main() {
|
|
49
|
+
vec4 c = texture2D(tPicture, vUv);
|
|
50
|
+
vec3 s = clamp(c.rgb, 0.0, 1.0);
|
|
51
|
+
vec3 light = mix(s / 12.92, pow((s + 0.055) / 1.055, vec3(2.4)), step(0.04045, s));
|
|
52
|
+
gl_FragColor = vec4(light * c.a, c.a);
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
const SHOW_FRAGMENT = /* glsl */ `
|
|
56
|
+
uniform sampler2D tPicture;
|
|
57
|
+
varying vec2 vUv;
|
|
58
|
+
void main() {
|
|
59
|
+
vec4 c = texture2D(tPicture, vUv);
|
|
60
|
+
vec3 light = c.a > 0.0 ? clamp(c.rgb / c.a, 0.0, 1.0) : vec3(0.0);
|
|
61
|
+
vec3 s = mix(light * 12.92, 1.055 * pow(light, vec3(1.0 / 2.4)) - 0.055, step(0.0031308, light));
|
|
62
|
+
gl_FragColor = vec4(s * c.a, c.a);
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
export class Picture {
|
|
66
|
+
renderer;
|
|
67
|
+
camera;
|
|
68
|
+
atRest;
|
|
69
|
+
composer;
|
|
70
|
+
smaa = new SMAAPass();
|
|
71
|
+
/** The average of the pictures taken at rest, and how many it holds. */
|
|
72
|
+
average = null;
|
|
73
|
+
count = 0;
|
|
74
|
+
quad = new Mesh(new PlaneGeometry(2, 2));
|
|
75
|
+
quadScene = new Scene();
|
|
76
|
+
quadCamera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
77
|
+
add = new ShaderMaterial({
|
|
78
|
+
vertexShader: QUAD_VERTEX,
|
|
79
|
+
fragmentShader: ADD_FRAGMENT,
|
|
80
|
+
uniforms: { tPicture: { value: null } },
|
|
81
|
+
blending: CustomBlending,
|
|
82
|
+
blendSrc: ConstantAlphaFactor,
|
|
83
|
+
blendDst: OneMinusConstantAlphaFactor,
|
|
84
|
+
depthTest: false,
|
|
85
|
+
depthWrite: false,
|
|
86
|
+
});
|
|
87
|
+
show = new ShaderMaterial({ vertexShader: QUAD_VERTEX, fragmentShader: SHOW_FRAGMENT, uniforms: { tPicture: { value: null } }, depthTest: false, depthWrite: false });
|
|
88
|
+
frame = 0;
|
|
89
|
+
drawnAt = 0;
|
|
90
|
+
over = () => undefined;
|
|
91
|
+
disposed = false;
|
|
92
|
+
/** `atRest`: nothing of the book is moving (no leaf in the air). */
|
|
93
|
+
constructor(renderer, scene, camera, atRest) {
|
|
94
|
+
this.renderer = renderer;
|
|
95
|
+
this.camera = camera;
|
|
96
|
+
this.atRest = atRest;
|
|
97
|
+
// Edges smoothed by SMAA over the finished picture (#503), not by the
|
|
98
|
+
// canvas's own four samples a pixel: those left steps on long, nearly
|
|
99
|
+
// level edges of strong contrast (a light page over the dark block)
|
|
100
|
+
// and cost the most of a frame (resolved into a preserved drawing
|
|
101
|
+
// buffer); SMAA smooths them better for a fraction of it. The scene
|
|
102
|
+
// is drawn into a float picture, toned for the screen, then smoothed.
|
|
103
|
+
this.composer = new EffectComposer(renderer, new WebGLRenderTarget(1, 1, { type: HalfFloatType }));
|
|
104
|
+
this.composer.addPass(new RenderPass(scene, camera));
|
|
105
|
+
this.composer.addPass(new OutputPass());
|
|
106
|
+
this.composer.addPass(this.smaa);
|
|
107
|
+
this.quad.frustumCulled = false;
|
|
108
|
+
this.quadScene.add(this.quad);
|
|
109
|
+
// The average needs a float picture to draw into.
|
|
110
|
+
const ext = renderer.extensions;
|
|
111
|
+
if (ext.has("EXT_color_buffer_float") || ext.has("EXT_color_buffer_half_float")) {
|
|
112
|
+
this.average = new WebGLRenderTarget(1, 1, { type: HalfFloatType, minFilter: LinearFilter, magFilter: LinearFilter, depthBuffer: false, generateMipmaps: false });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** The drawing buffer's size, in device px. */
|
|
116
|
+
setSize(width, height) {
|
|
117
|
+
this.composer.setPixelRatio(1);
|
|
118
|
+
this.composer.setSize(width, height);
|
|
119
|
+
if (this.average && (this.average.width !== width || this.average.height !== height))
|
|
120
|
+
this.average.setSize(width, height);
|
|
121
|
+
this.count = 0;
|
|
122
|
+
}
|
|
123
|
+
/** Draws a frame of the book as it is now, then `over` on top of it
|
|
124
|
+
* (the magnifying glass). Left alone after it, the picture is drawn
|
|
125
|
+
* again and again from the next frames on, averaged, and shown in the
|
|
126
|
+
* frame's place: no steps left on its edges. */
|
|
127
|
+
render(over) {
|
|
128
|
+
this.composer.render();
|
|
129
|
+
over();
|
|
130
|
+
this.over = over;
|
|
131
|
+
this.count = 0;
|
|
132
|
+
this.drawnAt = performance.now();
|
|
133
|
+
if (this.average && !this.frame)
|
|
134
|
+
this.frame = requestAnimationFrame(this.refine);
|
|
135
|
+
}
|
|
136
|
+
/** Stops averaging (the canvas is cleared, or shows something else). */
|
|
137
|
+
cancel() {
|
|
138
|
+
cancelAnimationFrame(this.frame);
|
|
139
|
+
this.frame = 0;
|
|
140
|
+
this.count = REST_SAMPLES;
|
|
141
|
+
}
|
|
142
|
+
refine = (now) => {
|
|
143
|
+
this.frame = 0;
|
|
144
|
+
// A book in motion draws its own frames, and each asks for this again.
|
|
145
|
+
if (this.disposed || this.count >= REST_SAMPLES || !this.atRest())
|
|
146
|
+
return;
|
|
147
|
+
if (now - this.drawnAt >= REST_MS)
|
|
148
|
+
this.sample();
|
|
149
|
+
if (this.count < REST_SAMPLES)
|
|
150
|
+
this.frame = requestAnimationFrame(this.refine);
|
|
151
|
+
};
|
|
152
|
+
/** One more picture of the book at rest into the average. */
|
|
153
|
+
sample() {
|
|
154
|
+
const { renderer, camera, composer } = this;
|
|
155
|
+
const average = this.average;
|
|
156
|
+
const view = camera.view;
|
|
157
|
+
if (!view)
|
|
158
|
+
return this.cancel();
|
|
159
|
+
const i = ++this.count;
|
|
160
|
+
const [dx, dy] = restOffset(i);
|
|
161
|
+
const { offsetX, offsetY } = view;
|
|
162
|
+
// Nothing has moved: the key's shadow map stands as the frame drew it.
|
|
163
|
+
const shadows = renderer.shadowMap.autoUpdate;
|
|
164
|
+
const clear = renderer.autoClear;
|
|
165
|
+
renderer.shadowMap.autoUpdate = false;
|
|
166
|
+
view.offsetX += dx;
|
|
167
|
+
view.offsetY += dy;
|
|
168
|
+
camera.updateProjectionMatrix();
|
|
169
|
+
occlusionUniforms.uGrain.value.set(5.588238 * i, 5.588238 * i);
|
|
170
|
+
// Toned for the screen, not smoothed, and kept off it.
|
|
171
|
+
this.smaa.enabled = false;
|
|
172
|
+
composer.renderToScreen = false;
|
|
173
|
+
try {
|
|
174
|
+
composer.render();
|
|
175
|
+
renderer.autoClear = false;
|
|
176
|
+
this.add.uniforms.tPicture.value = composer.readBuffer.texture;
|
|
177
|
+
this.add.blendAlpha = 1 / i;
|
|
178
|
+
this.quad.material = this.add;
|
|
179
|
+
renderer.setRenderTarget(average);
|
|
180
|
+
renderer.render(this.quadScene, this.quadCamera);
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
this.smaa.enabled = true;
|
|
184
|
+
composer.renderToScreen = true;
|
|
185
|
+
renderer.setRenderTarget(null);
|
|
186
|
+
renderer.autoClear = clear;
|
|
187
|
+
renderer.shadowMap.autoUpdate = shadows;
|
|
188
|
+
occlusionUniforms.uGrain.value.set(0, 0);
|
|
189
|
+
view.offsetX = offsetX;
|
|
190
|
+
view.offsetY = offsetY;
|
|
191
|
+
camera.updateProjectionMatrix();
|
|
192
|
+
}
|
|
193
|
+
if (i < SHOW_FROM)
|
|
194
|
+
return;
|
|
195
|
+
this.show.uniforms.tPicture.value = average.texture;
|
|
196
|
+
this.quad.material = this.show;
|
|
197
|
+
renderer.render(this.quadScene, this.quadCamera);
|
|
198
|
+
this.over();
|
|
199
|
+
}
|
|
200
|
+
dispose() {
|
|
201
|
+
this.disposed = true;
|
|
202
|
+
cancelAnimationFrame(this.frame);
|
|
203
|
+
this.composer.dispose();
|
|
204
|
+
this.average?.dispose();
|
|
205
|
+
this.quad.geometry.dispose();
|
|
206
|
+
this.add.dispose();
|
|
207
|
+
this.show.dispose();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=picture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picture.js","sourceRoot":"","sources":["../../src/pageFlip/picture.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,yEAAyE;AACzE,yEAAyE;AACzE,oEAAoE;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAA4D,MAAM,OAAO,CAAC;AACnQ,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B;wCACwC;AACxC,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB;kEACkE;AAClE,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB,yEAAyE;AACzE,MAAM,UAAU,MAAM,CAAC,CAAS,EAAE,CAAS;IACzC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC7C,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,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AAC;YACvB,MAAM,CAAC,sBAAsB,EAAE,CAAC;QAClC,CAAC;QACD,IAAI,CAAC,GAAG,SAAS;YAAE,OAAO;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;QACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC/B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,OAAO;QACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;CACF"}
|
package/dist/pageFlip.d.ts
CHANGED
package/dist/pageFlip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageFlip.d.ts","sourceRoot":"","sources":["../src/pageFlip.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pageFlip.d.ts","sourceRoot":"","sources":["../src/pageFlip.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAgD,MAAM,SAAS,CAAC;AAChH,OAAO,EAAwE,KAAK,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAWzI,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIpF,OAAO,EAAE,WAAW,E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AO,CAAC,UAAU;IAMlB;wEACoE;IACpE,KAAK;IAQL;;kEAE8D;IAC9D,MAAM;IAUN,OAAO;CAsCR;AAED,mEAAmE;AACnE,wBAAgB,OAAO,IAAI,OAAO,CAOjC"}
|
package/dist/pageFlip.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { WebGLRenderer, Scene, PerspectiveCamera, Mesh, PlaneGeometry, MeshStandardMaterial, Group, MeshPhysicalMaterial, Texture, BoxGeometry, DirectionalLight, PMREMGenerator, OrthographicCamera, WebGLRenderTarget, Vector2, TextureLoader, Raycaster, SRGBColorSpace, NeutralToneMapping, HalfFloatType, PCFShadowMap, LinearFilter, BufferAttribute, ShadowMaterial, Color, Vector3, LinearMipmapLinearFilter, Plane, DepthTexture } from 'three';
|
|
2
|
-
import {
|
|
3
|
-
import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass.js';
|
|
4
|
-
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
|
|
5
|
-
import { SMAAPass } from 'three/examples/jsm/postprocessing/SMAAPass.js';
|
|
2
|
+
import { Picture } from './pageFlip/picture.js';
|
|
6
3
|
import { resolveFolioConfig } from 'postext';
|
|
7
|
-
import { BINDINGS, profiles, gutterOcclusion, along, stackGeometry } from './bookGeometry.js';
|
|
4
|
+
import { BINDINGS, profiles, gutterOcclusion, along, stackGeometry, PAGE_LIFT } from './bookGeometry.js';
|
|
8
5
|
import { environment } from './environments.js';
|
|
9
6
|
import { paperSpec, pagePaper } from './paper.js';
|
|
10
7
|
import { loadDeskMaps } from './deskTextures.js';
|
|
@@ -51,7 +48,7 @@ export class PageFlipper {
|
|
|
51
48
|
renderer;
|
|
52
49
|
scene = new Scene();
|
|
53
50
|
camera = new PerspectiveCamera(FOV, 1, 1, 10000);
|
|
54
|
-
|
|
51
|
+
picture;
|
|
55
52
|
left;
|
|
56
53
|
right;
|
|
57
54
|
desk;
|
|
@@ -172,16 +169,8 @@ export class PageFlipper {
|
|
|
172
169
|
this.renderer.outputColorSpace = SRGBColorSpace;
|
|
173
170
|
this.renderer.toneMapping = NeutralToneMapping;
|
|
174
171
|
this.renderer.setClearColor(0x000000, 0);
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
// level edges of strong contrast (a light page over the dark block)
|
|
178
|
-
// and cost the most of a frame (resolved into a preserved drawing
|
|
179
|
-
// buffer); SMAA smooths them better for a fraction of it. The scene
|
|
180
|
-
// is drawn into a float picture, toned for the screen, then smoothed.
|
|
181
|
-
this.composer = new EffectComposer(this.renderer, new WebGLRenderTarget(1, 1, { type: HalfFloatType }));
|
|
182
|
-
this.composer.addPass(new RenderPass(this.scene, this.camera));
|
|
183
|
-
this.composer.addPass(new OutputPass());
|
|
184
|
-
this.composer.addPass(new SMAAPass());
|
|
172
|
+
// The book at rest (no leaf in the air) is drawn again and averaged.
|
|
173
|
+
this.picture = new Picture(this.renderer, this.scene, this.camera, () => !this.raf && !this.starting);
|
|
185
174
|
if (this.renderer.shadowMap) {
|
|
186
175
|
this.renderer.shadowMap.enabled = true;
|
|
187
176
|
this.renderer.shadowMap.type = PCFShadowMap;
|
|
@@ -653,7 +642,7 @@ export class PageFlipper {
|
|
|
653
642
|
const row = Math.floor(i / (NX_OPEN + 1));
|
|
654
643
|
const t = column(ix / NX_OPEN);
|
|
655
644
|
const [x, z] = along(own, t * W);
|
|
656
|
-
pos.setXYZ(i, side * x, row === 0 ? H / 2 : -H / 2, z +
|
|
645
|
+
pos.setXYZ(i, side * x, row === 0 ? H / 2 : -H / 2, z + PAGE_LIFT);
|
|
657
646
|
aoAttr.setX(i, ao[Math.round(t * (ao.length - 1))]);
|
|
658
647
|
}
|
|
659
648
|
pos.needsUpdate = true;
|
|
@@ -811,8 +800,7 @@ export class PageFlipper {
|
|
|
811
800
|
const dpr = Math.min(window.devicePixelRatio || 1, 3);
|
|
812
801
|
this.renderer.setPixelRatio(1);
|
|
813
802
|
this.renderer.setSize(Math.round(cw * dpr), Math.round(ch * dpr), false);
|
|
814
|
-
this.
|
|
815
|
-
this.composer.setSize(Math.round(cw * dpr), Math.round(ch * dpr));
|
|
803
|
+
this.picture.setSize(Math.round(cw * dpr), Math.round(ch * dpr));
|
|
816
804
|
this.buffer.set(Math.round(cw * dpr), Math.round(ch * dpr));
|
|
817
805
|
this.dpr = dpr;
|
|
818
806
|
const spread = this.spread.getBoundingClientRect();
|
|
@@ -1833,8 +1821,7 @@ export class PageFlipper {
|
|
|
1833
1821
|
}
|
|
1834
1822
|
this.mirror(air.length > 0 || this.block !== null);
|
|
1835
1823
|
this.behind(air.map((a) => a.mesh));
|
|
1836
|
-
this.
|
|
1837
|
-
this.drawLoupe();
|
|
1824
|
+
this.picture.render(() => this.drawLoupe());
|
|
1838
1825
|
}
|
|
1839
1826
|
// ── The magnifying glass (#527) ──
|
|
1840
1827
|
/** Holds a magnifying glass over the book: its centre (client px), the
|
|
@@ -2046,6 +2033,7 @@ export class PageFlipper {
|
|
|
2046
2033
|
if (this.persistent)
|
|
2047
2034
|
return this.redraw();
|
|
2048
2035
|
this.spread.classList.remove("is-turning");
|
|
2036
|
+
this.picture.cancel();
|
|
2049
2037
|
this.renderer.clear();
|
|
2050
2038
|
}
|
|
2051
2039
|
/** Draws the book at rest again (a page painted, the box resized) on the
|
|
@@ -2072,7 +2060,7 @@ export class PageFlipper {
|
|
|
2072
2060
|
tex.dispose();
|
|
2073
2061
|
this.finishes.dispose();
|
|
2074
2062
|
this.shadowTarget?.dispose();
|
|
2075
|
-
this.
|
|
2063
|
+
this.picture.dispose();
|
|
2076
2064
|
this.loupe?.dispose();
|
|
2077
2065
|
for (const d of this.details.values())
|
|
2078
2066
|
d.tex?.dispose();
|