lythreeframe 1.2.19 → 1.2.21

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.
@@ -1318,12 +1318,12 @@ const DefaultAAParams = {
1318
1318
  };
1319
1319
 
1320
1320
  const DefaultPostProcessParam = {
1321
- bloom: DefaultBloomParam,
1322
- dof: DefaultDOFParam,
1323
- ssr: DefaultSSRParam,
1324
- gtao: DefaultGTAOParam,
1325
- outline: DefaultOutlineParams,
1326
- aa: DefaultAAParams
1321
+ bloom: Object.assign({}, DefaultBloomParam),
1322
+ dof: Object.assign({}, DefaultDOFParam),
1323
+ ssr: Object.assign({}, DefaultSSRParam),
1324
+ gtao: Object.assign({}, DefaultGTAOParam),
1325
+ outline: Object.assign({}, DefaultOutlineParams),
1326
+ aa: Object.assign({}, DefaultAAParams)
1327
1327
  };
1328
1328
 
1329
1329
  class World {
@@ -1575,7 +1575,7 @@ class Viewport {
1575
1575
  // private motionBlurPass: ShaderNodeObject<Node> | null = null;
1576
1576
  // private denoiseOutlinePass: ShaderNodeObject<DenoiseNode> | null = null;
1577
1577
  this.outlineObjects = [];
1578
- this.postProcessParam = postProcessParam;
1578
+ this.postProcessParam = Object.assign({}, postProcessParam);
1579
1579
  this._app = app;
1580
1580
  let element = null;
1581
1581
  if (viewportParam.elementId) {
@@ -1685,24 +1685,6 @@ class Viewport {
1685
1685
  this.dofPass = null;
1686
1686
  }
1687
1687
  }
1688
- // motion blur
1689
- // if (this.postProcessParam.motionBlur)
1690
- // {
1691
- // if (!this.motionBlurPass)
1692
- // {
1693
- // this.motionBlurPass = WebGPUPostProcessFactory.constructMotionBlurPass(finalNode, this.scenePass, this.postProcessParam.motionBlur);
1694
- // }
1695
- // const vignette = screenUV.distance(.5).remap(.6, 1).mul(2).clamp().oneMinus();
1696
- // finalNode = mix(this.motionBlurPass, this.scenePass.getTextureNode("velocity"), 0).mul(vignette);
1697
- // }
1698
- // else
1699
- // {
1700
- // if (this.motionBlurPass)
1701
- // {
1702
- // this.motionBlurPass.dispose();
1703
- // this.motionBlurPass = null;
1704
- // }
1705
- // }
1706
1688
  // ssr
1707
1689
  if (isSSREnabled) {
1708
1690
  if (!this.ssrPass) {
@@ -1801,23 +1783,27 @@ class Viewport {
1801
1783
  this.markRenderStateDirty();
1802
1784
  }
1803
1785
  updateBloomPass(params) {
1804
- this.postProcessParam.bloom = params;
1786
+ this.postProcessParam.bloom = Object.assign({}, params);
1805
1787
  this.setupPostProcess();
1806
1788
  }
1807
1789
  updateGTAOParam(params) {
1808
- this.postProcessParam.gtao = params;
1790
+ this.postProcessParam.gtao = Object.assign({}, params);
1809
1791
  this.setupPostProcess();
1810
1792
  }
1811
1793
  updateDOFParam(params) {
1812
- this.postProcessParam.dof = params;
1794
+ this.postProcessParam.dof = Object.assign({}, params);
1813
1795
  this.setupPostProcess();
1814
1796
  }
1815
1797
  updateSSRParam(params) {
1816
- this.postProcessParam.ssr = params;
1798
+ this.postProcessParam.ssr = Object.assign({}, params);
1817
1799
  this.setupPostProcess();
1818
1800
  }
1819
1801
  updateOutlineParam(params) {
1820
- this.postProcessParam.outline = params;
1802
+ this.postProcessParam.outline = Object.assign({}, params);
1803
+ this.setupPostProcess();
1804
+ }
1805
+ updateAAParam(params) {
1806
+ this.postProcessParam.aa = Object.assign({}, params);
1821
1807
  this.setupPostProcess();
1822
1808
  }
1823
1809
  addOutlineObject(obj) {
@@ -1316,12 +1316,12 @@ const DefaultAAParams = {
1316
1316
  };
1317
1317
 
1318
1318
  const DefaultPostProcessParam = {
1319
- bloom: DefaultBloomParam,
1320
- dof: DefaultDOFParam,
1321
- ssr: DefaultSSRParam,
1322
- gtao: DefaultGTAOParam,
1323
- outline: DefaultOutlineParams,
1324
- aa: DefaultAAParams
1319
+ bloom: Object.assign({}, DefaultBloomParam),
1320
+ dof: Object.assign({}, DefaultDOFParam),
1321
+ ssr: Object.assign({}, DefaultSSRParam),
1322
+ gtao: Object.assign({}, DefaultGTAOParam),
1323
+ outline: Object.assign({}, DefaultOutlineParams),
1324
+ aa: Object.assign({}, DefaultAAParams)
1325
1325
  };
1326
1326
 
1327
1327
  class World {
@@ -1573,7 +1573,7 @@ class Viewport {
1573
1573
  // private motionBlurPass: ShaderNodeObject<Node> | null = null;
1574
1574
  // private denoiseOutlinePass: ShaderNodeObject<DenoiseNode> | null = null;
1575
1575
  this.outlineObjects = [];
1576
- this.postProcessParam = postProcessParam;
1576
+ this.postProcessParam = Object.assign({}, postProcessParam);
1577
1577
  this._app = app;
1578
1578
  let element = null;
1579
1579
  if (viewportParam.elementId) {
@@ -1683,24 +1683,6 @@ class Viewport {
1683
1683
  this.dofPass = null;
1684
1684
  }
1685
1685
  }
1686
- // motion blur
1687
- // if (this.postProcessParam.motionBlur)
1688
- // {
1689
- // if (!this.motionBlurPass)
1690
- // {
1691
- // this.motionBlurPass = WebGPUPostProcessFactory.constructMotionBlurPass(finalNode, this.scenePass, this.postProcessParam.motionBlur);
1692
- // }
1693
- // const vignette = screenUV.distance(.5).remap(.6, 1).mul(2).clamp().oneMinus();
1694
- // finalNode = mix(this.motionBlurPass, this.scenePass.getTextureNode("velocity"), 0).mul(vignette);
1695
- // }
1696
- // else
1697
- // {
1698
- // if (this.motionBlurPass)
1699
- // {
1700
- // this.motionBlurPass.dispose();
1701
- // this.motionBlurPass = null;
1702
- // }
1703
- // }
1704
1686
  // ssr
1705
1687
  if (isSSREnabled) {
1706
1688
  if (!this.ssrPass) {
@@ -1799,23 +1781,27 @@ class Viewport {
1799
1781
  this.markRenderStateDirty();
1800
1782
  }
1801
1783
  updateBloomPass(params) {
1802
- this.postProcessParam.bloom = params;
1784
+ this.postProcessParam.bloom = Object.assign({}, params);
1803
1785
  this.setupPostProcess();
1804
1786
  }
1805
1787
  updateGTAOParam(params) {
1806
- this.postProcessParam.gtao = params;
1788
+ this.postProcessParam.gtao = Object.assign({}, params);
1807
1789
  this.setupPostProcess();
1808
1790
  }
1809
1791
  updateDOFParam(params) {
1810
- this.postProcessParam.dof = params;
1792
+ this.postProcessParam.dof = Object.assign({}, params);
1811
1793
  this.setupPostProcess();
1812
1794
  }
1813
1795
  updateSSRParam(params) {
1814
- this.postProcessParam.ssr = params;
1796
+ this.postProcessParam.ssr = Object.assign({}, params);
1815
1797
  this.setupPostProcess();
1816
1798
  }
1817
1799
  updateOutlineParam(params) {
1818
- this.postProcessParam.outline = params;
1800
+ this.postProcessParam.outline = Object.assign({}, params);
1801
+ this.setupPostProcess();
1802
+ }
1803
+ updateAAParam(params) {
1804
+ this.postProcessParam.aa = Object.assign({}, params);
1819
1805
  this.setupPostProcess();
1820
1806
  }
1821
1807
  addOutlineObject(obj) {
@@ -1,5 +1,6 @@
1
1
  import { Object3D } from 'three/src/Three.WebGPU.Nodes.js';
2
2
  import { ShadowMapType, ToneMapping, WebGPURenderer } from "three/webgpu";
3
+ import { AAParams } from "../PostProcess/Param/AAParam";
3
4
  import { BloomParam } from "../PostProcess/Param/Bloom";
4
5
  import { DOFParam } from '../PostProcess/Param/DOF';
5
6
  import { GTAOParam } from "../PostProcess/Param/GTAO";
@@ -39,6 +40,7 @@ export declare class Viewport {
39
40
  updateDOFParam(params: DOFParam): void;
40
41
  updateSSRParam(params: SSRParam): void;
41
42
  updateOutlineParam(params: OutlineParams): void;
43
+ updateAAParam(params: AAParams): void;
42
44
  addOutlineObject(obj: Object3D): void;
43
45
  setOutlineObjects(objects: Object3D[]): void;
44
46
  removeOutlineObject(obj: Object3D): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",