lythreeframe 1.2.56 → 1.2.58
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/bundle.cjs.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
var webgpu = require('three/webgpu');
|
|
4
4
|
var Addons_js = require('three/examples/jsm/Addons.js');
|
|
5
5
|
var tsl = require('three/tsl');
|
|
6
|
-
var DepthOfFieldNode_js = require('three/
|
|
6
|
+
var DepthOfFieldNode_js = require('three/examples/jsm/tsl/display/DepthOfFieldNode.js');
|
|
7
7
|
var BloomNode_js = require('three/examples/jsm/tsl/display/BloomNode.js');
|
|
8
8
|
var DenoiseNode_js = require('three/examples/jsm/tsl/display/DenoiseNode.js');
|
|
9
9
|
var FXAANode_js = require('three/examples/jsm/tsl/display/FXAANode.js');
|
|
10
10
|
var GTAONode_js = require('three/examples/jsm/tsl/display/GTAONode.js');
|
|
11
11
|
var OutlineNode_js = require('three/examples/jsm/tsl/display/OutlineNode.js');
|
|
12
12
|
var SMAANode_js = require('three/examples/jsm/tsl/display/SMAANode.js');
|
|
13
|
+
var SSRNode_js = require('three/examples/jsm/tsl/display/SSRNode.js');
|
|
13
14
|
var gsap = require('gsap');
|
|
14
15
|
var three = require('three');
|
|
15
16
|
var SkyMesh_js = require('three/examples/jsm/objects/SkyMesh.js');
|
|
@@ -1430,12 +1431,14 @@ class WebGPUPostProcessFactory {
|
|
|
1430
1431
|
static constructDOFPass(scenePass, params) {
|
|
1431
1432
|
const scenePassColor = scenePass.getTextureNode('output');
|
|
1432
1433
|
const scenePassViewZ = scenePass.getViewZNode();
|
|
1433
|
-
|
|
1434
|
+
const dofPass = DepthOfFieldNode_js.dof(scenePassColor, scenePassViewZ, tsl.uniform(1), tsl.uniform(0.01), tsl.uniform(0.01));
|
|
1435
|
+
WebGPUPostProcessFactory.updateDOFPass(dofPass, params);
|
|
1436
|
+
return dofPass;
|
|
1434
1437
|
}
|
|
1435
1438
|
static updateDOFPass(dofPass, params) {
|
|
1436
|
-
dofPass.
|
|
1437
|
-
dofPass.
|
|
1438
|
-
dofPass.
|
|
1439
|
+
dofPass.focusDistanceNode.value = params.focus;
|
|
1440
|
+
dofPass.focalLengthNode.value = params.aperture;
|
|
1441
|
+
dofPass.bokehScaleNode.value = params.maxblur;
|
|
1439
1442
|
}
|
|
1440
1443
|
// motion blur
|
|
1441
1444
|
// static constructMotionBlurPass(lastNode:NodeRepresentation, scenePass: ShaderNodeObject<PassNode>, param:MotionBlurParam): ShaderNodeObject<Node>
|
|
@@ -1447,20 +1450,19 @@ class WebGPUPostProcessFactory {
|
|
|
1447
1450
|
// return motionBlurPass
|
|
1448
1451
|
// }
|
|
1449
1452
|
// ssr
|
|
1450
|
-
static constructSSRPass(scenePass,
|
|
1453
|
+
static constructSSRPass(scenePass, params) {
|
|
1451
1454
|
WebGPUPostProcessFactory.updateScenePass(scenePass, {
|
|
1452
1455
|
output: tsl.output,
|
|
1453
1456
|
normal: tsl.transformedNormalView,
|
|
1454
1457
|
metalness: tsl.metalness
|
|
1455
1458
|
});
|
|
1456
|
-
|
|
1457
|
-
scenePass.getTextureNode('
|
|
1458
|
-
scenePass.getTextureNode('
|
|
1459
|
-
scenePass.getTextureNode('
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
//WebGPUPostProcessFactory.updateSSRPass(ssrPass, param);
|
|
1459
|
+
const scenePassColor = scenePass.getTextureNode('output');
|
|
1460
|
+
const scenePassDepth = scenePass.getTextureNode('depth');
|
|
1461
|
+
const scenePassNormal = scenePass.getTextureNode('normal');
|
|
1462
|
+
const scenePassMetalness = scenePass.getTextureNode('metalness');
|
|
1463
|
+
const ssrPass = SSRNode_js.ssr(scenePassColor, scenePassDepth, scenePassNormal, scenePassMetalness, scenePass.camera);
|
|
1464
|
+
ssrPass.resolutionScale = 1.0;
|
|
1465
|
+
WebGPUPostProcessFactory.updateSSRPass(ssrPass, params);
|
|
1464
1466
|
return ssrPass;
|
|
1465
1467
|
}
|
|
1466
1468
|
static updateSSRPass(ssrPass, params) {
|
|
@@ -1527,9 +1529,10 @@ class WebGPUPostProcessFactory {
|
|
|
1527
1529
|
static constructOutlinePass(scene, camera, outlineObjects, param) {
|
|
1528
1530
|
const outlinePass = OutlineNode_js.outline(scene, camera, {
|
|
1529
1531
|
selectedObjects: outlineObjects,
|
|
1530
|
-
edgeGlow:
|
|
1531
|
-
edgeThickness:
|
|
1532
|
+
edgeGlow: tsl.uniform(1),
|
|
1533
|
+
edgeThickness: tsl.uniform(1)
|
|
1532
1534
|
});
|
|
1535
|
+
WebGPUPostProcessFactory.updateOutlinePass(outlinePass, outlineObjects, param);
|
|
1533
1536
|
return outlinePass;
|
|
1534
1537
|
}
|
|
1535
1538
|
static updateOutlinePass(outlinePass, outlineObjects, params) {
|
|
@@ -1563,6 +1566,9 @@ class PostProcessManager {
|
|
|
1563
1566
|
}
|
|
1564
1567
|
updateCamera(camera) {
|
|
1565
1568
|
this.camera = camera;
|
|
1569
|
+
if (this.postProcessing) {
|
|
1570
|
+
this.setup();
|
|
1571
|
+
}
|
|
1566
1572
|
}
|
|
1567
1573
|
setup() {
|
|
1568
1574
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -1570,9 +1576,10 @@ class PostProcessManager {
|
|
|
1570
1576
|
this.markDirty();
|
|
1571
1577
|
return;
|
|
1572
1578
|
}
|
|
1573
|
-
if (
|
|
1574
|
-
this.postProcessing
|
|
1579
|
+
if (this.postProcessing) {
|
|
1580
|
+
this.postProcessing.dispose();
|
|
1575
1581
|
}
|
|
1582
|
+
this.postProcessing = new webgpu.PostProcessing(this.renderer);
|
|
1576
1583
|
const scenePass = WebGPUPostProcessFactory.constructScenePass(this.scene, this.camera);
|
|
1577
1584
|
let finalNode = scenePass.getTextureNode('output');
|
|
1578
1585
|
this.postProcessParam.steps.forEach((step) => {
|
|
@@ -1585,18 +1592,32 @@ class PostProcessManager {
|
|
|
1585
1592
|
}
|
|
1586
1593
|
case exports.PostProcessStepType.DepthOfField:
|
|
1587
1594
|
{
|
|
1588
|
-
|
|
1589
|
-
finalNode = finalNode.add(dofPass);
|
|
1595
|
+
finalNode = WebGPUPostProcessFactory.constructDOFPass(scenePass, step);
|
|
1590
1596
|
break;
|
|
1591
1597
|
}
|
|
1592
1598
|
case exports.PostProcessStepType.ScreenSpaceReflection:
|
|
1593
1599
|
{
|
|
1594
|
-
|
|
1600
|
+
const ssrParam = step;
|
|
1601
|
+
const ssrPass = WebGPUPostProcessFactory.constructSSRPass(scenePass, ssrParam);
|
|
1602
|
+
if (ssrPass) {
|
|
1603
|
+
finalNode = finalNode.add(ssrPass);
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
console.warn("[PostProcess] SSR 目前存在技术问题,暂不支持。");
|
|
1607
|
+
}
|
|
1595
1608
|
break;
|
|
1596
1609
|
}
|
|
1597
1610
|
case exports.PostProcessStepType.GroundTruthAmbientOcclusion:
|
|
1598
1611
|
{
|
|
1599
|
-
|
|
1612
|
+
const gtaoParam = step;
|
|
1613
|
+
const gtaoPass = WebGPUPostProcessFactory.constructGTAOPass(scenePass, gtaoParam);
|
|
1614
|
+
if (gtaoParam.denoised) {
|
|
1615
|
+
const denoisePass = WebGPUPostProcessFactory.constructGTAODenoisePass(scenePass, gtaoPass, gtaoParam);
|
|
1616
|
+
finalNode = finalNode.mul(denoisePass);
|
|
1617
|
+
}
|
|
1618
|
+
else {
|
|
1619
|
+
finalNode = finalNode.mul(gtaoPass);
|
|
1620
|
+
}
|
|
1600
1621
|
break;
|
|
1601
1622
|
}
|
|
1602
1623
|
case exports.PostProcessStepType.Outline:
|
|
@@ -1605,7 +1626,8 @@ class PostProcessManager {
|
|
|
1605
1626
|
const outlinePass = WebGPUPostProcessFactory.constructOutlinePass(this.scene, scenePass.camera, this.outlineObjects, outlineParam);
|
|
1606
1627
|
const { visibleEdge, hiddenEdge } = outlinePass;
|
|
1607
1628
|
const pulsePeriod = tsl.uniform(outlineParam.pulsePeriod);
|
|
1608
|
-
const
|
|
1629
|
+
const safePulsePeriod = pulsePeriod.greaterThan(0).select(pulsePeriod, tsl.uniform(1));
|
|
1630
|
+
const period = tsl.time.div(safePulsePeriod).mul(2);
|
|
1609
1631
|
const osc = tsl.oscSine(period).mul(.5).add(.5);
|
|
1610
1632
|
const outlineColor = visibleEdge
|
|
1611
1633
|
.mul(tsl.uniform(new webgpu.Color(outlineParam.visibleEdgeColor)))
|
|
@@ -1659,7 +1681,6 @@ class PostProcessManager {
|
|
|
1659
1681
|
this.postProcessing.render();
|
|
1660
1682
|
return true;
|
|
1661
1683
|
}
|
|
1662
|
-
console.log("render false");
|
|
1663
1684
|
return false;
|
|
1664
1685
|
}
|
|
1665
1686
|
async renderAsync() {
|
|
@@ -1878,7 +1899,6 @@ class Viewport {
|
|
|
1878
1899
|
}
|
|
1879
1900
|
render() {
|
|
1880
1901
|
if (!this.isRenderStateDirty) {
|
|
1881
|
-
console.log("render clean retrn");
|
|
1882
1902
|
return;
|
|
1883
1903
|
}
|
|
1884
1904
|
if (this.postProcessManager && this.postProcessManager.render()) ;
|
|
@@ -1990,6 +2010,10 @@ class Viewport {
|
|
|
1990
2010
|
this._renderer.dispose();
|
|
1991
2011
|
this._renderer = null;
|
|
1992
2012
|
}
|
|
2013
|
+
if (this._canvasContainer) {
|
|
2014
|
+
this._canvasContainer.remove();
|
|
2015
|
+
this._canvasContainer = null;
|
|
2016
|
+
}
|
|
1993
2017
|
this._outerContainer = null;
|
|
1994
2018
|
this._app = null;
|
|
1995
2019
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { MathUtils, Object3D, Vector3, Box3, Quaternion, Euler, Matrix4, Mesh, LoadingManager, BufferGeometry, Texture, FileLoader, Material, NearestFilter, PostProcessing, Color, WebGPURenderer, Vector2, Raycaster, OrthographicCamera, PerspectiveCamera, Clock, DirectionalLight, AmbientLight, MeshStandardMaterial, BoxGeometry, MeshBasicMaterial, PlaneGeometry, SphereGeometry } from 'three/webgpu';
|
|
2
2
|
import { GLTFLoader, DRACOLoader, CSS2DRenderer, OrbitControls } from 'three/examples/jsm/Addons.js';
|
|
3
3
|
import { pass, mrt, output, uniform, metalness, transformedNormalView, time, oscSine } from 'three/tsl';
|
|
4
|
-
import { dof } from 'three/
|
|
4
|
+
import { dof } from 'three/examples/jsm/tsl/display/DepthOfFieldNode.js';
|
|
5
5
|
import { bloom } from 'three/examples/jsm/tsl/display/BloomNode.js';
|
|
6
6
|
import { denoise } from 'three/examples/jsm/tsl/display/DenoiseNode.js';
|
|
7
7
|
import { fxaa } from 'three/examples/jsm/tsl/display/FXAANode.js';
|
|
8
8
|
import { ao } from 'three/examples/jsm/tsl/display/GTAONode.js';
|
|
9
9
|
import { outline } from 'three/examples/jsm/tsl/display/OutlineNode.js';
|
|
10
10
|
import { smaa } from 'three/examples/jsm/tsl/display/SMAANode.js';
|
|
11
|
+
import { ssr } from 'three/examples/jsm/tsl/display/SSRNode.js';
|
|
11
12
|
import { gsap } from 'gsap';
|
|
12
13
|
import { Scene } from 'three';
|
|
13
14
|
import { SkyMesh } from 'three/examples/jsm/objects/SkyMesh.js';
|
|
@@ -1428,12 +1429,14 @@ class WebGPUPostProcessFactory {
|
|
|
1428
1429
|
static constructDOFPass(scenePass, params) {
|
|
1429
1430
|
const scenePassColor = scenePass.getTextureNode('output');
|
|
1430
1431
|
const scenePassViewZ = scenePass.getViewZNode();
|
|
1431
|
-
|
|
1432
|
+
const dofPass = dof(scenePassColor, scenePassViewZ, uniform(1), uniform(0.01), uniform(0.01));
|
|
1433
|
+
WebGPUPostProcessFactory.updateDOFPass(dofPass, params);
|
|
1434
|
+
return dofPass;
|
|
1432
1435
|
}
|
|
1433
1436
|
static updateDOFPass(dofPass, params) {
|
|
1434
|
-
dofPass.
|
|
1435
|
-
dofPass.
|
|
1436
|
-
dofPass.
|
|
1437
|
+
dofPass.focusDistanceNode.value = params.focus;
|
|
1438
|
+
dofPass.focalLengthNode.value = params.aperture;
|
|
1439
|
+
dofPass.bokehScaleNode.value = params.maxblur;
|
|
1437
1440
|
}
|
|
1438
1441
|
// motion blur
|
|
1439
1442
|
// static constructMotionBlurPass(lastNode:NodeRepresentation, scenePass: ShaderNodeObject<PassNode>, param:MotionBlurParam): ShaderNodeObject<Node>
|
|
@@ -1445,20 +1448,19 @@ class WebGPUPostProcessFactory {
|
|
|
1445
1448
|
// return motionBlurPass
|
|
1446
1449
|
// }
|
|
1447
1450
|
// ssr
|
|
1448
|
-
static constructSSRPass(scenePass,
|
|
1451
|
+
static constructSSRPass(scenePass, params) {
|
|
1449
1452
|
WebGPUPostProcessFactory.updateScenePass(scenePass, {
|
|
1450
1453
|
output: output,
|
|
1451
1454
|
normal: transformedNormalView,
|
|
1452
1455
|
metalness: metalness
|
|
1453
1456
|
});
|
|
1454
|
-
|
|
1455
|
-
scenePass.getTextureNode('
|
|
1456
|
-
scenePass.getTextureNode('
|
|
1457
|
-
scenePass.getTextureNode('
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
//WebGPUPostProcessFactory.updateSSRPass(ssrPass, param);
|
|
1457
|
+
const scenePassColor = scenePass.getTextureNode('output');
|
|
1458
|
+
const scenePassDepth = scenePass.getTextureNode('depth');
|
|
1459
|
+
const scenePassNormal = scenePass.getTextureNode('normal');
|
|
1460
|
+
const scenePassMetalness = scenePass.getTextureNode('metalness');
|
|
1461
|
+
const ssrPass = ssr(scenePassColor, scenePassDepth, scenePassNormal, scenePassMetalness, scenePass.camera);
|
|
1462
|
+
ssrPass.resolutionScale = 1.0;
|
|
1463
|
+
WebGPUPostProcessFactory.updateSSRPass(ssrPass, params);
|
|
1462
1464
|
return ssrPass;
|
|
1463
1465
|
}
|
|
1464
1466
|
static updateSSRPass(ssrPass, params) {
|
|
@@ -1525,9 +1527,10 @@ class WebGPUPostProcessFactory {
|
|
|
1525
1527
|
static constructOutlinePass(scene, camera, outlineObjects, param) {
|
|
1526
1528
|
const outlinePass = outline(scene, camera, {
|
|
1527
1529
|
selectedObjects: outlineObjects,
|
|
1528
|
-
edgeGlow:
|
|
1529
|
-
edgeThickness:
|
|
1530
|
+
edgeGlow: uniform(1),
|
|
1531
|
+
edgeThickness: uniform(1)
|
|
1530
1532
|
});
|
|
1533
|
+
WebGPUPostProcessFactory.updateOutlinePass(outlinePass, outlineObjects, param);
|
|
1531
1534
|
return outlinePass;
|
|
1532
1535
|
}
|
|
1533
1536
|
static updateOutlinePass(outlinePass, outlineObjects, params) {
|
|
@@ -1561,6 +1564,9 @@ class PostProcessManager {
|
|
|
1561
1564
|
}
|
|
1562
1565
|
updateCamera(camera) {
|
|
1563
1566
|
this.camera = camera;
|
|
1567
|
+
if (this.postProcessing) {
|
|
1568
|
+
this.setup();
|
|
1569
|
+
}
|
|
1564
1570
|
}
|
|
1565
1571
|
setup() {
|
|
1566
1572
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -1568,9 +1574,10 @@ class PostProcessManager {
|
|
|
1568
1574
|
this.markDirty();
|
|
1569
1575
|
return;
|
|
1570
1576
|
}
|
|
1571
|
-
if (
|
|
1572
|
-
this.postProcessing
|
|
1577
|
+
if (this.postProcessing) {
|
|
1578
|
+
this.postProcessing.dispose();
|
|
1573
1579
|
}
|
|
1580
|
+
this.postProcessing = new PostProcessing(this.renderer);
|
|
1574
1581
|
const scenePass = WebGPUPostProcessFactory.constructScenePass(this.scene, this.camera);
|
|
1575
1582
|
let finalNode = scenePass.getTextureNode('output');
|
|
1576
1583
|
this.postProcessParam.steps.forEach((step) => {
|
|
@@ -1583,18 +1590,32 @@ class PostProcessManager {
|
|
|
1583
1590
|
}
|
|
1584
1591
|
case PostProcessStepType.DepthOfField:
|
|
1585
1592
|
{
|
|
1586
|
-
|
|
1587
|
-
finalNode = finalNode.add(dofPass);
|
|
1593
|
+
finalNode = WebGPUPostProcessFactory.constructDOFPass(scenePass, step);
|
|
1588
1594
|
break;
|
|
1589
1595
|
}
|
|
1590
1596
|
case PostProcessStepType.ScreenSpaceReflection:
|
|
1591
1597
|
{
|
|
1592
|
-
|
|
1598
|
+
const ssrParam = step;
|
|
1599
|
+
const ssrPass = WebGPUPostProcessFactory.constructSSRPass(scenePass, ssrParam);
|
|
1600
|
+
if (ssrPass) {
|
|
1601
|
+
finalNode = finalNode.add(ssrPass);
|
|
1602
|
+
}
|
|
1603
|
+
else {
|
|
1604
|
+
console.warn("[PostProcess] SSR 目前存在技术问题,暂不支持。");
|
|
1605
|
+
}
|
|
1593
1606
|
break;
|
|
1594
1607
|
}
|
|
1595
1608
|
case PostProcessStepType.GroundTruthAmbientOcclusion:
|
|
1596
1609
|
{
|
|
1597
|
-
|
|
1610
|
+
const gtaoParam = step;
|
|
1611
|
+
const gtaoPass = WebGPUPostProcessFactory.constructGTAOPass(scenePass, gtaoParam);
|
|
1612
|
+
if (gtaoParam.denoised) {
|
|
1613
|
+
const denoisePass = WebGPUPostProcessFactory.constructGTAODenoisePass(scenePass, gtaoPass, gtaoParam);
|
|
1614
|
+
finalNode = finalNode.mul(denoisePass);
|
|
1615
|
+
}
|
|
1616
|
+
else {
|
|
1617
|
+
finalNode = finalNode.mul(gtaoPass);
|
|
1618
|
+
}
|
|
1598
1619
|
break;
|
|
1599
1620
|
}
|
|
1600
1621
|
case PostProcessStepType.Outline:
|
|
@@ -1603,7 +1624,8 @@ class PostProcessManager {
|
|
|
1603
1624
|
const outlinePass = WebGPUPostProcessFactory.constructOutlinePass(this.scene, scenePass.camera, this.outlineObjects, outlineParam);
|
|
1604
1625
|
const { visibleEdge, hiddenEdge } = outlinePass;
|
|
1605
1626
|
const pulsePeriod = uniform(outlineParam.pulsePeriod);
|
|
1606
|
-
const
|
|
1627
|
+
const safePulsePeriod = pulsePeriod.greaterThan(0).select(pulsePeriod, uniform(1));
|
|
1628
|
+
const period = time.div(safePulsePeriod).mul(2);
|
|
1607
1629
|
const osc = oscSine(period).mul(.5).add(.5);
|
|
1608
1630
|
const outlineColor = visibleEdge
|
|
1609
1631
|
.mul(uniform(new Color(outlineParam.visibleEdgeColor)))
|
|
@@ -1657,7 +1679,6 @@ class PostProcessManager {
|
|
|
1657
1679
|
this.postProcessing.render();
|
|
1658
1680
|
return true;
|
|
1659
1681
|
}
|
|
1660
|
-
console.log("render false");
|
|
1661
1682
|
return false;
|
|
1662
1683
|
}
|
|
1663
1684
|
async renderAsync() {
|
|
@@ -1876,7 +1897,6 @@ class Viewport {
|
|
|
1876
1897
|
}
|
|
1877
1898
|
render() {
|
|
1878
1899
|
if (!this.isRenderStateDirty) {
|
|
1879
|
-
console.log("render clean retrn");
|
|
1880
1900
|
return;
|
|
1881
1901
|
}
|
|
1882
1902
|
if (this.postProcessManager && this.postProcessManager.render()) ;
|
|
@@ -1988,6 +2008,10 @@ class Viewport {
|
|
|
1988
2008
|
this._renderer.dispose();
|
|
1989
2009
|
this._renderer = null;
|
|
1990
2010
|
}
|
|
2011
|
+
if (this._canvasContainer) {
|
|
2012
|
+
this._canvasContainer.remove();
|
|
2013
|
+
this._canvasContainer = null;
|
|
2014
|
+
}
|
|
1991
2015
|
this._outerContainer = null;
|
|
1992
2016
|
this._app = null;
|
|
1993
2017
|
}
|
|
@@ -76,19 +76,23 @@ export declare class Controller {
|
|
|
76
76
|
tick(deltaTime: number): void;
|
|
77
77
|
destroy(): void;
|
|
78
78
|
onPointerMoveEvent(event: MouseEvent): void;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
onPointerUpEvent(event: MouseEvent): void;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
protected clearHoveringComponent(): void;
|
|
80
|
+
protected fireHoverEvent(component: SceneComponent, hit: Intersection | null, isBegin: boolean): void;
|
|
81
|
+
protected onPointerUpEvent(event: MouseEvent): void;
|
|
82
|
+
protected handleFirstClick(): void;
|
|
83
|
+
protected handleDoubleClick(): void;
|
|
84
|
+
protected fireClickEvent(component: SceneComponent, hit: Intersection, isDoubleClick: boolean, modifiers: {
|
|
85
|
+
ctrlKey: boolean;
|
|
86
|
+
shiftKey: boolean;
|
|
87
|
+
altKey: boolean;
|
|
88
|
+
}): void;
|
|
89
|
+
protected clearClickTimer(): void;
|
|
90
|
+
protected onPointerDownEvent(event: MouseEvent): void;
|
|
91
|
+
protected firePointerDownEvent(component: SceneComponent, hit: Intersection, button: number): void;
|
|
92
|
+
protected onPointerEnterEvent(_event: MouseEvent): void;
|
|
93
|
+
protected onPointerLeaveEvent(_event: MouseEvent): void;
|
|
94
|
+
protected addCorePointerListeners(): void;
|
|
95
|
+
protected removeCorePointerListeners(): void;
|
|
92
96
|
getHitResultUnderCursor(): Intersection | null;
|
|
93
97
|
getHitResultFromScreenPoint(x: number, y: number): Intersection | null;
|
|
94
98
|
focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
@@ -5,32 +5,33 @@ import { DOFParam } from "./Param/DOF";
|
|
|
5
5
|
import { GTAOParam } from "./Param/GTAO";
|
|
6
6
|
import { SSRParam } from "./Param/SSR";
|
|
7
7
|
import { DenoiseParam } from './Param/GTAO';
|
|
8
|
-
import
|
|
9
|
-
import DepthOfFieldNode from 'three/addons/tsl/display/DepthOfFieldNode.js';
|
|
8
|
+
import DepthOfFieldNode from 'three/examples/jsm/tsl/display/DepthOfFieldNode.js';
|
|
10
9
|
import BloomNode from 'three/examples/jsm/tsl/display/BloomNode.js';
|
|
11
10
|
import DenoiseNode from 'three/examples/jsm/tsl/display/DenoiseNode.js';
|
|
11
|
+
import FXAANode from 'three/examples/jsm/tsl/display/FXAANode.js';
|
|
12
12
|
import GTAONode from 'three/examples/jsm/tsl/display/GTAONode.js';
|
|
13
13
|
import OutlineNode from 'three/examples/jsm/tsl/display/OutlineNode.js';
|
|
14
14
|
import SSRNode from 'three/examples/jsm/tsl/display/SSRNode.js';
|
|
15
|
+
import type { TempNode } from 'three/webgpu';
|
|
15
16
|
export declare class WebGPUPostProcessFactory {
|
|
16
|
-
static constructScenePass(scene: Scene, camera: Camera):
|
|
17
|
-
static updateScenePass(scenePass:
|
|
17
|
+
static constructScenePass(scene: Scene, camera: Camera): PassNode;
|
|
18
|
+
static updateScenePass(scenePass: PassNode, outputNodes: {
|
|
18
19
|
[name: string]: Node;
|
|
19
20
|
}): void;
|
|
20
|
-
static constructBloomPass(scenePass:
|
|
21
|
-
static updateBloomPass(bloomPass:
|
|
22
|
-
static constructDOFPass(scenePass:
|
|
23
|
-
static updateDOFPass(dofPass:
|
|
24
|
-
static constructSSRPass(scenePass:
|
|
25
|
-
static updateSSRPass(ssrPass:
|
|
26
|
-
static constructGTAOPass(scenePass:
|
|
27
|
-
static updateGTAOPass(gtaoPass:
|
|
28
|
-
static constructDenoisePass(scenePass:
|
|
29
|
-
static updateDenoisePass(denoisePass:
|
|
30
|
-
static constructGTAODenoisePass(scenePass:
|
|
31
|
-
static updateGTAODenoisePass(denoisePass:
|
|
32
|
-
static constructOutlinePass(scene: Scene, camera: Camera, outlineObjects: Object3D[], param: OutlineParams):
|
|
33
|
-
static updateOutlinePass(outlinePass:
|
|
34
|
-
static constructFXAAPass(inputNode:
|
|
35
|
-
static constructSMAAPass(inputNode:
|
|
21
|
+
static constructBloomPass(scenePass: PassNode, params: BloomParam): BloomNode;
|
|
22
|
+
static updateBloomPass(bloomPass: BloomNode, params: BloomParam): void;
|
|
23
|
+
static constructDOFPass(scenePass: PassNode, params: DOFParam): DepthOfFieldNode;
|
|
24
|
+
static updateDOFPass(dofPass: DepthOfFieldNode, params: DOFParam): void;
|
|
25
|
+
static constructSSRPass(scenePass: PassNode, params: SSRParam): SSRNode;
|
|
26
|
+
static updateSSRPass(ssrPass: SSRNode, params: SSRParam): void;
|
|
27
|
+
static constructGTAOPass(scenePass: PassNode, params: GTAOParam): GTAONode;
|
|
28
|
+
static updateGTAOPass(gtaoPass: GTAONode, params: GTAOParam): void;
|
|
29
|
+
static constructDenoisePass(scenePass: PassNode, inputNode: Node, params: DenoiseParam): DenoiseNode;
|
|
30
|
+
static updateDenoisePass(denoisePass: DenoiseNode, params: DenoiseParam): void;
|
|
31
|
+
static constructGTAODenoisePass(scenePass: PassNode, gtaoPass: GTAONode, params: GTAOParam): DenoiseNode;
|
|
32
|
+
static updateGTAODenoisePass(denoisePass: DenoiseNode, params: GTAOParam): void;
|
|
33
|
+
static constructOutlinePass(scene: Scene, camera: Camera, outlineObjects: Object3D[], param: OutlineParams): OutlineNode;
|
|
34
|
+
static updateOutlinePass(outlinePass: OutlineNode, outlineObjects: Object3D[], params: OutlineParams): void;
|
|
35
|
+
static constructFXAAPass(inputNode: Node): FXAANode;
|
|
36
|
+
static constructSMAAPass(inputNode: Node): TempNode;
|
|
36
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lythreeframe",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.58",
|
|
4
4
|
"description": "Three.js 封装",
|
|
5
5
|
"main": "dist/bundle.cjs.js",
|
|
6
6
|
"module": "dist/bundle.esm.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"prepublishOnly": "npm run build"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@types/three": "^0.
|
|
14
|
+
"@types/three": "^0.181.0",
|
|
15
15
|
"gsap": "^3.12.2",
|
|
16
16
|
"three": "^0.180.0"
|
|
17
17
|
},
|