super-three 0.177.0 → 0.179.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/README.md +1 -1
- package/build/three.cjs +959 -231
- package/build/three.core.js +751 -170
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +210 -64
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +78 -29
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +3269 -1545
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +3093 -1545
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -2
- package/examples/jsm/capabilities/WebGL.js +0 -27
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +1 -1
- package/examples/jsm/controls/TransformControls.js +61 -14
- package/examples/jsm/csm/CSMShadowNode.js +4 -4
- package/examples/jsm/environments/RoomEnvironment.js +8 -3
- package/examples/jsm/exporters/USDZExporter.js +676 -299
- package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
- package/examples/jsm/interactive/HTMLMesh.js +5 -3
- package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/examples/jsm/lights/LightProbeGenerator.js +14 -3
- package/examples/jsm/loaders/ColladaLoader.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +210 -22
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/MaterialXLoader.js +212 -30
- package/examples/jsm/loaders/TTFLoader.js +13 -1
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -892
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/objects/LensflareMesh.js +3 -3
- package/examples/jsm/objects/SkyMesh.js +2 -2
- package/examples/jsm/physics/RapierPhysics.js +95 -16
- package/examples/jsm/postprocessing/GTAOPass.js +10 -9
- package/examples/jsm/postprocessing/OutlinePass.js +17 -17
- package/examples/jsm/postprocessing/SSAOPass.js +10 -9
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
- package/examples/jsm/transpiler/AST.js +381 -30
- package/examples/jsm/transpiler/GLSLDecoder.js +226 -86
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/TSLEncoder.js +197 -92
- package/examples/jsm/transpiler/Transpiler.js +17 -1
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +788 -0
- package/examples/jsm/tsl/display/BloomNode.js +8 -7
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +206 -0
- package/examples/jsm/tsl/display/GaussianBlurNode.js +8 -10
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/{TRAAPassNode.js → TRAANode.js} +181 -172
- package/examples/jsm/tsl/display/hashBlur.js +3 -3
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +1 -1
- package/package.json +1 -1
- package/src/Three.Core.js +1 -0
- package/src/Three.TSL.js +77 -28
- package/src/Three.WebGPU.js +2 -0
- package/src/animation/KeyframeTrack.js +1 -1
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/cameras/Camera.js +14 -0
- package/src/cameras/OrthographicCamera.js +1 -1
- package/src/cameras/PerspectiveCamera.js +1 -1
- package/src/constants.js +3 -3
- package/src/core/BufferAttribute.js +3 -3
- package/src/core/Clock.js +2 -8
- package/src/core/GLBufferAttribute.js +13 -1
- package/src/core/Object3D.js +1 -1
- package/{examples/jsm/misc → src/core}/Timer.js +4 -42
- package/src/extras/PMREMGenerator.js +11 -0
- package/src/extras/core/Path.js +22 -22
- package/src/helpers/CameraHelper.js +41 -11
- package/src/helpers/SkeletonHelper.js +35 -6
- package/src/lights/LightShadow.js +21 -8
- package/src/lights/PointLightShadow.js +1 -1
- package/src/loaders/FileLoader.js +27 -4
- package/src/loaders/ImageBitmapLoader.js +27 -4
- package/src/loaders/ImageLoader.js +55 -8
- package/src/loaders/Loader.js +14 -0
- package/src/loaders/LoadingManager.js +23 -0
- package/src/materials/MeshBasicMaterial.js +1 -1
- package/src/materials/nodes/Line2NodeMaterial.js +0 -8
- package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
- package/src/materials/nodes/MeshSSSNodeMaterial.js +2 -2
- package/src/materials/nodes/NodeMaterial.js +28 -5
- package/src/materials/nodes/PointsNodeMaterial.js +5 -0
- package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -2
- package/src/math/Frustum.js +25 -9
- package/src/math/FrustumArray.js +10 -5
- package/src/math/Line3.js +129 -2
- package/src/math/Matrix4.js +48 -27
- package/src/math/Quaternion.js +1 -1
- package/src/math/Spherical.js +2 -2
- package/src/nodes/Nodes.js +2 -3
- package/src/nodes/TSL.js +5 -3
- package/src/nodes/accessors/AccessorsUtils.js +7 -8
- package/src/nodes/accessors/Bitangent.js +31 -25
- package/src/nodes/accessors/Camera.js +12 -12
- package/src/nodes/accessors/Normal.js +95 -29
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/Position.js +7 -7
- package/src/nodes/accessors/ReferenceNode.js +18 -3
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneNode.js +1 -1
- package/src/nodes/accessors/StorageTextureNode.js +1 -1
- package/src/nodes/accessors/Tangent.js +25 -17
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/TextureBicubic.js +21 -3
- package/src/nodes/accessors/TextureNode.js +12 -0
- package/src/nodes/accessors/UniformArrayNode.js +0 -16
- package/src/nodes/core/ArrayNode.js +12 -0
- package/src/nodes/core/AssignNode.js +3 -0
- package/src/nodes/core/CacheNode.js +0 -14
- package/src/nodes/core/ContextNode.js +20 -1
- package/src/nodes/core/Node.js +15 -3
- package/src/nodes/core/NodeBuilder.js +228 -92
- package/src/nodes/core/NodeUtils.js +4 -1
- package/src/nodes/core/StackNode.js +49 -29
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/UniformNode.js +63 -5
- package/src/nodes/core/VarNode.js +91 -2
- package/src/nodes/core/VaryingNode.js +6 -4
- package/src/nodes/display/BlendModes.js +2 -2
- package/src/nodes/display/FrontFacingNode.js +34 -2
- package/src/nodes/display/NormalMapNode.js +19 -50
- package/src/nodes/display/PassNode.js +157 -9
- package/src/nodes/display/ScreenNode.js +0 -26
- package/src/nodes/display/ViewportTextureNode.js +67 -7
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/PhongLightingModel.js +3 -3
- package/src/nodes/functions/PhysicalLightingModel.js +16 -16
- package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +67 -23
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +28 -3
- package/src/nodes/lighting/EnvironmentNode.js +5 -5
- package/src/nodes/lighting/LightsNode.js +4 -4
- package/src/nodes/lighting/ProjectorLightNode.js +19 -6
- package/src/nodes/lighting/ShadowFilterNode.js +1 -1
- package/src/nodes/lighting/ShadowNode.js +2 -2
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +165 -1
- package/src/nodes/math/ConditionalNode.js +1 -20
- package/src/nodes/math/MathNode.js +90 -55
- package/src/nodes/math/OperatorNode.js +22 -39
- package/src/nodes/tsl/TSLBase.js +1 -0
- package/src/nodes/tsl/TSLCore.js +114 -55
- package/src/nodes/utils/DebugNode.js +1 -1
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +83 -0
- package/src/nodes/utils/LoopNode.js +0 -17
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/RTTNode.js +22 -5
- package/src/nodes/utils/ReflectorNode.js +11 -4
- package/src/nodes/utils/SampleNode.js +81 -0
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/objects/BatchedMesh.js +4 -2
- package/src/renderers/WebGLRenderer.js +26 -24
- package/src/renderers/common/Background.js +2 -2
- package/src/renderers/common/Bindings.js +19 -18
- package/src/renderers/common/Color4.js +2 -2
- package/src/renderers/common/CubeRenderTarget.js +1 -1
- package/src/renderers/common/PostProcessing.js +60 -5
- package/src/renderers/common/RenderObject.js +68 -3
- package/src/renderers/common/Renderer.js +19 -16
- package/src/renderers/common/SampledTexture.js +3 -71
- package/src/renderers/common/Sampler.js +79 -0
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageTexture.js +19 -0
- package/src/renderers/common/Textures.js +19 -3
- package/src/renderers/common/XRManager.js +31 -12
- package/src/renderers/common/XRRenderTarget.js +21 -4
- package/src/renderers/common/extras/PMREMGenerator.js +1 -1
- package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +20 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
- package/src/renderers/webgl/WebGLAttributes.js +4 -0
- package/src/renderers/webgl/WebGLCapabilities.js +2 -2
- package/src/renderers/webgl/WebGLProgram.js +12 -6
- package/src/renderers/webgl/WebGLPrograms.js +6 -4
- package/src/renderers/webgl/WebGLShadowMap.js +11 -1
- package/src/renderers/webgl/WebGLState.js +4 -4
- package/src/renderers/webgl/WebGLTextures.js +19 -7
- package/src/renderers/webgl-fallback/WebGLBackend.js +103 -72
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +3 -5
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +4 -4
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +2 -0
- package/src/renderers/webgpu/WebGPUBackend.js +63 -16
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +64 -79
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -0
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -31
- package/src/renderers/webgpu/utils/WebGPUConstants.js +7 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +5 -5
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +12 -65
- package/src/renderers/webgpu/utils/WebGPUUtils.js +2 -17
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
- package/src/renderers/webxr/WebXRManager.js +68 -6
- package/src/textures/ExternalTexture.js +45 -0
- package/src/textures/FramebufferTexture.js +2 -2
- package/src/textures/Source.js +11 -1
- package/src/textures/VideoTexture.js +30 -2
- package/src/nodes/utils/EquirectUVNode.js +0 -65
- package/src/nodes/utils/MatcapUVNode.js +0 -49
- package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
package/src/Three.TSL.js
CHANGED
|
@@ -2,8 +2,10 @@ import { TSL } from 'three/webgpu';
|
|
|
2
2
|
|
|
3
3
|
export const BRDF_GGX = TSL.BRDF_GGX;
|
|
4
4
|
export const BRDF_Lambert = TSL.BRDF_Lambert;
|
|
5
|
+
export const BasicPointShadowFilter = TSL.BasicPointShadowFilter;
|
|
5
6
|
export const BasicShadowFilter = TSL.BasicShadowFilter;
|
|
6
7
|
export const Break = TSL.Break;
|
|
8
|
+
export const Const = TSL.Const;
|
|
7
9
|
export const Continue = TSL.Continue;
|
|
8
10
|
export const DFGApprox = TSL.DFGApprox;
|
|
9
11
|
export const D_GGX = TSL.D_GGX;
|
|
@@ -13,27 +15,32 @@ export const F_Schlick = TSL.F_Schlick;
|
|
|
13
15
|
export const Fn = TSL.Fn;
|
|
14
16
|
export const INFINITY = TSL.INFINITY;
|
|
15
17
|
export const If = TSL.If;
|
|
16
|
-
export const Switch = TSL.Switch;
|
|
17
18
|
export const Loop = TSL.Loop;
|
|
19
|
+
export const NodeAccess = TSL.NodeAccess;
|
|
18
20
|
export const NodeShaderStage = TSL.NodeShaderStage;
|
|
19
21
|
export const NodeType = TSL.NodeType;
|
|
20
22
|
export const NodeUpdateType = TSL.NodeUpdateType;
|
|
21
|
-
export const NodeAccess = TSL.NodeAccess;
|
|
22
23
|
export const PCFShadowFilter = TSL.PCFShadowFilter;
|
|
23
24
|
export const PCFSoftShadowFilter = TSL.PCFSoftShadowFilter;
|
|
24
25
|
export const PI = TSL.PI;
|
|
25
26
|
export const PI2 = TSL.PI2;
|
|
27
|
+
export const PointShadowFilter = TSL.PointShadowFilter;
|
|
26
28
|
export const Return = TSL.Return;
|
|
27
29
|
export const Schlick_to_F0 = TSL.Schlick_to_F0;
|
|
28
30
|
export const ScriptableNodeResources = TSL.ScriptableNodeResources;
|
|
29
31
|
export const ShaderNode = TSL.ShaderNode;
|
|
32
|
+
export const Stack = TSL.Stack;
|
|
33
|
+
export const Switch = TSL.Switch;
|
|
30
34
|
export const TBNViewMatrix = TSL.TBNViewMatrix;
|
|
31
35
|
export const VSMShadowFilter = TSL.VSMShadowFilter;
|
|
32
36
|
export const V_GGX_SmithCorrelated = TSL.V_GGX_SmithCorrelated;
|
|
37
|
+
export const Var = TSL.Var;
|
|
38
|
+
export const VarIntent = TSL.VarIntent;
|
|
33
39
|
export const abs = TSL.abs;
|
|
34
40
|
export const acesFilmicToneMapping = TSL.acesFilmicToneMapping;
|
|
35
41
|
export const acos = TSL.acos;
|
|
36
42
|
export const add = TSL.add;
|
|
43
|
+
export const addMethodChaining = TSL.addMethodChaining;
|
|
37
44
|
export const addNodeElement = TSL.addNodeElement;
|
|
38
45
|
export const agxToneMapping = TSL.agxToneMapping;
|
|
39
46
|
export const all = TSL.all;
|
|
@@ -53,13 +60,13 @@ export const atan2 = TSL.atan2;
|
|
|
53
60
|
export const atomicAdd = TSL.atomicAdd;
|
|
54
61
|
export const atomicAnd = TSL.atomicAnd;
|
|
55
62
|
export const atomicFunc = TSL.atomicFunc;
|
|
63
|
+
export const atomicLoad = TSL.atomicLoad;
|
|
56
64
|
export const atomicMax = TSL.atomicMax;
|
|
57
65
|
export const atomicMin = TSL.atomicMin;
|
|
58
66
|
export const atomicOr = TSL.atomicOr;
|
|
59
67
|
export const atomicStore = TSL.atomicStore;
|
|
60
68
|
export const atomicSub = TSL.atomicSub;
|
|
61
69
|
export const atomicXor = TSL.atomicXor;
|
|
62
|
-
export const atomicLoad = TSL.atomicLoad;
|
|
63
70
|
export const attenuationColor = TSL.attenuationColor;
|
|
64
71
|
export const attenuationDistance = TSL.attenuationDistance;
|
|
65
72
|
export const attribute = TSL.attribute;
|
|
@@ -68,6 +75,7 @@ export const backgroundBlurriness = TSL.backgroundBlurriness;
|
|
|
68
75
|
export const backgroundIntensity = TSL.backgroundIntensity;
|
|
69
76
|
export const backgroundRotation = TSL.backgroundRotation;
|
|
70
77
|
export const batch = TSL.batch;
|
|
78
|
+
export const bentNormalView = TSL.bentNormalView;
|
|
71
79
|
export const billboarding = TSL.billboarding;
|
|
72
80
|
export const bitAnd = TSL.bitAnd;
|
|
73
81
|
export const bitNot = TSL.bitNot;
|
|
@@ -111,15 +119,15 @@ export const checker = TSL.checker;
|
|
|
111
119
|
export const cineonToneMapping = TSL.cineonToneMapping;
|
|
112
120
|
export const clamp = TSL.clamp;
|
|
113
121
|
export const clearcoat = TSL.clearcoat;
|
|
122
|
+
export const clearcoatNormalView = TSL.clearcoatNormalView;
|
|
114
123
|
export const clearcoatRoughness = TSL.clearcoatRoughness;
|
|
115
124
|
export const code = TSL.code;
|
|
116
125
|
export const color = TSL.color;
|
|
117
126
|
export const colorSpaceToWorking = TSL.colorSpaceToWorking;
|
|
118
127
|
export const colorToDirection = TSL.colorToDirection;
|
|
119
128
|
export const compute = TSL.compute;
|
|
129
|
+
export const computeKernel = TSL.computeKernel;
|
|
120
130
|
export const computeSkinning = TSL.computeSkinning;
|
|
121
|
-
export const cond = TSL.cond;
|
|
122
|
-
export const Const = TSL.Const;
|
|
123
131
|
export const context = TSL.context;
|
|
124
132
|
export const convert = TSL.convert;
|
|
125
133
|
export const convertColorSpace = TSL.convertColorSpace;
|
|
@@ -127,6 +135,8 @@ export const convertToTexture = TSL.convertToTexture;
|
|
|
127
135
|
export const cos = TSL.cos;
|
|
128
136
|
export const cross = TSL.cross;
|
|
129
137
|
export const cubeTexture = TSL.cubeTexture;
|
|
138
|
+
export const cubeTextureBase = TSL.cubeTextureBase;
|
|
139
|
+
export const cubeToUV = TSL.cubeToUV;
|
|
130
140
|
export const dFdx = TSL.dFdx;
|
|
131
141
|
export const dFdy = TSL.dFdy;
|
|
132
142
|
export const dashSize = TSL.dashSize;
|
|
@@ -142,10 +152,12 @@ export const densityFog = TSL.densityFog;
|
|
|
142
152
|
export const densityFogFactor = TSL.densityFogFactor;
|
|
143
153
|
export const depth = TSL.depth;
|
|
144
154
|
export const depthPass = TSL.depthPass;
|
|
155
|
+
export const determinant = TSL.determinant;
|
|
145
156
|
export const difference = TSL.difference;
|
|
146
157
|
export const diffuseColor = TSL.diffuseColor;
|
|
147
158
|
export const directPointLight = TSL.directPointLight;
|
|
148
159
|
export const directionToColor = TSL.directionToColor;
|
|
160
|
+
export const directionToFaceDirection = TSL.directionToFaceDirection;
|
|
149
161
|
export const dispersion = TSL.dispersion;
|
|
150
162
|
export const distance = TSL.distance;
|
|
151
163
|
export const div = TSL.div;
|
|
@@ -184,10 +196,11 @@ export const getParallaxCorrectNormal = TSL.getParallaxCorrectNormal;
|
|
|
184
196
|
export const getRoughness = TSL.getRoughness;
|
|
185
197
|
export const getScreenPosition = TSL.getScreenPosition;
|
|
186
198
|
export const getShIrradianceAt = TSL.getShIrradianceAt;
|
|
187
|
-
export const getTextureIndex = TSL.getTextureIndex;
|
|
188
|
-
export const getViewPosition = TSL.getViewPosition;
|
|
189
199
|
export const getShadowMaterial = TSL.getShadowMaterial;
|
|
190
200
|
export const getShadowRenderObjectFunction = TSL.getShadowRenderObjectFunction;
|
|
201
|
+
export const getTextureIndex = TSL.getTextureIndex;
|
|
202
|
+
export const getViewPosition = TSL.getViewPosition;
|
|
203
|
+
export const globalId = TSL.globalId;
|
|
191
204
|
export const glsl = TSL.glsl;
|
|
192
205
|
export const glslFn = TSL.glslFn;
|
|
193
206
|
export const grayscale = TSL.grayscale;
|
|
@@ -206,6 +219,7 @@ export const instancedBufferAttribute = TSL.instancedBufferAttribute;
|
|
|
206
219
|
export const instancedDynamicBufferAttribute = TSL.instancedDynamicBufferAttribute;
|
|
207
220
|
export const instancedMesh = TSL.instancedMesh;
|
|
208
221
|
export const int = TSL.int;
|
|
222
|
+
export const inverse = TSL.inverse;
|
|
209
223
|
export const inverseSqrt = TSL.inverseSqrt;
|
|
210
224
|
export const inversesqrt = TSL.inversesqrt;
|
|
211
225
|
export const invocationLocalIndex = TSL.invocationLocalIndex;
|
|
@@ -224,6 +238,7 @@ export const lengthSq = TSL.lengthSq;
|
|
|
224
238
|
export const lessThan = TSL.lessThan;
|
|
225
239
|
export const lessThanEqual = TSL.lessThanEqual;
|
|
226
240
|
export const lightPosition = TSL.lightPosition;
|
|
241
|
+
export const lightProjectionUV = TSL.lightProjectionUV;
|
|
227
242
|
export const lightShadowMatrix = TSL.lightShadowMatrix;
|
|
228
243
|
export const lightTargetDirection = TSL.lightTargetDirection;
|
|
229
244
|
export const lightTargetPosition = TSL.lightTargetPosition;
|
|
@@ -233,13 +248,10 @@ export const lights = TSL.lights;
|
|
|
233
248
|
export const linearDepth = TSL.linearDepth;
|
|
234
249
|
export const linearToneMapping = TSL.linearToneMapping;
|
|
235
250
|
export const localId = TSL.localId;
|
|
236
|
-
export const globalId = TSL.globalId;
|
|
237
251
|
export const log = TSL.log;
|
|
238
252
|
export const log2 = TSL.log2;
|
|
239
253
|
export const logarithmicDepthToViewZ = TSL.logarithmicDepthToViewZ;
|
|
240
|
-
export const loop = TSL.loop;
|
|
241
254
|
export const luminance = TSL.luminance;
|
|
242
|
-
export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
|
|
243
255
|
export const mat2 = TSL.mat2;
|
|
244
256
|
export const mat3 = TSL.mat3;
|
|
245
257
|
export const mat4 = TSL.mat4;
|
|
@@ -256,6 +268,8 @@ export const materialClearcoatRoughness = TSL.materialClearcoatRoughness;
|
|
|
256
268
|
export const materialColor = TSL.materialColor;
|
|
257
269
|
export const materialDispersion = TSL.materialDispersion;
|
|
258
270
|
export const materialEmissive = TSL.materialEmissive;
|
|
271
|
+
export const materialEnvIntensity = TSL.materialEnvIntensity;
|
|
272
|
+
export const materialEnvRotation = TSL.materialEnvRotation;
|
|
259
273
|
export const materialIOR = TSL.materialIOR;
|
|
260
274
|
export const materialIridescence = TSL.materialIridescence;
|
|
261
275
|
export const materialIridescenceIOR = TSL.materialIridescenceIOR;
|
|
@@ -286,6 +300,7 @@ export const materialThickness = TSL.materialThickness;
|
|
|
286
300
|
export const materialTransmission = TSL.materialTransmission;
|
|
287
301
|
export const max = TSL.max;
|
|
288
302
|
export const maxMipLevel = TSL.maxMipLevel;
|
|
303
|
+
export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
|
|
289
304
|
export const metalness = TSL.metalness;
|
|
290
305
|
export const min = TSL.min;
|
|
291
306
|
export const mix = TSL.mix;
|
|
@@ -306,41 +321,65 @@ export const morphReference = TSL.morphReference;
|
|
|
306
321
|
export const mrt = TSL.mrt;
|
|
307
322
|
export const mul = TSL.mul;
|
|
308
323
|
export const mx_aastep = TSL.mx_aastep;
|
|
324
|
+
export const mx_add = TSL.mx_add;
|
|
325
|
+
export const mx_atan2 = TSL.mx_atan2;
|
|
309
326
|
export const mx_cell_noise_float = TSL.mx_cell_noise_float;
|
|
310
327
|
export const mx_contrast = TSL.mx_contrast;
|
|
328
|
+
export const mx_divide = TSL.mx_divide;
|
|
311
329
|
export const mx_fractal_noise_float = TSL.mx_fractal_noise_float;
|
|
312
330
|
export const mx_fractal_noise_vec2 = TSL.mx_fractal_noise_vec2;
|
|
313
331
|
export const mx_fractal_noise_vec3 = TSL.mx_fractal_noise_vec3;
|
|
314
332
|
export const mx_fractal_noise_vec4 = TSL.mx_fractal_noise_vec4;
|
|
333
|
+
export const mx_frame = TSL.mx_frame;
|
|
334
|
+
export const mx_heighttonormal = TSL.mx_heighttonormal;
|
|
315
335
|
export const mx_hsvtorgb = TSL.mx_hsvtorgb;
|
|
336
|
+
export const mx_ifequal = TSL.mx_ifequal;
|
|
337
|
+
export const mx_ifgreater = TSL.mx_ifgreater;
|
|
338
|
+
export const mx_ifgreatereq = TSL.mx_ifgreatereq;
|
|
339
|
+
export const mx_invert = TSL.mx_invert;
|
|
340
|
+
export const mx_modulo = TSL.mx_modulo;
|
|
341
|
+
export const mx_multiply = TSL.mx_multiply;
|
|
316
342
|
export const mx_noise_float = TSL.mx_noise_float;
|
|
317
343
|
export const mx_noise_vec3 = TSL.mx_noise_vec3;
|
|
318
344
|
export const mx_noise_vec4 = TSL.mx_noise_vec4;
|
|
345
|
+
export const mx_place2d = TSL.mx_place2d;
|
|
346
|
+
export const mx_power = TSL.mx_power;
|
|
347
|
+
export const mx_ramp4 = TSL.mx_ramp4;
|
|
319
348
|
export const mx_ramplr = TSL.mx_ramplr;
|
|
320
349
|
export const mx_ramptb = TSL.mx_ramptb;
|
|
321
350
|
export const mx_rgbtohsv = TSL.mx_rgbtohsv;
|
|
351
|
+
export const mx_rotate2d = TSL.mx_rotate2d;
|
|
352
|
+
export const mx_rotate3d = TSL.mx_rotate3d;
|
|
322
353
|
export const mx_safepower = TSL.mx_safepower;
|
|
354
|
+
export const mx_separate = TSL.mx_separate;
|
|
323
355
|
export const mx_splitlr = TSL.mx_splitlr;
|
|
324
356
|
export const mx_splittb = TSL.mx_splittb;
|
|
325
357
|
export const mx_srgb_texture_to_lin_rec709 = TSL.mx_srgb_texture_to_lin_rec709;
|
|
358
|
+
export const mx_subtract = TSL.mx_subtract;
|
|
359
|
+
export const mx_timer = TSL.mx_timer;
|
|
326
360
|
export const mx_transform_uv = TSL.mx_transform_uv;
|
|
361
|
+
export const mx_unifiednoise2d = TSL.mx_unifiednoise2d;
|
|
362
|
+
export const mx_unifiednoise3d = TSL.mx_unifiednoise3d;
|
|
327
363
|
export const mx_worley_noise_float = TSL.mx_worley_noise_float;
|
|
328
364
|
export const mx_worley_noise_vec2 = TSL.mx_worley_noise_vec2;
|
|
329
365
|
export const mx_worley_noise_vec3 = TSL.mx_worley_noise_vec3;
|
|
330
|
-
export const namespace = TSL.namespace;
|
|
331
366
|
export const negate = TSL.negate;
|
|
332
367
|
export const neutralToneMapping = TSL.neutralToneMapping;
|
|
333
368
|
export const nodeArray = TSL.nodeArray;
|
|
334
369
|
export const nodeImmutable = TSL.nodeImmutable;
|
|
335
370
|
export const nodeObject = TSL.nodeObject;
|
|
371
|
+
export const nodeObjectIntent = TSL.nodeObjectIntent;
|
|
336
372
|
export const nodeObjects = TSL.nodeObjects;
|
|
337
373
|
export const nodeProxy = TSL.nodeProxy;
|
|
374
|
+
export const nodeProxyIntent = TSL.nodeProxyIntent;
|
|
338
375
|
export const normalFlat = TSL.normalFlat;
|
|
339
376
|
export const normalGeometry = TSL.normalGeometry;
|
|
340
377
|
export const normalLocal = TSL.normalLocal;
|
|
341
378
|
export const normalMap = TSL.normalMap;
|
|
342
379
|
export const normalView = TSL.normalView;
|
|
380
|
+
export const normalViewGeometry = TSL.normalViewGeometry;
|
|
343
381
|
export const normalWorld = TSL.normalWorld;
|
|
382
|
+
export const normalWorldGeometry = TSL.normalWorldGeometry;
|
|
344
383
|
export const normalize = TSL.normalize;
|
|
345
384
|
export const not = TSL.not;
|
|
346
385
|
export const notEqual = TSL.notEqual;
|
|
@@ -352,6 +391,8 @@ export const objectRadius = TSL.objectRadius;
|
|
|
352
391
|
export const objectScale = TSL.objectScale;
|
|
353
392
|
export const objectViewPosition = TSL.objectViewPosition;
|
|
354
393
|
export const objectWorldMatrix = TSL.objectWorldMatrix;
|
|
394
|
+
export const OnObjectUpdate = TSL.OnObjectUpdate;
|
|
395
|
+
export const OnMaterialUpdate = TSL.OnMaterialUpdate;
|
|
355
396
|
export const oneMinus = TSL.oneMinus;
|
|
356
397
|
export const or = TSL.or;
|
|
357
398
|
export const orthographicDepthToViewZ = TSL.orthographicDepthToViewZ;
|
|
@@ -372,6 +413,7 @@ export const passTexture = TSL.passTexture;
|
|
|
372
413
|
export const pcurve = TSL.pcurve;
|
|
373
414
|
export const perspectiveDepthToViewZ = TSL.perspectiveDepthToViewZ;
|
|
374
415
|
export const pmremTexture = TSL.pmremTexture;
|
|
416
|
+
export const pointShadow = TSL.pointShadow;
|
|
375
417
|
export const pointUV = TSL.pointUV;
|
|
376
418
|
export const pointWidth = TSL.pointWidth;
|
|
377
419
|
export const positionGeometry = TSL.positionGeometry;
|
|
@@ -386,7 +428,7 @@ export const pow = TSL.pow;
|
|
|
386
428
|
export const pow2 = TSL.pow2;
|
|
387
429
|
export const pow3 = TSL.pow3;
|
|
388
430
|
export const pow4 = TSL.pow4;
|
|
389
|
-
export const
|
|
431
|
+
export const premultiplyAlpha = TSL.premultiplyAlpha;
|
|
390
432
|
export const property = TSL.property;
|
|
391
433
|
export const radians = TSL.radians;
|
|
392
434
|
export const rand = TSL.rand;
|
|
@@ -394,7 +436,6 @@ export const range = TSL.range;
|
|
|
394
436
|
export const rangeFog = TSL.rangeFog;
|
|
395
437
|
export const rangeFogFactor = TSL.rangeFogFactor;
|
|
396
438
|
export const reciprocal = TSL.reciprocal;
|
|
397
|
-
export const lightProjectionUV = TSL.lightProjectionUV;
|
|
398
439
|
export const reference = TSL.reference;
|
|
399
440
|
export const referenceBuffer = TSL.referenceBuffer;
|
|
400
441
|
export const reflect = TSL.reflect;
|
|
@@ -405,7 +446,6 @@ export const refract = TSL.refract;
|
|
|
405
446
|
export const refractVector = TSL.refractVector;
|
|
406
447
|
export const refractView = TSL.refractView;
|
|
407
448
|
export const reinhardToneMapping = TSL.reinhardToneMapping;
|
|
408
|
-
export const remainder = TSL.remainder;
|
|
409
449
|
export const remap = TSL.remap;
|
|
410
450
|
export const remapClamp = TSL.remapClamp;
|
|
411
451
|
export const renderGroup = TSL.renderGroup;
|
|
@@ -418,6 +458,7 @@ export const round = TSL.round;
|
|
|
418
458
|
export const rtt = TSL.rtt;
|
|
419
459
|
export const sRGBTransferEOTF = TSL.sRGBTransferEOTF;
|
|
420
460
|
export const sRGBTransferOETF = TSL.sRGBTransferOETF;
|
|
461
|
+
export const sample = TSL.sample;
|
|
421
462
|
export const sampler = TSL.sampler;
|
|
422
463
|
export const samplerComparison = TSL.samplerComparison;
|
|
423
464
|
export const saturate = TSL.saturate;
|
|
@@ -430,12 +471,12 @@ export const scriptable = TSL.scriptable;
|
|
|
430
471
|
export const scriptableValue = TSL.scriptableValue;
|
|
431
472
|
export const select = TSL.select;
|
|
432
473
|
export const setCurrentStack = TSL.setCurrentStack;
|
|
474
|
+
export const setName = TSL.setName;
|
|
433
475
|
export const shaderStages = TSL.shaderStages;
|
|
434
476
|
export const shadow = TSL.shadow;
|
|
435
|
-
export const pointShadow = TSL.pointShadow;
|
|
436
477
|
export const shadowPositionWorld = TSL.shadowPositionWorld;
|
|
437
|
-
export const sharedUniformGroup = TSL.sharedUniformGroup;
|
|
438
478
|
export const shapeCircle = TSL.shapeCircle;
|
|
479
|
+
export const sharedUniformGroup = TSL.sharedUniformGroup;
|
|
439
480
|
export const sheen = TSL.sheen;
|
|
440
481
|
export const sheenRoughness = TSL.sheenRoughness;
|
|
441
482
|
export const shiftLeft = TSL.shiftLeft;
|
|
@@ -455,6 +496,7 @@ export const spritesheetUV = TSL.spritesheetUV;
|
|
|
455
496
|
export const sqrt = TSL.sqrt;
|
|
456
497
|
export const stack = TSL.stack;
|
|
457
498
|
export const step = TSL.step;
|
|
499
|
+
export const stepElement = TSL.stepElement;
|
|
458
500
|
export const storage = TSL.storage;
|
|
459
501
|
export const storageBarrier = TSL.storageBarrier;
|
|
460
502
|
export const storageObject = TSL.storageObject;
|
|
@@ -462,6 +504,7 @@ export const storageTexture = TSL.storageTexture;
|
|
|
462
504
|
export const string = TSL.string;
|
|
463
505
|
export const struct = TSL.struct;
|
|
464
506
|
export const sub = TSL.sub;
|
|
507
|
+
export const subBuild = TSL.subBuild;
|
|
465
508
|
export const subgroupIndex = TSL.subgroupIndex;
|
|
466
509
|
export const subgroupSize = TSL.subgroupSize;
|
|
467
510
|
export const tan = TSL.tan;
|
|
@@ -474,6 +517,7 @@ export const texture = TSL.texture;
|
|
|
474
517
|
export const texture3D = TSL.texture3D;
|
|
475
518
|
export const textureBarrier = TSL.textureBarrier;
|
|
476
519
|
export const textureBicubic = TSL.textureBicubic;
|
|
520
|
+
export const textureBicubicLevel = TSL.textureBicubicLevel;
|
|
477
521
|
export const textureCubeUV = TSL.textureCubeUV;
|
|
478
522
|
export const textureLoad = TSL.textureLoad;
|
|
479
523
|
export const textureSize = TSL.textureSize;
|
|
@@ -489,35 +533,27 @@ export const toonOutlinePass = TSL.toonOutlinePass;
|
|
|
489
533
|
export const transformDirection = TSL.transformDirection;
|
|
490
534
|
export const transformNormal = TSL.transformNormal;
|
|
491
535
|
export const transformNormalToView = TSL.transformNormalToView;
|
|
492
|
-
export const transformedBentNormalView = TSL.transformedBentNormalView;
|
|
493
|
-
export const transformedBitangentView = TSL.transformedBitangentView;
|
|
494
|
-
export const transformedBitangentWorld = TSL.transformedBitangentWorld;
|
|
495
536
|
export const transformedClearcoatNormalView = TSL.transformedClearcoatNormalView;
|
|
496
537
|
export const transformedNormalView = TSL.transformedNormalView;
|
|
497
538
|
export const transformedNormalWorld = TSL.transformedNormalWorld;
|
|
498
|
-
export const transformedTangentView = TSL.transformedTangentView;
|
|
499
|
-
export const transformedTangentWorld = TSL.transformedTangentWorld;
|
|
500
539
|
export const transmission = TSL.transmission;
|
|
501
540
|
export const transpose = TSL.transpose;
|
|
502
541
|
export const triNoise3D = TSL.triNoise3D;
|
|
503
542
|
export const triplanarTexture = TSL.triplanarTexture;
|
|
504
543
|
export const triplanarTextures = TSL.triplanarTextures;
|
|
505
544
|
export const trunc = TSL.trunc;
|
|
506
|
-
export const tslFn = TSL.tslFn;
|
|
507
545
|
export const uint = TSL.uint;
|
|
508
546
|
export const uniform = TSL.uniform;
|
|
509
|
-
export const uniformCubeTexture = TSL.uniformCubeTexture;
|
|
510
547
|
export const uniformArray = TSL.uniformArray;
|
|
548
|
+
export const uniformCubeTexture = TSL.uniformCubeTexture;
|
|
511
549
|
export const uniformGroup = TSL.uniformGroup;
|
|
512
550
|
export const uniformTexture = TSL.uniformTexture;
|
|
513
|
-
export const
|
|
514
|
-
export const unpremult = TSL.unpremult;
|
|
551
|
+
export const unpremultiplyAlpha = TSL.unpremultiplyAlpha;
|
|
515
552
|
export const userData = TSL.userData;
|
|
516
553
|
export const uv = TSL.uv;
|
|
517
554
|
export const uvec2 = TSL.uvec2;
|
|
518
555
|
export const uvec3 = TSL.uvec3;
|
|
519
556
|
export const uvec4 = TSL.uvec4;
|
|
520
|
-
export const Var = TSL.Var;
|
|
521
557
|
export const varying = TSL.varying;
|
|
522
558
|
export const varyingProperty = TSL.varyingProperty;
|
|
523
559
|
export const vec2 = TSL.vec2;
|
|
@@ -527,12 +563,12 @@ export const vectorComponents = TSL.vectorComponents;
|
|
|
527
563
|
export const velocity = TSL.velocity;
|
|
528
564
|
export const vertexColor = TSL.vertexColor;
|
|
529
565
|
export const vertexIndex = TSL.vertexIndex;
|
|
566
|
+
export const vertexStage = TSL.vertexStage;
|
|
530
567
|
export const vibrance = TSL.vibrance;
|
|
531
568
|
export const viewZToLogarithmicDepth = TSL.viewZToLogarithmicDepth;
|
|
532
569
|
export const viewZToOrthographicDepth = TSL.viewZToOrthographicDepth;
|
|
533
570
|
export const viewZToPerspectiveDepth = TSL.viewZToPerspectiveDepth;
|
|
534
571
|
export const viewport = TSL.viewport;
|
|
535
|
-
export const viewportBottomLeft = TSL.viewportBottomLeft;
|
|
536
572
|
export const viewportCoordinate = TSL.viewportCoordinate;
|
|
537
573
|
export const viewportDepthTexture = TSL.viewportDepthTexture;
|
|
538
574
|
export const viewportLinearDepth = TSL.viewportLinearDepth;
|
|
@@ -542,7 +578,6 @@ export const viewportSafeUV = TSL.viewportSafeUV;
|
|
|
542
578
|
export const viewportSharedTexture = TSL.viewportSharedTexture;
|
|
543
579
|
export const viewportSize = TSL.viewportSize;
|
|
544
580
|
export const viewportTexture = TSL.viewportTexture;
|
|
545
|
-
export const viewportTopLeft = TSL.viewportTopLeft;
|
|
546
581
|
export const viewportUV = TSL.viewportUV;
|
|
547
582
|
export const wgsl = TSL.wgsl;
|
|
548
583
|
export const wgslFn = TSL.wgslFn;
|
|
@@ -551,3 +586,17 @@ export const workgroupBarrier = TSL.workgroupBarrier;
|
|
|
551
586
|
export const workgroupId = TSL.workgroupId;
|
|
552
587
|
export const workingToColorSpace = TSL.workingToColorSpace;
|
|
553
588
|
export const xor = TSL.xor;
|
|
589
|
+
|
|
590
|
+
/*
|
|
591
|
+
// Use this code to generate the export statements dynamically
|
|
592
|
+
|
|
593
|
+
let code = '';
|
|
594
|
+
|
|
595
|
+
for ( const key of Object.keys( THREE.TSL ) ) {
|
|
596
|
+
|
|
597
|
+
code += `export const ${ key } = TSL.${ key };\n`;
|
|
598
|
+
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
console.log( code );
|
|
602
|
+
//*/
|
package/src/Three.WebGPU.js
CHANGED
|
@@ -10,6 +10,8 @@ export { default as PostProcessing } from './renderers/common/PostProcessing.js'
|
|
|
10
10
|
import * as RendererUtils from './renderers/common/RendererUtils.js';
|
|
11
11
|
export { RendererUtils };
|
|
12
12
|
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
13
|
+
export { default as Storage3DTexture } from './renderers/common/Storage3DTexture.js';
|
|
14
|
+
export { default as StorageArrayTexture } from './renderers/common/StorageArrayTexture.js';
|
|
13
15
|
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
|
|
14
16
|
export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
|
|
15
17
|
export { default as IndirectStorageBufferAttribute } from './renderers/common/IndirectStorageBufferAttribute.js';
|
|
@@ -20,7 +20,7 @@ class KeyframeTrack {
|
|
|
20
20
|
*
|
|
21
21
|
* @param {string} name - The keyframe track's name.
|
|
22
22
|
* @param {Array<number>} times - A list of keyframe times.
|
|
23
|
-
* @param {Array<number>} values - A list of keyframe values.
|
|
23
|
+
* @param {Array<number|string|boolean>} values - A list of keyframe values.
|
|
24
24
|
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
25
25
|
*/
|
|
26
26
|
constructor( name, times, values, interpolation ) {
|
|
@@ -16,7 +16,7 @@ class BooleanKeyframeTrack extends KeyframeTrack {
|
|
|
16
16
|
*
|
|
17
17
|
* @param {string} name - The keyframe track's name.
|
|
18
18
|
* @param {Array<number>} times - A list of keyframe times.
|
|
19
|
-
* @param {Array<
|
|
19
|
+
* @param {Array<boolean>} values - A list of keyframe values.
|
|
20
20
|
*/
|
|
21
21
|
constructor( name, times, values ) {
|
|
22
22
|
|
|
@@ -16,7 +16,7 @@ class StringKeyframeTrack extends KeyframeTrack {
|
|
|
16
16
|
*
|
|
17
17
|
* @param {string} name - The keyframe track's name.
|
|
18
18
|
* @param {Array<number>} times - A list of keyframe times.
|
|
19
|
-
* @param {Array<
|
|
19
|
+
* @param {Array<string>} values - A list of keyframe values.
|
|
20
20
|
*/
|
|
21
21
|
constructor( name, times, values ) {
|
|
22
22
|
|
package/src/cameras/Camera.js
CHANGED
|
@@ -57,6 +57,20 @@ class Camera extends Object3D {
|
|
|
57
57
|
*/
|
|
58
58
|
this.coordinateSystem = WebGLCoordinateSystem;
|
|
59
59
|
|
|
60
|
+
this._reversedDepth = false;
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The flag that indicates whether the camera uses a reversed depth buffer.
|
|
66
|
+
*
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
get reversedDepth() {
|
|
71
|
+
|
|
72
|
+
return this._reversedDepth;
|
|
73
|
+
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
copy( source, recursive ) {
|
|
@@ -216,7 +216,7 @@ class OrthographicCamera extends Camera {
|
|
|
216
216
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
|
|
219
|
+
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );
|
|
220
220
|
|
|
221
221
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
222
222
|
|
|
@@ -374,7 +374,7 @@ class PerspectiveCamera extends Camera {
|
|
|
374
374
|
const skew = this.filmOffset;
|
|
375
375
|
if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
|
|
376
376
|
|
|
377
|
-
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
|
|
377
|
+
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );
|
|
378
378
|
|
|
379
379
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
380
380
|
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '179';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -1612,8 +1612,8 @@ export const InterpolationSamplingMode = {
|
|
|
1612
1612
|
NORMAL: 'normal',
|
|
1613
1613
|
CENTROID: 'centroid',
|
|
1614
1614
|
SAMPLE: 'sample',
|
|
1615
|
-
|
|
1616
|
-
|
|
1615
|
+
FIRST: 'first',
|
|
1616
|
+
EITHER: 'either'
|
|
1617
1617
|
};
|
|
1618
1618
|
|
|
1619
1619
|
/**
|
|
@@ -88,7 +88,7 @@ class BufferAttribute {
|
|
|
88
88
|
/**
|
|
89
89
|
* Applies to integer data only. Indicates how the underlying data in the buffer maps to
|
|
90
90
|
* the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`,
|
|
91
|
-
* and `normalized` is `true`, the values `0
|
|
91
|
+
* and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to
|
|
92
92
|
* `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted
|
|
93
93
|
* to floats unmodified, i.e. `65535` becomes `65535.0f`.
|
|
94
94
|
*
|
|
@@ -841,8 +841,8 @@ class Uint32BufferAttribute extends BufferAttribute {
|
|
|
841
841
|
* Convenient class that can be used when creating a `Float16` buffer attribute with
|
|
842
842
|
* a plain `Array` instance.
|
|
843
843
|
*
|
|
844
|
-
* This class automatically converts to and from FP16 since `Float16Array`
|
|
845
|
-
*
|
|
844
|
+
* This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`
|
|
845
|
+
* browser support is still problematic.
|
|
846
846
|
*
|
|
847
847
|
* @augments BufferAttribute
|
|
848
848
|
*/
|
package/src/core/Clock.js
CHANGED
|
@@ -61,7 +61,7 @@ class Clock {
|
|
|
61
61
|
*/
|
|
62
62
|
start() {
|
|
63
63
|
|
|
64
|
-
this.startTime = now();
|
|
64
|
+
this.startTime = performance.now();
|
|
65
65
|
|
|
66
66
|
this.oldTime = this.startTime;
|
|
67
67
|
this.elapsedTime = 0;
|
|
@@ -110,7 +110,7 @@ class Clock {
|
|
|
110
110
|
|
|
111
111
|
if ( this.running ) {
|
|
112
112
|
|
|
113
|
-
const newTime = now();
|
|
113
|
+
const newTime = performance.now();
|
|
114
114
|
|
|
115
115
|
diff = ( newTime - this.oldTime ) / 1000;
|
|
116
116
|
this.oldTime = newTime;
|
|
@@ -125,10 +125,4 @@ class Clock {
|
|
|
125
125
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
function now() {
|
|
129
|
-
|
|
130
|
-
return performance.now();
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
128
|
export { Clock };
|
|
@@ -19,8 +19,9 @@ class GLBufferAttribute {
|
|
|
19
19
|
* @param {number} itemSize - The item size.
|
|
20
20
|
* @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.
|
|
21
21
|
* @param {number} count - The expected number of vertices in VBO.
|
|
22
|
+
* @param {boolean} [normalized=false] - Whether the data are normalized or not.
|
|
22
23
|
*/
|
|
23
|
-
constructor( buffer, type, itemSize, elementSize, count ) {
|
|
24
|
+
constructor( buffer, type, itemSize, elementSize, count, normalized = false ) {
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* This flag can be used for type testing.
|
|
@@ -73,6 +74,17 @@ class GLBufferAttribute {
|
|
|
73
74
|
*/
|
|
74
75
|
this.count = count;
|
|
75
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Applies to integer data only. Indicates how the underlying data in the buffer maps to
|
|
79
|
+
* the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`,
|
|
80
|
+
* and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to
|
|
81
|
+
* `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted
|
|
82
|
+
* to floats unmodified, i.e. `65535` becomes `65535.0f`.
|
|
83
|
+
*
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
86
|
+
this.normalized = normalized;
|
|
87
|
+
|
|
76
88
|
/**
|
|
77
89
|
* A version number, incremented every time the `needsUpdate` is set to `true`.
|
|
78
90
|
*
|
package/src/core/Object3D.js
CHANGED
|
@@ -47,7 +47,7 @@ const _removedEvent = { type: 'removed' };
|
|
|
47
47
|
const _childaddedEvent = { type: 'childadded', child: null };
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Fires when a
|
|
50
|
+
* Fires when a child object has been removed.
|
|
51
51
|
*
|
|
52
52
|
* @event Object3D#childremoved
|
|
53
53
|
* @type {Object}
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* const timer = new Timer();
|
|
12
12
|
* timer.connect( document ); // use Page Visibility API
|
|
13
13
|
* ```
|
|
14
|
-
*
|
|
15
|
-
* @three_import import { Timer } from 'three/addons/misc/Timer.js';
|
|
16
14
|
*/
|
|
17
15
|
class Timer {
|
|
18
16
|
|
|
@@ -23,7 +21,7 @@ class Timer {
|
|
|
23
21
|
|
|
24
22
|
this._previousTime = 0;
|
|
25
23
|
this._currentTime = 0;
|
|
26
|
-
this._startTime = now();
|
|
24
|
+
this._startTime = performance.now();
|
|
27
25
|
|
|
28
26
|
this._delta = 0;
|
|
29
27
|
this._elapsed = 0;
|
|
@@ -129,7 +127,7 @@ class Timer {
|
|
|
129
127
|
*/
|
|
130
128
|
reset() {
|
|
131
129
|
|
|
132
|
-
this._currentTime = now() - this._startTime;
|
|
130
|
+
this._currentTime = performance.now() - this._startTime;
|
|
133
131
|
|
|
134
132
|
return this;
|
|
135
133
|
|
|
@@ -164,7 +162,7 @@ class Timer {
|
|
|
164
162
|
} else {
|
|
165
163
|
|
|
166
164
|
this._previousTime = this._currentTime;
|
|
167
|
-
this._currentTime = ( timestamp !== undefined ? timestamp : now() ) - this._startTime;
|
|
165
|
+
this._currentTime = ( timestamp !== undefined ? timestamp : performance.now() ) - this._startTime;
|
|
168
166
|
|
|
169
167
|
this._delta = ( this._currentTime - this._previousTime ) * this._timescale;
|
|
170
168
|
this._elapsed += this._delta; // _elapsed is the accumulation of all previous deltas
|
|
@@ -177,46 +175,10 @@ class Timer {
|
|
|
177
175
|
|
|
178
176
|
}
|
|
179
177
|
|
|
180
|
-
/**
|
|
181
|
-
* A special version of a timer with a fixed time delta value.
|
|
182
|
-
* Can be useful for testing and debugging purposes.
|
|
183
|
-
*
|
|
184
|
-
* @augments Timer
|
|
185
|
-
*/
|
|
186
|
-
class FixedTimer extends Timer {
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Constructs a new timer.
|
|
190
|
-
*
|
|
191
|
-
* @param {number} [fps=60] - The fixed FPS of this timer.
|
|
192
|
-
*/
|
|
193
|
-
constructor( fps = 60 ) {
|
|
194
|
-
|
|
195
|
-
super();
|
|
196
|
-
this._delta = ( 1 / fps ) * 1000;
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
update() {
|
|
201
|
-
|
|
202
|
-
this._elapsed += ( this._delta * this._timescale ); // _elapsed is the accumulation of all previous deltas
|
|
203
|
-
|
|
204
|
-
return this;
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function now() {
|
|
211
|
-
|
|
212
|
-
return performance.now();
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
178
|
function handleVisibilityChange() {
|
|
217
179
|
|
|
218
180
|
if ( this._document.hidden === false ) this.reset();
|
|
219
181
|
|
|
220
182
|
}
|
|
221
183
|
|
|
222
|
-
export { Timer
|
|
184
|
+
export { Timer };
|