@soonspacejs/plugin-atmosphere 2.16.8 → 3.0.0-alpha.1
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/index.d.ts +1312 -65
- package/dist/index.esm.js +10 -10
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -11552,16 +11552,16 @@ class Md {
|
|
|
11552
11552
|
start() {
|
|
11553
11553
|
if (this._started) return;
|
|
11554
11554
|
this._started = !0;
|
|
11555
|
-
const { scene: e, camera: t, effectManager: r, signals: n
|
|
11555
|
+
const { scene: e, camera: t, effectManager: r, signals: n } = this.ssp.viewport;
|
|
11556
11556
|
(async () => {
|
|
11557
|
-
const
|
|
11558
|
-
Object.assign(this.skyMaterial,
|
|
11557
|
+
const s = await this.texturesGenerator.update();
|
|
11558
|
+
Object.assign(this.skyMaterial, s), this.sunLight.transmittanceTexture = s.transmittanceTexture, this.skyLight.irradianceTexture = s.irradianceTexture, Object.assign(this.aerialPerspectiveEffect, s), Object.assign(this.cloudsEffect, s), this.neesUpdate = !0, this.ssp.render();
|
|
11559
11559
|
})(), e.add(this.skyMesh), e.add(this.skyLight), e.add(this.sunLight), e.add(this.sunLight.target), this.aerialPerspective.enabled = !0, this.aerialPerspectiveEffect.mainCamera = t, this.lensFlare.enabled = !0, this.dithering.enabled = !0, this.cloudsEffect.qualityPreset = this.cloudQuality, this.cloudsEffect.coverage = this.cloudCoverage, this.clouds.enabled = !0;
|
|
11560
|
-
const
|
|
11561
|
-
|
|
11560
|
+
const a = r.effectsMap.get("smaaEffect"), o = r.passesMap.get("normalPass");
|
|
11561
|
+
a && (a.enabled = !1), o ? (o.enabled = !0, this.aerialPerspectiveEffect.normalBuffer = o.texture, this.aerialPerspectiveEffect.sunLight = !0, this.aerialPerspectiveEffect.skyLight = !0, this.aerialPerspectiveEffect.lightingMask = {
|
|
11562
11562
|
map: this.lightingMaskPass.texture,
|
|
11563
11563
|
channel: "r"
|
|
11564
|
-
}) : (this.aerialPerspectiveEffect.normalBuffer = null, this.aerialPerspectiveEffect.sunLight = !1, this.aerialPerspectiveEffect.skyLight = !1, this.aerialPerspectiveEffect.lightingMask = null), this.ssp.setToneMapping({ type: "AGX", exposure: 10 }), e.environment = this.cubeRenderTarget.texture, r.effectsMap.set("cloudsEffect", this.clouds), r.effectsMap.set("aerialPerspectiveEffect", this.aerialPerspective), r.effectsMap.set("lensFlareEffect", this.lensFlare), r.effectsMap.set("ditheringEffect", this.dithering), r.effectsNeedsUpdate = !0, r.effectComposer.addPass(this.lightingMaskPass, -1), n.beforeRender.add(this.update)
|
|
11564
|
+
}) : (this.aerialPerspectiveEffect.normalBuffer = null, this.aerialPerspectiveEffect.sunLight = !1, this.aerialPerspectiveEffect.skyLight = !1, this.aerialPerspectiveEffect.lightingMask = null), this.ssp.setToneMapping({ type: "AGX", exposure: 10 }), e.environment = this.cubeRenderTarget.texture, r.effectsMap.set("cloudsEffect", this.clouds), r.effectsMap.set("aerialPerspectiveEffect", this.aerialPerspective), r.effectsMap.set("lensFlareEffect", this.lensFlare), r.effectsMap.set("ditheringEffect", this.dithering), r.effectsNeedsUpdate = !0, r.effectComposer.addPass(this.lightingMaskPass, -1), n.beforeRender.add(this.update);
|
|
11565
11565
|
}
|
|
11566
11566
|
updateModelLightingMask() {
|
|
11567
11567
|
this._started && this.ssp.viewport.scener.intersectsList.meshOfModelList.forEach((e) => {
|
|
@@ -11603,13 +11603,13 @@ class Md {
|
|
|
11603
11603
|
stop() {
|
|
11604
11604
|
if (!this._started) return;
|
|
11605
11605
|
this._started = !1;
|
|
11606
|
-
const { scene: e, effectManager: t, signals: r
|
|
11606
|
+
const { scene: e, effectManager: t, signals: r } = this.ssp.viewport;
|
|
11607
11607
|
e.remove(this.skyMesh), e.remove(this.skyLight), e.remove(this.sunLight), e.remove(this.sunLight.target), this.aerialPerspective.enabled = !1, this.lensFlare.enabled = !1, this.dithering.enabled = !1, this.clouds.enabled = !1;
|
|
11608
|
-
const
|
|
11609
|
-
|
|
11608
|
+
const n = t.effectsMap.get("smaaEffect"), a = t.passesMap.get("normalPass");
|
|
11609
|
+
n && (n.enabled = !0), a && (a.enabled = !1), this.ssp.setToneMapping({ type: "ACESFilmic", exposure: 0.8 }), this.ssp.setEnvironment(), t.effectsMap.delete("cloudsEffect"), t.effectsMap.delete("aerialPerspectiveEffect"), t.effectsMap.delete("lensFlareEffect"), t.effectsMap.delete("ditheringEffect"), t.effectsNeedsUpdate = !0, t.effectComposer.removePass(this.lightingMaskPass), r.beforeRender.remove(this.update), this.ssp.render();
|
|
11610
11610
|
}
|
|
11611
11611
|
dispose() {
|
|
11612
|
-
this.stop(), this.
|
|
11612
|
+
this.stop(), this.aerialPerspectiveEffect.dispose(), this.lensFlareEffect.dispose(), this.ditheringEffect.dispose(), this.cloudsEffect.dispose(), this.lightingMaskPass.dispose(), this.texturesGenerator.dispose(), this.skyMesh.geometry.dispose(), this.skyMesh.material.dispose(), this.skyLight.dispose(), this.sunLight.dispose(), this.cubeRenderTarget.dispose();
|
|
11613
11613
|
}
|
|
11614
11614
|
}
|
|
11615
11615
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-atmosphere",
|
|
3
3
|
"pluginName": "AtmospherePlugin",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0-alpha.1",
|
|
5
5
|
"description": "Atmosphere plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"gitHead": "4a87dd85050651088e11c3da777c49fab3db7e5d",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"soonspacejs": "
|
|
18
|
+
"soonspacejs": "3.0.0-alpha.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@takram/three-atmosphere": "0.18.0",
|