manim-web 0.21.0 → 0.22.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/BokehPass-BtX0qHyZ.js +52 -0
- package/dist/BokehPass-D-qNlcw3.js +52 -0
- package/dist/CopyShader-C2Oc7n1P.js +12 -0
- package/dist/EffectComposer-BrOvLZtb.js +88 -0
- package/dist/EffectComposer-D427QFuS.js +88 -0
- package/dist/OutputPass-BeBCm_Ta.js +29 -0
- package/dist/OutputPass-oQu4Xmeb.js +29 -0
- package/dist/Pass--g-Yi-4V.js +51 -0
- package/dist/Pass-CSHIrJrV.js +51 -0
- package/dist/RenderPass-DS8SYAhJ.js +16 -0
- package/dist/RenderPass-DqrV7dhy.js +16 -0
- package/dist/ShaderPass-MHAIxsHm.js +22 -0
- package/dist/ShaderPass-h4P0lBmc.js +22 -0
- package/dist/UnrealBloomPass-DXgh_M0E.js +123 -0
- package/dist/UnrealBloomPass-DxDOnUAw.js +123 -0
- package/dist/core/PostProcessing.d.ts +203 -0
- package/dist/core/PostProcessing.d.ts.map +1 -0
- package/dist/core/Scene.d.ts +23 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/integrations/react.js +16 -16
- package/dist/integrations/vue.js +13 -13
- package/dist/interaction/PanZoomControls.d.ts +133 -0
- package/dist/interaction/PanZoomControls.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +1 -0
- package/dist/interaction/index.d.ts.map +1 -1
- package/dist/manim-web.browser.js +1995 -1716
- package/dist/{src-B_DX0DD1.js → src-C18aslV3.js} +1977 -1698
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { n as e, t } from "./Pass-CSHIrJrV.js";
|
|
2
|
+
import { t as n } from "./CopyShader-C2Oc7n1P.js";
|
|
3
|
+
import { AdditiveBlending as r, Color as i, HalfFloatType as a, MeshBasicMaterial as o, ShaderMaterial as s, UniformsUtils as c, Vector2 as l, Vector3 as u, WebGLRenderTarget as d } from "three";
|
|
4
|
+
//#region node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js
|
|
5
|
+
var f = {
|
|
6
|
+
name: "LuminosityHighPassShader",
|
|
7
|
+
uniforms: {
|
|
8
|
+
tDiffuse: { value: null },
|
|
9
|
+
luminosityThreshold: { value: 1 },
|
|
10
|
+
smoothWidth: { value: 1 },
|
|
11
|
+
defaultColor: { value: new i(0) },
|
|
12
|
+
defaultOpacity: { value: 0 }
|
|
13
|
+
},
|
|
14
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
15
|
+
fragmentShader: "\n\n uniform sampler2D tDiffuse;\n uniform vec3 defaultColor;\n uniform float defaultOpacity;\n uniform float luminosityThreshold;\n uniform float smoothWidth;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 texel = texture2D( tDiffuse, vUv );\n\n float v = luminance( texel.xyz );\n\n vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n gl_FragColor = mix( outputColor, texel, alpha );\n\n }"
|
|
16
|
+
}, p = class p extends e {
|
|
17
|
+
constructor(e, p = 1, m, h) {
|
|
18
|
+
super(), this.strength = p, this.radius = m, this.threshold = h, this.resolution = e === void 0 ? new l(256, 256) : new l(e.x, e.y), this.clearColor = new i(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5;
|
|
19
|
+
let g = Math.round(this.resolution.x / 2), _ = Math.round(this.resolution.y / 2);
|
|
20
|
+
this.renderTargetBright = new d(g, _, { type: a }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1;
|
|
21
|
+
for (let e = 0; e < this.nMips; e++) {
|
|
22
|
+
let t = new d(g, _, { type: a });
|
|
23
|
+
t.texture.name = "UnrealBloomPass.h" + e, t.texture.generateMipmaps = !1, this.renderTargetsHorizontal.push(t);
|
|
24
|
+
let n = new d(g, _, { type: a });
|
|
25
|
+
n.texture.name = "UnrealBloomPass.v" + e, n.texture.generateMipmaps = !1, this.renderTargetsVertical.push(n), g = Math.round(g / 2), _ = Math.round(_ / 2);
|
|
26
|
+
}
|
|
27
|
+
let v = f;
|
|
28
|
+
this.highPassUniforms = c.clone(v.uniforms), this.highPassUniforms.luminosityThreshold.value = h, this.highPassUniforms.smoothWidth.value = .01, this.materialHighPassFilter = new s({
|
|
29
|
+
uniforms: this.highPassUniforms,
|
|
30
|
+
vertexShader: v.vertexShader,
|
|
31
|
+
fragmentShader: v.fragmentShader
|
|
32
|
+
}), this.separableBlurMaterials = [];
|
|
33
|
+
let y = [
|
|
34
|
+
6,
|
|
35
|
+
10,
|
|
36
|
+
14,
|
|
37
|
+
18,
|
|
38
|
+
22
|
|
39
|
+
];
|
|
40
|
+
g = Math.round(this.resolution.x / 2), _ = Math.round(this.resolution.y / 2);
|
|
41
|
+
for (let e = 0; e < this.nMips; e++) this.separableBlurMaterials.push(this._getSeparableBlurMaterial(y[e])), this.separableBlurMaterials[e].uniforms.invSize.value = new l(1 / g, 1 / _), g = Math.round(g / 2), _ = Math.round(_ / 2);
|
|
42
|
+
this.compositeMaterial = this._getCompositeMaterial(this.nMips), this.compositeMaterial.uniforms.blurTexture1.value = this.renderTargetsVertical[0].texture, this.compositeMaterial.uniforms.blurTexture2.value = this.renderTargetsVertical[1].texture, this.compositeMaterial.uniforms.blurTexture3.value = this.renderTargetsVertical[2].texture, this.compositeMaterial.uniforms.blurTexture4.value = this.renderTargetsVertical[3].texture, this.compositeMaterial.uniforms.blurTexture5.value = this.renderTargetsVertical[4].texture, this.compositeMaterial.uniforms.bloomStrength.value = p, this.compositeMaterial.uniforms.bloomRadius.value = .1;
|
|
43
|
+
let b = [
|
|
44
|
+
1,
|
|
45
|
+
.8,
|
|
46
|
+
.6,
|
|
47
|
+
.4,
|
|
48
|
+
.2
|
|
49
|
+
];
|
|
50
|
+
this.compositeMaterial.uniforms.bloomFactors.value = b, this.bloomTintColors = [
|
|
51
|
+
new u(1, 1, 1),
|
|
52
|
+
new u(1, 1, 1),
|
|
53
|
+
new u(1, 1, 1),
|
|
54
|
+
new u(1, 1, 1),
|
|
55
|
+
new u(1, 1, 1)
|
|
56
|
+
], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = c.clone(n.uniforms), this.blendMaterial = new s({
|
|
57
|
+
uniforms: this.copyUniforms,
|
|
58
|
+
vertexShader: n.vertexShader,
|
|
59
|
+
fragmentShader: n.fragmentShader,
|
|
60
|
+
premultipliedAlpha: !0,
|
|
61
|
+
blending: r,
|
|
62
|
+
depthTest: !1,
|
|
63
|
+
depthWrite: !1,
|
|
64
|
+
transparent: !0
|
|
65
|
+
}), this._oldClearColor = new i(), this._oldClearAlpha = 1, this._basic = new o(), this._fsQuad = new t(null);
|
|
66
|
+
}
|
|
67
|
+
dispose() {
|
|
68
|
+
for (let e = 0; e < this.renderTargetsHorizontal.length; e++) this.renderTargetsHorizontal[e].dispose();
|
|
69
|
+
for (let e = 0; e < this.renderTargetsVertical.length; e++) this.renderTargetsVertical[e].dispose();
|
|
70
|
+
this.renderTargetBright.dispose();
|
|
71
|
+
for (let e = 0; e < this.separableBlurMaterials.length; e++) this.separableBlurMaterials[e].dispose();
|
|
72
|
+
this.compositeMaterial.dispose(), this.blendMaterial.dispose(), this._basic.dispose(), this._fsQuad.dispose();
|
|
73
|
+
}
|
|
74
|
+
setSize(e, t) {
|
|
75
|
+
let n = Math.round(e / 2), r = Math.round(t / 2);
|
|
76
|
+
this.renderTargetBright.setSize(n, r);
|
|
77
|
+
for (let e = 0; e < this.nMips; e++) this.renderTargetsHorizontal[e].setSize(n, r), this.renderTargetsVertical[e].setSize(n, r), this.separableBlurMaterials[e].uniforms.invSize.value = new l(1 / n, 1 / r), n = Math.round(n / 2), r = Math.round(r / 2);
|
|
78
|
+
}
|
|
79
|
+
render(e, t, n, r, i) {
|
|
80
|
+
e.getClearColor(this._oldClearColor), this._oldClearAlpha = e.getClearAlpha();
|
|
81
|
+
let a = e.autoClear;
|
|
82
|
+
e.autoClear = !1, e.setClearColor(this.clearColor, 0), i && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this._fsQuad.material = this._basic, this._basic.map = n.texture, e.setRenderTarget(null), e.clear(), this._fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = n.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this._fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this._fsQuad.render(e);
|
|
83
|
+
let o = this.renderTargetBright;
|
|
84
|
+
for (let t = 0; t < this.nMips; t++) this._fsQuad.material = this.separableBlurMaterials[t], this.separableBlurMaterials[t].uniforms.colorTexture.value = o.texture, this.separableBlurMaterials[t].uniforms.direction.value = p.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[t]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[t].uniforms.colorTexture.value = this.renderTargetsHorizontal[t].texture, this.separableBlurMaterials[t].uniforms.direction.value = p.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[t]), e.clear(), this._fsQuad.render(e), o = this.renderTargetsVertical[t];
|
|
85
|
+
this._fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, i && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(n), this._fsQuad.render(e)), e.setClearColor(this._oldClearColor, this._oldClearAlpha), e.autoClear = a;
|
|
86
|
+
}
|
|
87
|
+
_getSeparableBlurMaterial(e) {
|
|
88
|
+
let t = [], n = e / 3;
|
|
89
|
+
for (let r = 0; r < e; r++) t.push(.39894 * Math.exp(-.5 * r * r / (n * n)) / n);
|
|
90
|
+
return new s({
|
|
91
|
+
defines: { KERNEL_RADIUS: e },
|
|
92
|
+
uniforms: {
|
|
93
|
+
colorTexture: { value: null },
|
|
94
|
+
invSize: { value: new l(.5, .5) },
|
|
95
|
+
direction: { value: new l(.5, .5) },
|
|
96
|
+
gaussianCoefficients: { value: t }
|
|
97
|
+
},
|
|
98
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
99
|
+
fragmentShader: "\n\n #include <common>\n\n varying vec2 vUv;\n\n uniform sampler2D colorTexture;\n uniform vec2 invSize;\n uniform vec2 direction;\n uniform float gaussianCoefficients[KERNEL_RADIUS];\n\n void main() {\n\n float weightSum = gaussianCoefficients[0];\n vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;\n\n for ( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\n float x = float( i );\n float w = gaussianCoefficients[i];\n vec2 uvOffset = direction * invSize * x;\n vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;\n vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;\n diffuseSum += ( sample1 + sample2 ) * w;\n\n }\n\n gl_FragColor = vec4( diffuseSum, 1.0 );\n\n }"
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
_getCompositeMaterial(e) {
|
|
103
|
+
return new s({
|
|
104
|
+
defines: { NUM_MIPS: e },
|
|
105
|
+
uniforms: {
|
|
106
|
+
blurTexture1: { value: null },
|
|
107
|
+
blurTexture2: { value: null },
|
|
108
|
+
blurTexture3: { value: null },
|
|
109
|
+
blurTexture4: { value: null },
|
|
110
|
+
blurTexture5: { value: null },
|
|
111
|
+
bloomStrength: { value: 1 },
|
|
112
|
+
bloomFactors: { value: null },
|
|
113
|
+
bloomTintColors: { value: null },
|
|
114
|
+
bloomRadius: { value: 0 }
|
|
115
|
+
},
|
|
116
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
117
|
+
fragmentShader: "\n\n varying vec2 vUv;\n\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n\n float lerpBloomFactor( const in float factor ) {\n\n float mirrorFactor = 1.2 - factor;\n return mix( factor, mirrorFactor, bloomRadius );\n\n }\n\n void main() {\n\n // 3.0 for backwards compatibility with previous alpha-based intensity\n vec3 bloom = 3.0 * bloomStrength * (\n lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb\n );\n\n float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );\n gl_FragColor = vec4( bloom, bloomAlpha );\n\n }"
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
p.BlurDirectionX = new l(1, 0), p.BlurDirectionY = new l(0, 1);
|
|
122
|
+
//#endregion
|
|
123
|
+
export { p as UnrealBloomPass };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { $a as e, $i as t, U as n, Wa as r, Yt as i, ar as a, co as o, eo as s } from "./three.core-1aHSpGwp.js";
|
|
2
|
+
import { n as c, t as l } from "./Pass--g-Yi-4V.js";
|
|
3
|
+
import { t as u } from "./CopyShader-C2Oc7n1P.js";
|
|
4
|
+
//#region node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js
|
|
5
|
+
var d = {
|
|
6
|
+
name: "LuminosityHighPassShader",
|
|
7
|
+
uniforms: {
|
|
8
|
+
tDiffuse: { value: null },
|
|
9
|
+
luminosityThreshold: { value: 1 },
|
|
10
|
+
smoothWidth: { value: 1 },
|
|
11
|
+
defaultColor: { value: new n(0) },
|
|
12
|
+
defaultOpacity: { value: 0 }
|
|
13
|
+
},
|
|
14
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
15
|
+
fragmentShader: "\n\n uniform sampler2D tDiffuse;\n uniform vec3 defaultColor;\n uniform float defaultOpacity;\n uniform float luminosityThreshold;\n uniform float smoothWidth;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 texel = texture2D( tDiffuse, vUv );\n\n float v = luminance( texel.xyz );\n\n vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n gl_FragColor = mix( outputColor, texel, alpha );\n\n }"
|
|
16
|
+
}, f = class f extends c {
|
|
17
|
+
constructor(c, f = 1, p, m) {
|
|
18
|
+
super(), this.strength = f, this.radius = p, this.threshold = m, this.resolution = c === void 0 ? new e(256, 256) : new e(c.x, c.y), this.clearColor = new n(0, 0, 0), this.needsSwap = !1, this.renderTargetsHorizontal = [], this.renderTargetsVertical = [], this.nMips = 5;
|
|
19
|
+
let h = Math.round(this.resolution.x / 2), g = Math.round(this.resolution.y / 2);
|
|
20
|
+
this.renderTargetBright = new o(h, g, { type: i }), this.renderTargetBright.texture.name = "UnrealBloomPass.bright", this.renderTargetBright.texture.generateMipmaps = !1;
|
|
21
|
+
for (let e = 0; e < this.nMips; e++) {
|
|
22
|
+
let t = new o(h, g, { type: i });
|
|
23
|
+
t.texture.name = "UnrealBloomPass.h" + e, t.texture.generateMipmaps = !1, this.renderTargetsHorizontal.push(t);
|
|
24
|
+
let n = new o(h, g, { type: i });
|
|
25
|
+
n.texture.name = "UnrealBloomPass.v" + e, n.texture.generateMipmaps = !1, this.renderTargetsVertical.push(n), h = Math.round(h / 2), g = Math.round(g / 2);
|
|
26
|
+
}
|
|
27
|
+
let _ = d;
|
|
28
|
+
this.highPassUniforms = r.clone(_.uniforms), this.highPassUniforms.luminosityThreshold.value = m, this.highPassUniforms.smoothWidth.value = .01, this.materialHighPassFilter = new t({
|
|
29
|
+
uniforms: this.highPassUniforms,
|
|
30
|
+
vertexShader: _.vertexShader,
|
|
31
|
+
fragmentShader: _.fragmentShader
|
|
32
|
+
}), this.separableBlurMaterials = [];
|
|
33
|
+
let v = [
|
|
34
|
+
6,
|
|
35
|
+
10,
|
|
36
|
+
14,
|
|
37
|
+
18,
|
|
38
|
+
22
|
|
39
|
+
];
|
|
40
|
+
h = Math.round(this.resolution.x / 2), g = Math.round(this.resolution.y / 2);
|
|
41
|
+
for (let t = 0; t < this.nMips; t++) this.separableBlurMaterials.push(this._getSeparableBlurMaterial(v[t])), this.separableBlurMaterials[t].uniforms.invSize.value = new e(1 / h, 1 / g), h = Math.round(h / 2), g = Math.round(g / 2);
|
|
42
|
+
this.compositeMaterial = this._getCompositeMaterial(this.nMips), this.compositeMaterial.uniforms.blurTexture1.value = this.renderTargetsVertical[0].texture, this.compositeMaterial.uniforms.blurTexture2.value = this.renderTargetsVertical[1].texture, this.compositeMaterial.uniforms.blurTexture3.value = this.renderTargetsVertical[2].texture, this.compositeMaterial.uniforms.blurTexture4.value = this.renderTargetsVertical[3].texture, this.compositeMaterial.uniforms.blurTexture5.value = this.renderTargetsVertical[4].texture, this.compositeMaterial.uniforms.bloomStrength.value = f, this.compositeMaterial.uniforms.bloomRadius.value = .1;
|
|
43
|
+
let y = [
|
|
44
|
+
1,
|
|
45
|
+
.8,
|
|
46
|
+
.6,
|
|
47
|
+
.4,
|
|
48
|
+
.2
|
|
49
|
+
];
|
|
50
|
+
this.compositeMaterial.uniforms.bloomFactors.value = y, this.bloomTintColors = [
|
|
51
|
+
new s(1, 1, 1),
|
|
52
|
+
new s(1, 1, 1),
|
|
53
|
+
new s(1, 1, 1),
|
|
54
|
+
new s(1, 1, 1),
|
|
55
|
+
new s(1, 1, 1)
|
|
56
|
+
], this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, this.copyUniforms = r.clone(u.uniforms), this.blendMaterial = new t({
|
|
57
|
+
uniforms: this.copyUniforms,
|
|
58
|
+
vertexShader: u.vertexShader,
|
|
59
|
+
fragmentShader: u.fragmentShader,
|
|
60
|
+
premultipliedAlpha: !0,
|
|
61
|
+
blending: 2,
|
|
62
|
+
depthTest: !1,
|
|
63
|
+
depthWrite: !1,
|
|
64
|
+
transparent: !0
|
|
65
|
+
}), this._oldClearColor = new n(), this._oldClearAlpha = 1, this._basic = new a(), this._fsQuad = new l(null);
|
|
66
|
+
}
|
|
67
|
+
dispose() {
|
|
68
|
+
for (let e = 0; e < this.renderTargetsHorizontal.length; e++) this.renderTargetsHorizontal[e].dispose();
|
|
69
|
+
for (let e = 0; e < this.renderTargetsVertical.length; e++) this.renderTargetsVertical[e].dispose();
|
|
70
|
+
this.renderTargetBright.dispose();
|
|
71
|
+
for (let e = 0; e < this.separableBlurMaterials.length; e++) this.separableBlurMaterials[e].dispose();
|
|
72
|
+
this.compositeMaterial.dispose(), this.blendMaterial.dispose(), this._basic.dispose(), this._fsQuad.dispose();
|
|
73
|
+
}
|
|
74
|
+
setSize(t, n) {
|
|
75
|
+
let r = Math.round(t / 2), i = Math.round(n / 2);
|
|
76
|
+
this.renderTargetBright.setSize(r, i);
|
|
77
|
+
for (let t = 0; t < this.nMips; t++) this.renderTargetsHorizontal[t].setSize(r, i), this.renderTargetsVertical[t].setSize(r, i), this.separableBlurMaterials[t].uniforms.invSize.value = new e(1 / r, 1 / i), r = Math.round(r / 2), i = Math.round(i / 2);
|
|
78
|
+
}
|
|
79
|
+
render(e, t, n, r, i) {
|
|
80
|
+
e.getClearColor(this._oldClearColor), this._oldClearAlpha = e.getClearAlpha();
|
|
81
|
+
let a = e.autoClear;
|
|
82
|
+
e.autoClear = !1, e.setClearColor(this.clearColor, 0), i && e.state.buffers.stencil.setTest(!1), this.renderToScreen && (this._fsQuad.material = this._basic, this._basic.map = n.texture, e.setRenderTarget(null), e.clear(), this._fsQuad.render(e)), this.highPassUniforms.tDiffuse.value = n.texture, this.highPassUniforms.luminosityThreshold.value = this.threshold, this._fsQuad.material = this.materialHighPassFilter, e.setRenderTarget(this.renderTargetBright), e.clear(), this._fsQuad.render(e);
|
|
83
|
+
let o = this.renderTargetBright;
|
|
84
|
+
for (let t = 0; t < this.nMips; t++) this._fsQuad.material = this.separableBlurMaterials[t], this.separableBlurMaterials[t].uniforms.colorTexture.value = o.texture, this.separableBlurMaterials[t].uniforms.direction.value = f.BlurDirectionX, e.setRenderTarget(this.renderTargetsHorizontal[t]), e.clear(), this._fsQuad.render(e), this.separableBlurMaterials[t].uniforms.colorTexture.value = this.renderTargetsHorizontal[t].texture, this.separableBlurMaterials[t].uniforms.direction.value = f.BlurDirectionY, e.setRenderTarget(this.renderTargetsVertical[t]), e.clear(), this._fsQuad.render(e), o = this.renderTargetsVertical[t];
|
|
85
|
+
this._fsQuad.material = this.compositeMaterial, this.compositeMaterial.uniforms.bloomStrength.value = this.strength, this.compositeMaterial.uniforms.bloomRadius.value = this.radius, this.compositeMaterial.uniforms.bloomTintColors.value = this.bloomTintColors, e.setRenderTarget(this.renderTargetsHorizontal[0]), e.clear(), this._fsQuad.render(e), this._fsQuad.material = this.blendMaterial, this.copyUniforms.tDiffuse.value = this.renderTargetsHorizontal[0].texture, i && e.state.buffers.stencil.setTest(!0), this.renderToScreen ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(n), this._fsQuad.render(e)), e.setClearColor(this._oldClearColor, this._oldClearAlpha), e.autoClear = a;
|
|
86
|
+
}
|
|
87
|
+
_getSeparableBlurMaterial(n) {
|
|
88
|
+
let r = [], i = n / 3;
|
|
89
|
+
for (let e = 0; e < n; e++) r.push(.39894 * Math.exp(-.5 * e * e / (i * i)) / i);
|
|
90
|
+
return new t({
|
|
91
|
+
defines: { KERNEL_RADIUS: n },
|
|
92
|
+
uniforms: {
|
|
93
|
+
colorTexture: { value: null },
|
|
94
|
+
invSize: { value: new e(.5, .5) },
|
|
95
|
+
direction: { value: new e(.5, .5) },
|
|
96
|
+
gaussianCoefficients: { value: r }
|
|
97
|
+
},
|
|
98
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
99
|
+
fragmentShader: "\n\n #include <common>\n\n varying vec2 vUv;\n\n uniform sampler2D colorTexture;\n uniform vec2 invSize;\n uniform vec2 direction;\n uniform float gaussianCoefficients[KERNEL_RADIUS];\n\n void main() {\n\n float weightSum = gaussianCoefficients[0];\n vec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;\n\n for ( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\n float x = float( i );\n float w = gaussianCoefficients[i];\n vec2 uvOffset = direction * invSize * x;\n vec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;\n vec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;\n diffuseSum += ( sample1 + sample2 ) * w;\n\n }\n\n gl_FragColor = vec4( diffuseSum, 1.0 );\n\n }"
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
_getCompositeMaterial(e) {
|
|
103
|
+
return new t({
|
|
104
|
+
defines: { NUM_MIPS: e },
|
|
105
|
+
uniforms: {
|
|
106
|
+
blurTexture1: { value: null },
|
|
107
|
+
blurTexture2: { value: null },
|
|
108
|
+
blurTexture3: { value: null },
|
|
109
|
+
blurTexture4: { value: null },
|
|
110
|
+
blurTexture5: { value: null },
|
|
111
|
+
bloomStrength: { value: 1 },
|
|
112
|
+
bloomFactors: { value: null },
|
|
113
|
+
bloomTintColors: { value: null },
|
|
114
|
+
bloomRadius: { value: 0 }
|
|
115
|
+
},
|
|
116
|
+
vertexShader: "\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }",
|
|
117
|
+
fragmentShader: "\n\n varying vec2 vUv;\n\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n\n float lerpBloomFactor( const in float factor ) {\n\n float mirrorFactor = 1.2 - factor;\n return mix( factor, mirrorFactor, bloomRadius );\n\n }\n\n void main() {\n\n // 3.0 for backwards compatibility with previous alpha-based intensity\n vec3 bloom = 3.0 * bloomStrength * (\n lerpBloomFactor( bloomFactors[ 0 ] ) * bloomTintColors[ 0 ] * texture2D( blurTexture1, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 1 ] ) * bloomTintColors[ 1 ] * texture2D( blurTexture2, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 2 ] ) * bloomTintColors[ 2 ] * texture2D( blurTexture3, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 3 ] ) * bloomTintColors[ 3 ] * texture2D( blurTexture4, vUv ).rgb +\n lerpBloomFactor( bloomFactors[ 4 ] ) * bloomTintColors[ 4 ] * texture2D( blurTexture5, vUv ).rgb\n );\n\n float bloomAlpha = max( bloom.r, max( bloom.g, bloom.b ) );\n gl_FragColor = vec4( bloom, bloomAlpha );\n\n }"
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
f.BlurDirectionX = new e(1, 0), f.BlurDirectionY = new e(0, 1);
|
|
122
|
+
//#endregion
|
|
123
|
+
export { f as UnrealBloomPass };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostProcessingPipeline - opt-in GPU post-processing for manim-web scenes.
|
|
3
|
+
*
|
|
4
|
+
* Native Cairo ManimCE cannot do screen-space GPU effects. Three.js ships an
|
|
5
|
+
* `EffectComposer` with ready-made passes (bloom/glow, bokeh depth of field,
|
|
6
|
+
* and custom shader passes). manim-web exposes them behind an OPT-IN pipeline
|
|
7
|
+
* so the default render path stays byte-identical to a direct
|
|
8
|
+
* `renderer.render(scene, camera)` call.
|
|
9
|
+
*
|
|
10
|
+
* Wiring (why rendering can fall back):
|
|
11
|
+
* The composer and its passes come from `three/examples/jsm/postprocessing`,
|
|
12
|
+
* which have no bundled types and must stay out of the base bundle. They are
|
|
13
|
+
* pulled in through a lazy dynamic `import()` on first use (same seam as
|
|
14
|
+
* ModelMobject's loaders). While the modules load, `render()` reports that it
|
|
15
|
+
* did not draw, so the caller (Scene) keeps using the direct render path for
|
|
16
|
+
* that frame. Once the modules resolve, the composer builds and every later
|
|
17
|
+
* frame routes through `composer.render()`.
|
|
18
|
+
*
|
|
19
|
+
* Tests inject the module classes synchronously with `setPostProcessingModules`
|
|
20
|
+
* so the composer builds on the first render without any real GPU or network.
|
|
21
|
+
*/
|
|
22
|
+
import * as THREE from 'three';
|
|
23
|
+
/** Bloom (glow) pass configuration. */
|
|
24
|
+
export interface BloomOptions {
|
|
25
|
+
/** Glow intensity. Higher spreads brighter areas more. Default: 1. */
|
|
26
|
+
strength?: number;
|
|
27
|
+
/** Glow spread radius (0-1). Default: 0.4. */
|
|
28
|
+
radius?: number;
|
|
29
|
+
/** Luminance threshold above which pixels glow (0-1). Default: 0.85. */
|
|
30
|
+
threshold?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Vignette pass configuration (darkened frame edges). */
|
|
33
|
+
export interface VignetteOptions {
|
|
34
|
+
/** Distance from center where darkening starts. Default: 1. */
|
|
35
|
+
offset?: number;
|
|
36
|
+
/** Edge darkness strength. Default: 1. */
|
|
37
|
+
darkness?: number;
|
|
38
|
+
}
|
|
39
|
+
/** Bokeh depth-of-field pass configuration. */
|
|
40
|
+
export interface DepthOfFieldOptions {
|
|
41
|
+
/** Focus distance in world units. Default: 10. */
|
|
42
|
+
focus?: number;
|
|
43
|
+
/** Lens aperture; larger blurs out-of-focus areas more. Default: 0.025. */
|
|
44
|
+
aperture?: number;
|
|
45
|
+
/** Maximum blur amount (0-1). Default: 0.01. */
|
|
46
|
+
maxblur?: number;
|
|
47
|
+
}
|
|
48
|
+
/** Discriminated record of a configured pass, in insertion order. */
|
|
49
|
+
export type PassConfig = ({
|
|
50
|
+
type: 'bloom';
|
|
51
|
+
} & Required<BloomOptions>) | ({
|
|
52
|
+
type: 'vignette';
|
|
53
|
+
} & Required<VignetteOptions>) | ({
|
|
54
|
+
type: 'dof';
|
|
55
|
+
} & Required<DepthOfFieldOptions>);
|
|
56
|
+
/** The subset of `EffectComposer` the pipeline uses. */
|
|
57
|
+
export interface ComposerLike {
|
|
58
|
+
setSize(width: number, height: number): void;
|
|
59
|
+
setPixelRatio(ratio: number): void;
|
|
60
|
+
addPass(pass: unknown): void;
|
|
61
|
+
render(deltaTime?: number): void;
|
|
62
|
+
dispose?(): void;
|
|
63
|
+
}
|
|
64
|
+
/** A uniform slot, as three's ShaderPass exposes them. */
|
|
65
|
+
interface UniformSlot {
|
|
66
|
+
value: unknown;
|
|
67
|
+
}
|
|
68
|
+
/** The subset of a ShaderPass the pipeline mutates after construction. */
|
|
69
|
+
interface ShaderPassLike {
|
|
70
|
+
uniforms: Record<string, UniformSlot>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The module classes the pipeline needs. Three's example modules ship without
|
|
74
|
+
* types, so they are cast to this structural contract (the `as unknown as`
|
|
75
|
+
* typed-contract pattern used by ModelMobject).
|
|
76
|
+
*/
|
|
77
|
+
export interface PostProcessingModules {
|
|
78
|
+
EffectComposer: new (renderer: THREE.WebGLRenderer) => ComposerLike;
|
|
79
|
+
RenderPass: new (scene: THREE.Scene, camera: THREE.Camera) => unknown;
|
|
80
|
+
UnrealBloomPass: new (resolution: THREE.Vector2, strength: number, radius: number, threshold: number) => unknown;
|
|
81
|
+
ShaderPass: new (shader: unknown) => ShaderPassLike;
|
|
82
|
+
OutputPass: new () => unknown;
|
|
83
|
+
BokehPass: new (scene: THREE.Scene, camera: THREE.Camera, params: {
|
|
84
|
+
focus: number;
|
|
85
|
+
aperture: number;
|
|
86
|
+
maxblur: number;
|
|
87
|
+
}) => unknown;
|
|
88
|
+
}
|
|
89
|
+
/** Loads the post-processing module classes. May be sync (tests) or async. */
|
|
90
|
+
export type PostProcessingModulesLoader = () => PostProcessingModules | Promise<PostProcessingModules>;
|
|
91
|
+
/**
|
|
92
|
+
* Inject the module classes directly, resolved synchronously. Tests use this
|
|
93
|
+
* to build the composer on the first render with no real GPU. Pass `null` to
|
|
94
|
+
* clear the cache and restore the lazy default import.
|
|
95
|
+
*/
|
|
96
|
+
export declare function setPostProcessingModules(modules: PostProcessingModules | null): void;
|
|
97
|
+
/**
|
|
98
|
+
* Replace the lazy default import with a custom loader. Pass `null` to restore.
|
|
99
|
+
*/
|
|
100
|
+
export declare function setPostProcessingModulesLoader(loader: PostProcessingModulesLoader | null): void;
|
|
101
|
+
/**
|
|
102
|
+
* An opt-in stack of GPU post-processing passes. Add passes with
|
|
103
|
+
* {@link addBloom}, {@link addVignette}, and {@link addDepthOfField}, then
|
|
104
|
+
* attach it with `scene.usePostProcessing(pipeline)`.
|
|
105
|
+
*/
|
|
106
|
+
export declare class PostProcessingPipeline {
|
|
107
|
+
private _enabled;
|
|
108
|
+
private _passConfigs;
|
|
109
|
+
private _composer;
|
|
110
|
+
private _loading;
|
|
111
|
+
private _width;
|
|
112
|
+
private _height;
|
|
113
|
+
private _pixelRatio;
|
|
114
|
+
private _dirty;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the pipeline is active. When false the renderer uses the direct
|
|
117
|
+
* render path, exactly as if no pipeline were attached.
|
|
118
|
+
*/
|
|
119
|
+
get enabled(): boolean;
|
|
120
|
+
set enabled(value: boolean);
|
|
121
|
+
/**
|
|
122
|
+
* Enable or disable the pipeline.
|
|
123
|
+
* @param value - true to route rendering through the composer
|
|
124
|
+
* @returns this for chaining
|
|
125
|
+
*/
|
|
126
|
+
setEnabled(value: boolean): this;
|
|
127
|
+
/** Whether the composer is built and ready to render this frame. */
|
|
128
|
+
get isReady(): boolean;
|
|
129
|
+
/** The configured passes, in insertion order. */
|
|
130
|
+
getPassConfigs(): readonly PassConfig[];
|
|
131
|
+
/**
|
|
132
|
+
* Add a bloom (glow) pass. Bright areas bleed a soft halo.
|
|
133
|
+
* @param options - strength, radius, threshold
|
|
134
|
+
* @returns this for chaining
|
|
135
|
+
*/
|
|
136
|
+
addBloom(options?: BloomOptions): this;
|
|
137
|
+
/**
|
|
138
|
+
* Add a vignette pass that darkens the frame edges.
|
|
139
|
+
* @param options - offset, darkness
|
|
140
|
+
* @returns this for chaining
|
|
141
|
+
*/
|
|
142
|
+
addVignette(options?: VignetteOptions): this;
|
|
143
|
+
/**
|
|
144
|
+
* Add a bokeh depth-of-field pass. Reads explicit focus/aperture/maxblur, or
|
|
145
|
+
* their defaults. A ThreeDCamera's `depthOfField`/`focalDistance` can be fed
|
|
146
|
+
* in through the options.
|
|
147
|
+
* @param options - focus, aperture, maxblur
|
|
148
|
+
* @returns this for chaining
|
|
149
|
+
*/
|
|
150
|
+
addDepthOfField(options?: DepthOfFieldOptions): this;
|
|
151
|
+
/** Remove all configured passes and drop the built composer. */
|
|
152
|
+
clear(): this;
|
|
153
|
+
/**
|
|
154
|
+
* Store the target size. Applied to the composer immediately when it exists,
|
|
155
|
+
* otherwise used when the composer is first built.
|
|
156
|
+
* @param width - canvas width in CSS pixels
|
|
157
|
+
* @param height - canvas height in CSS pixels
|
|
158
|
+
*/
|
|
159
|
+
setSize(width: number, height: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Render one frame through the composer.
|
|
162
|
+
*
|
|
163
|
+
* Returns true when the composer drew the frame, false when it could not
|
|
164
|
+
* (modules still loading, no passes, or the build failed). On false the
|
|
165
|
+
* caller falls back to its direct render path, so default behavior is kept.
|
|
166
|
+
*
|
|
167
|
+
* @param renderer - the three WebGLRenderer
|
|
168
|
+
* @param scene - the three Scene
|
|
169
|
+
* @param camera - the three Camera
|
|
170
|
+
* @param width - canvas width in CSS pixels
|
|
171
|
+
* @param height - canvas height in CSS pixels
|
|
172
|
+
* @param deltaTime - optional frame delta in seconds
|
|
173
|
+
*/
|
|
174
|
+
render(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, width: number, height: number, deltaTime?: number): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Preload the post-processing modules so the next render can build the
|
|
177
|
+
* composer synchronously. Safe to call repeatedly. Resolves even if loading
|
|
178
|
+
* is already in flight.
|
|
179
|
+
*/
|
|
180
|
+
prepare(): Promise<void>;
|
|
181
|
+
/** Dispose GPU resources held by the composer. */
|
|
182
|
+
dispose(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Build the composer from the cached modules if possible. Returns true when
|
|
185
|
+
* a ready composer exists after the call. When the modules are not cached
|
|
186
|
+
* yet, starts the async load once and returns false so the caller falls back.
|
|
187
|
+
*/
|
|
188
|
+
private _ensureBuilt;
|
|
189
|
+
/**
|
|
190
|
+
* Kick off (once) the async module load, caching the result globally. Errors
|
|
191
|
+
* are logged, not thrown, so a fire-and-forget call cannot raise an unhandled
|
|
192
|
+
* rejection and the pipeline simply keeps using the direct render path.
|
|
193
|
+
*/
|
|
194
|
+
private _loadModules;
|
|
195
|
+
/** Construct the composer and every configured pass, in order. */
|
|
196
|
+
private _buildComposer;
|
|
197
|
+
/** Build a single pass from its config. */
|
|
198
|
+
private _buildPass;
|
|
199
|
+
/** Dispose and drop the current composer, if any. */
|
|
200
|
+
private _disposeComposer;
|
|
201
|
+
}
|
|
202
|
+
export {};
|
|
203
|
+
//# sourceMappingURL=PostProcessing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostProcessing.d.ts","sourceRoot":"","sources":["../../src/core/PostProcessing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,GAC5C,CAAC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,G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;;;;;;OAaG;IACH,MAAM,CACJ,QAAQ,EAAE,KAAK,CAAC,aAAa,EAC7B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO;IAcV;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,kDAAkD;IAClD,OAAO,IAAI,IAAI;IAIf;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;OAIG;YACW,YAAY;IAc1B,kEAAkE;IAClE,OAAO,CAAC,cAAc;IAwBtB,2CAA2C;IAC3C,OAAO,CAAC,UAAU;IA4BlB,qDAAqD;IACrD,OAAO,CAAC,gBAAgB;CAMzB"}
|
package/dist/core/Scene.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Timeline } from '../animation/Timeline';
|
|
|
6
6
|
import { SceneStateManager, SceneSnapshot } from './StateManager';
|
|
7
7
|
import { AudioManager, AddSoundOptions, AudioTrack } from './AudioManager';
|
|
8
8
|
import { MultiCamera } from './CameraExtensions';
|
|
9
|
+
import { PostProcessingPipeline } from './PostProcessing';
|
|
9
10
|
import * as THREE from 'three';
|
|
10
11
|
/**
|
|
11
12
|
* Options for scene.export() convenience method.
|
|
@@ -95,6 +96,7 @@ export declare class Scene {
|
|
|
95
96
|
private _stateManager;
|
|
96
97
|
private _audioManager;
|
|
97
98
|
private _multiCamera;
|
|
99
|
+
private _postProcessing;
|
|
98
100
|
private _container;
|
|
99
101
|
private _resizeObserver;
|
|
100
102
|
private _resizeRafId;
|
|
@@ -129,6 +131,21 @@ export declare class Scene {
|
|
|
129
131
|
* @returns this for chaining
|
|
130
132
|
*/
|
|
131
133
|
useMultiCamera(mc: MultiCamera | null): this;
|
|
134
|
+
/**
|
|
135
|
+
* Get the attached post-processing pipeline, or null when the default
|
|
136
|
+
* direct render path is in use.
|
|
137
|
+
*/
|
|
138
|
+
get postProcessing(): PostProcessingPipeline | null;
|
|
139
|
+
/**
|
|
140
|
+
* Attach (or detach) an opt-in GPU post-processing pipeline (bloom, vignette,
|
|
141
|
+
* depth of field). Pass `null` to revert to the direct render path. Has no
|
|
142
|
+
* effect in headless mode (the NullRenderer has no WebGL context). The
|
|
143
|
+
* pipeline preloads its modules so later frames can route through the
|
|
144
|
+
* composer; until they load, the direct path is used.
|
|
145
|
+
* @param pipeline - PostProcessingPipeline instance, or null to detach
|
|
146
|
+
* @returns this for chaining
|
|
147
|
+
*/
|
|
148
|
+
usePostProcessing(pipeline: PostProcessingPipeline | null): this;
|
|
132
149
|
/**
|
|
133
150
|
* Whether this scene is running in headless mode (no WebGL renderer).
|
|
134
151
|
*/
|
|
@@ -363,6 +380,12 @@ export declare class Scene {
|
|
|
363
380
|
* Protected so subclasses (e.g. ZoomedScene) can override for multi-pass rendering.
|
|
364
381
|
*/
|
|
365
382
|
protected _render(): void;
|
|
383
|
+
/**
|
|
384
|
+
* Render through the attached post-processing pipeline. Guards for a lost
|
|
385
|
+
* WebGL context the same way {@link _renderMultiCamera} does.
|
|
386
|
+
* @returns true if the composer drew the frame, false to fall back
|
|
387
|
+
*/
|
|
388
|
+
protected _renderPostProcessing(): boolean;
|
|
366
389
|
/**
|
|
367
390
|
* Render via the attached MultiCamera. Clears the full canvas first so
|
|
368
391
|
* arbitrary viewport layouts (e.g. picture-in-picture) don't leak stale
|
package/dist/core/Scene.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/core/Scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,SAAS,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAiB,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAA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iB,CAAC,KAAK,EAAE,MAAM,EAElC;IAED;;;OAGG;IACH,mBAAmB,IAAI,MAAM;IAQ7B;;OAEG;IACH,IAAI,YAAY,IAAI,iBAAiB,CAEpC;IAED;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa;IAIxC;;;;;OAKG;IACH,IAAI,IAAI,OAAO;IAQf;;;;;OAKG;IACH,IAAI,IAAI,OAAO;IAQf;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa;IAIvC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAOvC;;;OAGG;IACH,MAAM,IAAI,IAAI;IAQd;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8C3E;;OAEG;IACH,OAAO,IAAI,IAAI;CA+ChB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { applyReducedMotion, getReducedMotionRunTime, isReducedMotionEnabled, pr
|
|
|
29
29
|
export { announceMobject, AriaNarrator, createLiveRegion, describeMobject, type AriaDescribable, type LiveRegionOptions, } from './a11y/ariaNarration';
|
|
30
30
|
export { Renderer, type RendererOptions, type IRenderer } from './core/Renderer';
|
|
31
31
|
export { NullRenderer } from './core/NullRenderer';
|
|
32
|
+
export { PostProcessingPipeline, setPostProcessingModules, setPostProcessingModulesLoader, type BloomOptions, type VignetteOptions, type DepthOfFieldOptions, type PassConfig, type ComposerLike, type PostProcessingModules, type PostProcessingModulesLoader, } from './core/PostProcessing';
|
|
32
33
|
export { SceneStateManager, serializeMobject, deserializeMobject, saveMobjectState, restoreMobjectState, stateToJSON, stateFromJSON, snapshotToJSON, snapshotFromJSON, type MobjectState, type SceneSnapshot, } from './core/StateManager';
|
|
33
34
|
export { Camera2D, type CameraOptions, type Camera2DAspectMode, Camera3D, type Camera3DOptions, } from './core/Camera';
|
|
34
35
|
export { Camera2DFrame } from './core/Camera2DFrame';
|
|
@@ -102,6 +103,7 @@ export { Controls, type ControlsOptions, type ControlsPosition, type ControlsThe
|
|
|
102
103
|
export { Draggable, makeDraggable, type DraggableOptions, Hoverable, makeHoverable, type HoverableOptions, Clickable, makeClickable, type ClickableOptions, } from './interaction';
|
|
103
104
|
export { SelectionManager, type SelectionManagerOptions } from './interaction';
|
|
104
105
|
export { OrbitControls, type OrbitControlsOptions } from './interaction';
|
|
106
|
+
export { PanZoomControls, makePanZoomControls, type PanZoomControlsOptions, type PanZoomCamera, type PanZoomBounds, } from './interaction';
|
|
105
107
|
export { MovablePoint, makeMovablePoint, type MovablePointOptions, Slider, makeSlider, type SliderOptions, } from './interaction';
|
|
106
108
|
export { MatrixTracker, makeMatrixTracker, applyMatrixLive, type Matrix2x2, type MatrixSource, type BasisVectorSource, type DependentPoint, type DynamicMatrixOptions, type LiveMatrixBinding, } from './interaction';
|
|
107
109
|
export { GifExporter, createGifExporter, type GifExportOptions, VideoExporter, createVideoExporter, type VideoExportOptions, } from './export';
|