lythreeframe 1.2.23 → 1.2.24
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
|
@@ -10,7 +10,6 @@ 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');
|
|
14
13
|
var gsap = require('gsap');
|
|
15
14
|
var three = require('three');
|
|
16
15
|
var SkyMesh_js = require('three/examples/jsm/objects/SkyMesh.js');
|
|
@@ -1342,7 +1341,10 @@ class World {
|
|
|
1342
1341
|
class WebGPUPostProcessFactory {
|
|
1343
1342
|
// scene pass
|
|
1344
1343
|
static constructScenePass(scene, camera) {
|
|
1345
|
-
const scenePass = tsl.pass(scene, camera);
|
|
1344
|
+
const scenePass = tsl.pass(scene, camera, { minFilter: webgpu.NearestFilter, magFilter: webgpu.NearestFilter });
|
|
1345
|
+
// scenePass.setMRT(mrt({
|
|
1346
|
+
// output: output,
|
|
1347
|
+
// }));
|
|
1346
1348
|
scenePass.setMRT(tsl.mrt({
|
|
1347
1349
|
output: tsl.output,
|
|
1348
1350
|
}));
|
|
@@ -1352,7 +1354,8 @@ class WebGPUPostProcessFactory {
|
|
|
1352
1354
|
let oldMRT = scenePass.getMRT();
|
|
1353
1355
|
let newMRT = tsl.mrt(outputNodes);
|
|
1354
1356
|
if (oldMRT) {
|
|
1355
|
-
|
|
1357
|
+
let merge = oldMRT.merge(newMRT);
|
|
1358
|
+
scenePass.setMRT(merge);
|
|
1356
1359
|
}
|
|
1357
1360
|
else {
|
|
1358
1361
|
scenePass.setMRT(newMRT);
|
|
@@ -1393,16 +1396,18 @@ class WebGPUPostProcessFactory {
|
|
|
1393
1396
|
// ssr
|
|
1394
1397
|
static constructSSRPass(scenePass, param) {
|
|
1395
1398
|
WebGPUPostProcessFactory.updateScenePass(scenePass, {
|
|
1399
|
+
output: tsl.output,
|
|
1396
1400
|
normal: tsl.transformedNormalView,
|
|
1397
|
-
metalness: tsl.metalness
|
|
1401
|
+
metalness: tsl.metalness
|
|
1398
1402
|
});
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1404
|
-
ssrPass
|
|
1405
|
-
|
|
1403
|
+
let ssrPass = null;
|
|
1404
|
+
scenePass.getTextureNode('output');
|
|
1405
|
+
scenePass.getTextureNode('depth');
|
|
1406
|
+
scenePass.getTextureNode('normal');
|
|
1407
|
+
//const scenePassMetalness = scenePass.getTextureNode('metalness');
|
|
1408
|
+
// const ssrPass = ssr(scenePassColor, scenePassDepth, scenePassNormal, scenePassMetalness, scenePass.camera)
|
|
1409
|
+
// ssrPass.resolutionScale = 1.0;
|
|
1410
|
+
//WebGPUPostProcessFactory.updateSSRPass(ssrPass, param);
|
|
1406
1411
|
return ssrPass;
|
|
1407
1412
|
}
|
|
1408
1413
|
static updateSSRPass(ssrPass, params) {
|
|
@@ -1602,24 +1607,28 @@ class Viewport {
|
|
|
1602
1607
|
}
|
|
1603
1608
|
case exports.PostProcessStepType.ScreenSpaceReflection:
|
|
1604
1609
|
{
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1610
|
+
console.warn("[PostProcess] SSR 目前存在技术问题,暂不支持。");
|
|
1611
|
+
// const ssrPass = WebGPUPostProcessFactory.constructSSRPass(scenePass, step as SSRParam);
|
|
1612
|
+
// console.log("[PostProcess] SSRPass 构建完成");
|
|
1613
|
+
//finalNode = blendColor(finalNode, ssrPass);
|
|
1608
1614
|
break;
|
|
1609
1615
|
}
|
|
1610
1616
|
case exports.PostProcessStepType.GroundTruthAmbientOcclusion:
|
|
1611
1617
|
{
|
|
1612
|
-
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1618
|
+
console.warn("[PostProcess] AO 目前存在技术问题,暂不支持。");
|
|
1619
|
+
// const stepParam = step as GTAOParam
|
|
1620
|
+
// const GTAOPass = WebGPUPostProcessFactory.constructGTAOPass(scenePass, stepParam);
|
|
1621
|
+
// console.log("[PostProcess] GTAOPass 构建完成");
|
|
1622
|
+
// if (stepParam.denoised)
|
|
1623
|
+
// {
|
|
1624
|
+
// const denoiseGTAOPass = WebGPUPostProcessFactory.constructGTAODenoisePass(scenePass, GTAOPass, stepParam);
|
|
1625
|
+
// console.log("[PostProcess] GTAODenoisePass 构建完成");
|
|
1626
|
+
// finalNode = denoiseGTAOPass.mul(finalNode);
|
|
1627
|
+
// }
|
|
1628
|
+
// else
|
|
1629
|
+
// {
|
|
1630
|
+
// finalNode = GTAOPass.getTextureNode().mul(finalNode);
|
|
1631
|
+
// }
|
|
1623
1632
|
break;
|
|
1624
1633
|
}
|
|
1625
1634
|
case exports.PostProcessStepType.Outline:
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MathUtils, Object3D, Vector3, Box3, Quaternion, Euler, Matrix4, Mesh, LoadingManager, BufferGeometry, Texture, FileLoader, Material, WebGPURenderer, PostProcessing, Color, Vector2, Raycaster, PerspectiveCamera, OrthographicCamera, Clock, DirectionalLight, MeshStandardMaterial, BoxGeometry, MeshBasicMaterial, PlaneGeometry, SphereGeometry } from 'three/webgpu';
|
|
1
|
+
import { MathUtils, Object3D, Vector3, Box3, Quaternion, Euler, Matrix4, Mesh, LoadingManager, BufferGeometry, Texture, FileLoader, Material, NearestFilter, WebGPURenderer, PostProcessing, Color, Vector2, Raycaster, PerspectiveCamera, OrthographicCamera, Clock, DirectionalLight, MeshStandardMaterial, BoxGeometry, MeshBasicMaterial, PlaneGeometry, SphereGeometry } from 'three/webgpu';
|
|
2
2
|
import { GLTFLoader, DRACOLoader, CSS2DRenderer, OrbitControls } from 'three/examples/jsm/Addons.js';
|
|
3
|
-
import { pass, mrt, output, uniform, metalness, transformedNormalView, time, oscSine
|
|
3
|
+
import { pass, mrt, output, uniform, metalness, transformedNormalView, time, oscSine } from 'three/tsl';
|
|
4
4
|
import { dof } from 'three/addons/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';
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import { gsap } from 'gsap';
|
|
13
12
|
import { Scene } from 'three';
|
|
14
13
|
import { SkyMesh } from 'three/examples/jsm/objects/SkyMesh.js';
|
|
@@ -1340,7 +1339,10 @@ class World {
|
|
|
1340
1339
|
class WebGPUPostProcessFactory {
|
|
1341
1340
|
// scene pass
|
|
1342
1341
|
static constructScenePass(scene, camera) {
|
|
1343
|
-
const scenePass = pass(scene, camera);
|
|
1342
|
+
const scenePass = pass(scene, camera, { minFilter: NearestFilter, magFilter: NearestFilter });
|
|
1343
|
+
// scenePass.setMRT(mrt({
|
|
1344
|
+
// output: output,
|
|
1345
|
+
// }));
|
|
1344
1346
|
scenePass.setMRT(mrt({
|
|
1345
1347
|
output: output,
|
|
1346
1348
|
}));
|
|
@@ -1350,7 +1352,8 @@ class WebGPUPostProcessFactory {
|
|
|
1350
1352
|
let oldMRT = scenePass.getMRT();
|
|
1351
1353
|
let newMRT = mrt(outputNodes);
|
|
1352
1354
|
if (oldMRT) {
|
|
1353
|
-
|
|
1355
|
+
let merge = oldMRT.merge(newMRT);
|
|
1356
|
+
scenePass.setMRT(merge);
|
|
1354
1357
|
}
|
|
1355
1358
|
else {
|
|
1356
1359
|
scenePass.setMRT(newMRT);
|
|
@@ -1391,16 +1394,18 @@ class WebGPUPostProcessFactory {
|
|
|
1391
1394
|
// ssr
|
|
1392
1395
|
static constructSSRPass(scenePass, param) {
|
|
1393
1396
|
WebGPUPostProcessFactory.updateScenePass(scenePass, {
|
|
1397
|
+
output: output,
|
|
1394
1398
|
normal: transformedNormalView,
|
|
1395
|
-
metalness: metalness
|
|
1399
|
+
metalness: metalness
|
|
1396
1400
|
});
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
const
|
|
1402
|
-
ssrPass
|
|
1403
|
-
|
|
1401
|
+
let ssrPass = null;
|
|
1402
|
+
scenePass.getTextureNode('output');
|
|
1403
|
+
scenePass.getTextureNode('depth');
|
|
1404
|
+
scenePass.getTextureNode('normal');
|
|
1405
|
+
//const scenePassMetalness = scenePass.getTextureNode('metalness');
|
|
1406
|
+
// const ssrPass = ssr(scenePassColor, scenePassDepth, scenePassNormal, scenePassMetalness, scenePass.camera)
|
|
1407
|
+
// ssrPass.resolutionScale = 1.0;
|
|
1408
|
+
//WebGPUPostProcessFactory.updateSSRPass(ssrPass, param);
|
|
1404
1409
|
return ssrPass;
|
|
1405
1410
|
}
|
|
1406
1411
|
static updateSSRPass(ssrPass, params) {
|
|
@@ -1600,24 +1605,28 @@ class Viewport {
|
|
|
1600
1605
|
}
|
|
1601
1606
|
case PostProcessStepType.ScreenSpaceReflection:
|
|
1602
1607
|
{
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1608
|
+
console.warn("[PostProcess] SSR 目前存在技术问题,暂不支持。");
|
|
1609
|
+
// const ssrPass = WebGPUPostProcessFactory.constructSSRPass(scenePass, step as SSRParam);
|
|
1610
|
+
// console.log("[PostProcess] SSRPass 构建完成");
|
|
1611
|
+
//finalNode = blendColor(finalNode, ssrPass);
|
|
1606
1612
|
break;
|
|
1607
1613
|
}
|
|
1608
1614
|
case PostProcessStepType.GroundTruthAmbientOcclusion:
|
|
1609
1615
|
{
|
|
1610
|
-
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1616
|
+
console.warn("[PostProcess] AO 目前存在技术问题,暂不支持。");
|
|
1617
|
+
// const stepParam = step as GTAOParam
|
|
1618
|
+
// const GTAOPass = WebGPUPostProcessFactory.constructGTAOPass(scenePass, stepParam);
|
|
1619
|
+
// console.log("[PostProcess] GTAOPass 构建完成");
|
|
1620
|
+
// if (stepParam.denoised)
|
|
1621
|
+
// {
|
|
1622
|
+
// const denoiseGTAOPass = WebGPUPostProcessFactory.constructGTAODenoisePass(scenePass, GTAOPass, stepParam);
|
|
1623
|
+
// console.log("[PostProcess] GTAODenoisePass 构建完成");
|
|
1624
|
+
// finalNode = denoiseGTAOPass.mul(finalNode);
|
|
1625
|
+
// }
|
|
1626
|
+
// else
|
|
1627
|
+
// {
|
|
1628
|
+
// finalNode = GTAOPass.getTextureNode().mul(finalNode);
|
|
1629
|
+
// }
|
|
1621
1630
|
break;
|
|
1622
1631
|
}
|
|
1623
1632
|
case PostProcessStepType.Outline:
|
|
@@ -21,7 +21,7 @@ export declare class WebGPUPostProcessFactory {
|
|
|
21
21
|
static updateBloomPass(bloomPass: ShaderNodeObject<BloomNode>, params: BloomParam): void;
|
|
22
22
|
static constructDOFPass(scenePass: ShaderNodeObject<PassNode>, params: DOFParam): ShaderNodeObject<DepthOfFieldNode>;
|
|
23
23
|
static updateDOFPass(dofPass: ShaderNodeObject<DepthOfFieldNode>, params: DOFParam): void;
|
|
24
|
-
static constructSSRPass(scenePass: ShaderNodeObject<PassNode>, param: SSRParam): ShaderNodeObject<SSRNode
|
|
24
|
+
static constructSSRPass(scenePass: ShaderNodeObject<PassNode>, param: SSRParam): ShaderNodeObject<SSRNode> | null;
|
|
25
25
|
static updateSSRPass(ssrPass: ShaderNodeObject<SSRNode>, params: SSRParam): void;
|
|
26
26
|
static constructGTAOPass(scenePass: ShaderNodeObject<PassNode>, params: GTAOParam): ShaderNodeObject<GTAONode>;
|
|
27
27
|
static updateGTAOPass(gtaoPass: ShaderNodeObject<GTAONode>, params: GTAOParam): void;
|