@needle-tools/three 0.153.0 → 0.154.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/build/three.cjs +112 -364
- package/build/three.js +112 -364
- package/build/three.min.js +1 -1
- package/build/three.module.js +113 -346
- package/build/three.module.min.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +2 -1
- package/examples/jsm/controls/FlyControls.js +25 -9
- package/examples/jsm/controls/OrbitControls.js +7 -1
- package/examples/jsm/csm/CSM.js +1 -1
- package/examples/jsm/effects/AnaglyphEffect.js +1 -1
- package/examples/jsm/effects/OutlineEffect.js +1 -1
- package/examples/jsm/effects/ParallaxBarrierEffect.js +1 -1
- package/examples/jsm/environments/RoomEnvironment.js +6 -2
- package/examples/jsm/lines/LineMaterial.js +1 -1
- package/examples/jsm/loaders/3DMLoader.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +5 -1
- package/examples/jsm/loaders/AMFLoader.js +5 -1
- package/examples/jsm/loaders/ColladaLoader.js +4 -1
- package/examples/jsm/loaders/FBXLoader.js +9 -2
- package/examples/jsm/loaders/LDrawLoader.js +4 -7
- package/examples/jsm/loaders/PLYLoader.js +16 -6
- package/examples/jsm/loaders/VRMLLoader.js +16 -4
- package/examples/jsm/materials/MeshGouraudMaterial.js +2 -2
- package/examples/jsm/math/MeshSurfaceSampler.js +76 -35
- package/examples/jsm/nodes/Nodes.js +20 -15
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +21 -8
- package/examples/jsm/nodes/accessors/CameraNode.js +25 -4
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +7 -1
- package/examples/jsm/nodes/accessors/InstanceNode.js +2 -4
- package/examples/jsm/nodes/accessors/MaterialNode.js +55 -47
- package/examples/jsm/nodes/accessors/ModelNode.js +3 -1
- package/examples/jsm/nodes/accessors/MorphNode.js +70 -0
- package/examples/jsm/nodes/accessors/NormalNode.js +3 -2
- package/examples/jsm/nodes/accessors/Object3DNode.js +10 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +46 -0
- package/examples/jsm/nodes/accessors/SkinningNode.js +43 -62
- package/examples/jsm/nodes/accessors/TangentNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +94 -0
- package/examples/jsm/nodes/accessors/TextureNode.js +68 -6
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +35 -0
- package/examples/jsm/nodes/accessors/UVNode.js +1 -1
- package/examples/jsm/nodes/code/CodeNode.js +3 -0
- package/examples/jsm/nodes/code/FunctionNode.js +25 -4
- package/examples/jsm/nodes/core/BypassNode.js +2 -2
- package/examples/jsm/nodes/core/ContextNode.js +2 -0
- package/examples/jsm/nodes/core/IndexNode.js +66 -0
- package/examples/jsm/nodes/core/LightingModel.js +2 -1
- package/examples/jsm/nodes/core/Node.js +12 -15
- package/examples/jsm/nodes/core/NodeBuilder.js +24 -5
- package/examples/jsm/nodes/core/PropertyNode.js +4 -0
- package/examples/jsm/nodes/core/StackNode.js +1 -1
- package/examples/jsm/nodes/core/UniformNode.js +1 -1
- package/examples/jsm/nodes/core/VarNode.js +1 -3
- package/examples/jsm/nodes/display/BlendModeNode.js +9 -9
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +7 -7
- package/examples/jsm/nodes/display/ColorSpaceNode.js +50 -49
- package/examples/jsm/nodes/display/NormalMapNode.js +3 -3
- package/examples/jsm/nodes/display/ToneMappingNode.js +8 -8
- package/examples/jsm/nodes/display/ViewportDepthNode.js +69 -0
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +34 -0
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +6 -5
- package/examples/jsm/nodes/display/ViewportTextureNode.js +23 -15
- package/examples/jsm/nodes/functions/BSDF/BRDF_BlinnPhong.js +5 -5
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +10 -8
- package/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.js +43 -0
- package/examples/jsm/nodes/functions/BSDF/DFGApprox.js +4 -4
- package/examples/jsm/nodes/functions/BSDF/D_GGX.js +2 -2
- package/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js +13 -0
- package/examples/jsm/nodes/functions/BSDF/F_Schlick.js +2 -4
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/examples/jsm/nodes/functions/PhongLightingModel.js +7 -7
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +129 -18
- package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/examples/jsm/nodes/functions/material/getRoughness.js +3 -3
- package/examples/jsm/nodes/geometry/RangeNode.js +1 -1
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +91 -62
- package/examples/jsm/nodes/lighting/LightUtils.js +2 -2
- package/examples/jsm/nodes/lighting/LightingContextNode.js +17 -15
- package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/SpotLightNode.js +3 -3
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -15
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -15
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -10
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -9
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +41 -0
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +1 -14
- package/examples/jsm/nodes/materials/NodeMaterial.js +79 -28
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -9
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -7
- package/examples/jsm/nodes/materialx/lib/mx_hsv.js +3 -3
- package/examples/jsm/nodes/materialx/lib/mx_noise.js +14 -14
- package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +4 -4
- package/examples/jsm/nodes/math/MathNode.js +6 -0
- package/examples/jsm/nodes/math/OperatorNode.js +1 -1
- package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
- package/examples/jsm/nodes/shadernode/ShaderNode.js +24 -4
- package/examples/jsm/nodes/utils/LoopNode.js +1 -1
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +1 -1
- package/examples/jsm/objects/GroundProjectedSkybox.js +1 -1
- package/examples/jsm/objects/Reflector.js +1 -1
- package/examples/jsm/objects/Refractor.js +1 -1
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/Water.js +1 -1
- package/examples/jsm/objects/Water2.js +1 -1
- package/examples/jsm/offscreen/scene.js +1 -0
- package/examples/jsm/postprocessing/EffectComposer.js +2 -0
- package/examples/jsm/postprocessing/OutlinePass.js +1 -3
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -12
- package/examples/jsm/postprocessing/SavePass.js +3 -1
- package/examples/jsm/postprocessing/TAARenderPass.js +14 -2
- package/examples/jsm/postprocessing/TexturePass.js +2 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +9 -10
- package/examples/jsm/renderers/common/Backend.js +2 -0
- package/examples/jsm/renderers/common/Background.js +7 -6
- package/examples/jsm/renderers/common/Pipelines.js +26 -14
- package/examples/jsm/renderers/common/RenderObject.js +18 -0
- package/examples/jsm/renderers/common/RenderObjects.js +29 -29
- package/examples/jsm/renderers/common/Renderer.js +48 -6
- package/examples/jsm/renderers/common/nodes/Nodes.js +1 -1
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +340 -0
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +23 -19
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +123 -41
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +29 -9
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +4 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +8 -13
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +85 -3
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +5 -1
- package/examples/jsm/shaders/BlendShader.js +1 -2
- package/examples/jsm/shaders/BokehShader2.js +1 -1
- package/examples/jsm/shaders/CopyShader.js +2 -2
- package/examples/jsm/shaders/ToonShader.js +4 -4
- package/examples/jsm/shaders/WaterRefractionShader.js +1 -1
- package/examples/jsm/webxr/OculusHandPointerModel.js +34 -13
- package/package.json +2 -1
- package/src/Three.Legacy.js +0 -228
- package/src/animation/PropertyBinding.js +1 -1
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +0 -24
- package/src/core/BufferGeometry.js +0 -7
- package/src/loaders/Loader.js +2 -0
- package/src/loaders/MaterialLoader.js +1 -0
- package/src/materials/Material.js +3 -0
- package/src/objects/Skeleton.js +0 -2
- package/src/renderers/WebGLRenderer.js +9 -21
- package/src/renderers/shaders/ShaderChunk/alphahash_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/alphahash_pars_fragment.glsl.js +68 -0
- package/src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk.js +10 -6
- package/src/renderers/shaders/ShaderLib/background.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/cube.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/equirect.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/points.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +4 -2
- package/src/renderers/webgl/WebGLObjects.js +23 -3
- package/src/renderers/webgl/WebGLProgram.js +24 -5
- package/src/renderers/webgl/WebGLPrograms.js +3 -0
- package/src/renderers/webxr/WebXRManager.js +11 -29
- package/src/scenes/Scene.js +0 -14
- package/examples/jsm/nodes/core/InstanceIndexNode.js +0 -45
- /package/src/renderers/shaders/ShaderChunk/{encodings_fragment.glsl.js → colorspace_fragment.glsl.js} +0 -0
- /package/src/renderers/shaders/ShaderChunk/{encodings_pars_fragment.glsl.js → colorspace_pars_fragment.glsl.js} +0 -0
- /package/src/renderers/shaders/ShaderChunk/{output_fragment.glsl.js → opaque_fragment.glsl.js} +0 -0
package/src/Three.Legacy.js
CHANGED
|
@@ -1,229 +1 @@
|
|
|
1
|
-
import { BoxGeometry } from './geometries/BoxGeometry.js';
|
|
2
|
-
import { CapsuleGeometry } from './geometries/CapsuleGeometry.js';
|
|
3
|
-
import { CircleGeometry } from './geometries/CircleGeometry.js';
|
|
4
|
-
import { ConeGeometry } from './geometries/ConeGeometry.js';
|
|
5
|
-
import { CylinderGeometry } from './geometries/CylinderGeometry.js';
|
|
6
|
-
import { DodecahedronGeometry } from './geometries/DodecahedronGeometry.js';
|
|
7
|
-
import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
|
|
8
|
-
import { IcosahedronGeometry } from './geometries/IcosahedronGeometry.js';
|
|
9
|
-
import { LatheGeometry } from './geometries/LatheGeometry.js';
|
|
10
|
-
import { OctahedronGeometry } from './geometries/OctahedronGeometry.js';
|
|
11
|
-
import { PlaneGeometry } from './geometries/PlaneGeometry.js';
|
|
12
|
-
import { PolyhedronGeometry } from './geometries/PolyhedronGeometry.js';
|
|
13
|
-
import { RingGeometry } from './geometries/RingGeometry.js';
|
|
14
|
-
import { ShapeGeometry } from './geometries/ShapeGeometry.js';
|
|
15
|
-
import { SphereGeometry } from './geometries/SphereGeometry.js';
|
|
16
|
-
import { TetrahedronGeometry } from './geometries/TetrahedronGeometry.js';
|
|
17
|
-
import { TorusGeometry } from './geometries/TorusGeometry.js';
|
|
18
|
-
import { TorusKnotGeometry } from './geometries/TorusKnotGeometry.js';
|
|
19
|
-
import { TubeGeometry } from './geometries/TubeGeometry.js';
|
|
20
1
|
|
|
21
|
-
export class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144
|
|
22
|
-
|
|
23
|
-
constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {
|
|
24
|
-
|
|
25
|
-
console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' );
|
|
26
|
-
super( width, height, depth, widthSegments, heightSegments, depthSegments );
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144
|
|
34
|
-
|
|
35
|
-
constructor( radius, length, capSegments, radialSegments ) {
|
|
36
|
-
|
|
37
|
-
console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' );
|
|
38
|
-
super( radius, length, capSegments, radialSegments );
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144
|
|
45
|
-
|
|
46
|
-
constructor( radius, segments, thetaStart, thetaLength ) {
|
|
47
|
-
|
|
48
|
-
console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' );
|
|
49
|
-
super( radius, segments, thetaStart, thetaLength );
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144
|
|
56
|
-
|
|
57
|
-
constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
58
|
-
|
|
59
|
-
console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' );
|
|
60
|
-
super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144
|
|
67
|
-
|
|
68
|
-
constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
69
|
-
|
|
70
|
-
console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' );
|
|
71
|
-
super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144
|
|
78
|
-
|
|
79
|
-
constructor( radius, detail ) {
|
|
80
|
-
|
|
81
|
-
console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' );
|
|
82
|
-
super( radius, detail );
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144
|
|
89
|
-
|
|
90
|
-
constructor( shapes, options ) {
|
|
91
|
-
|
|
92
|
-
console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' );
|
|
93
|
-
super( shapes, options );
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144
|
|
100
|
-
|
|
101
|
-
constructor( radius, detail ) {
|
|
102
|
-
|
|
103
|
-
console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' );
|
|
104
|
-
super( radius, detail );
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144
|
|
111
|
-
|
|
112
|
-
constructor( points, segments, phiStart, phiLength ) {
|
|
113
|
-
|
|
114
|
-
console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' );
|
|
115
|
-
super( points, segments, phiStart, phiLength );
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144
|
|
122
|
-
|
|
123
|
-
constructor( radius, detail ) {
|
|
124
|
-
|
|
125
|
-
console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' );
|
|
126
|
-
super( radius, detail );
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144
|
|
133
|
-
|
|
134
|
-
constructor( width, height, widthSegments, heightSegments ) {
|
|
135
|
-
|
|
136
|
-
console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' );
|
|
137
|
-
super( width, height, widthSegments, heightSegments );
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144
|
|
144
|
-
|
|
145
|
-
constructor( vertices, indices, radius, detail ) {
|
|
146
|
-
|
|
147
|
-
console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' );
|
|
148
|
-
super( vertices, indices, radius, detail );
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export class RingBufferGeometry extends RingGeometry { // @deprecated, r144
|
|
155
|
-
|
|
156
|
-
constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {
|
|
157
|
-
|
|
158
|
-
console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' );
|
|
159
|
-
super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength );
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144
|
|
166
|
-
|
|
167
|
-
constructor( shapes, curveSegments ) {
|
|
168
|
-
|
|
169
|
-
console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' );
|
|
170
|
-
super( shapes, curveSegments );
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144
|
|
177
|
-
|
|
178
|
-
constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {
|
|
179
|
-
|
|
180
|
-
console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' );
|
|
181
|
-
super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144
|
|
188
|
-
|
|
189
|
-
constructor( radius, detail ) {
|
|
190
|
-
|
|
191
|
-
console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' );
|
|
192
|
-
super( radius, detail );
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144
|
|
199
|
-
|
|
200
|
-
constructor( radius, tube, radialSegments, tubularSegments, arc ) {
|
|
201
|
-
|
|
202
|
-
console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' );
|
|
203
|
-
super( radius, tube, radialSegments, tubularSegments, arc );
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144
|
|
210
|
-
|
|
211
|
-
constructor( radius, tube, tubularSegments, radialSegments, p, q ) {
|
|
212
|
-
|
|
213
|
-
console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' );
|
|
214
|
-
super( radius, tube, tubularSegments, radialSegments, p, q );
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144
|
|
221
|
-
|
|
222
|
-
constructor( path, tubularSegments, radius, radialSegments, closed ) {
|
|
223
|
-
|
|
224
|
-
console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' );
|
|
225
|
-
super( path, tubularSegments, radius, radialSegments, closed );
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
}
|
|
@@ -436,7 +436,7 @@ class PropertyBinding {
|
|
|
436
436
|
// ensure there is a value node
|
|
437
437
|
if ( ! targetObject ) {
|
|
438
438
|
|
|
439
|
-
console.
|
|
439
|
+
console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );
|
|
440
440
|
return;
|
|
441
441
|
|
|
442
442
|
}
|
package/src/constants.js
CHANGED
|
@@ -346,30 +346,6 @@ class BufferAttribute {
|
|
|
346
346
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
copyColorsArray() { // @deprecated, r144
|
|
350
|
-
|
|
351
|
-
console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
copyVector2sArray() { // @deprecated, r144
|
|
356
|
-
|
|
357
|
-
console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
copyVector3sArray() { // @deprecated, r144
|
|
362
|
-
|
|
363
|
-
console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
copyVector4sArray() { // @deprecated, r144
|
|
368
|
-
|
|
369
|
-
console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
349
|
}
|
|
374
350
|
|
|
375
351
|
//
|
|
@@ -726,13 +726,6 @@ class BufferGeometry extends EventDispatcher {
|
|
|
726
726
|
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
merge() { // @deprecated, r144
|
|
730
|
-
|
|
731
|
-
console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' );
|
|
732
|
-
return this;
|
|
733
|
-
|
|
734
|
-
}
|
|
735
|
-
|
|
736
729
|
normalizeNormals() {
|
|
737
730
|
|
|
738
731
|
const normals = this.attributes.normal;
|
package/src/loaders/Loader.js
CHANGED
|
@@ -121,6 +121,7 @@ class MaterialLoader extends Loader {
|
|
|
121
121
|
if ( json.opacity !== undefined ) material.opacity = json.opacity;
|
|
122
122
|
if ( json.transparent !== undefined ) material.transparent = json.transparent;
|
|
123
123
|
if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;
|
|
124
|
+
if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;
|
|
124
125
|
if ( json.depthTest !== undefined ) material.depthTest = json.depthTest;
|
|
125
126
|
if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;
|
|
126
127
|
if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;
|
|
@@ -25,6 +25,7 @@ class Material extends EventDispatcher {
|
|
|
25
25
|
|
|
26
26
|
this.opacity = 1;
|
|
27
27
|
this.transparent = false;
|
|
28
|
+
this.alphaHash = false;
|
|
28
29
|
|
|
29
30
|
this.blendSrc = SrcAlphaFactor;
|
|
30
31
|
this.blendDst = OneMinusSrcAlphaFactor;
|
|
@@ -353,6 +354,7 @@ class Material extends EventDispatcher {
|
|
|
353
354
|
if ( this.dithering === true ) data.dithering = true;
|
|
354
355
|
|
|
355
356
|
if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
|
|
357
|
+
if ( this.alphaHash === true ) data.alphaHash = this.alphaHash;
|
|
356
358
|
if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;
|
|
357
359
|
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
|
|
358
360
|
if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass;
|
|
@@ -474,6 +476,7 @@ class Material extends EventDispatcher {
|
|
|
474
476
|
this.dithering = source.dithering;
|
|
475
477
|
|
|
476
478
|
this.alphaTest = source.alphaTest;
|
|
479
|
+
this.alphaHash = source.alphaHash;
|
|
477
480
|
this.alphaToCoverage = source.alphaToCoverage;
|
|
478
481
|
this.premultipliedAlpha = source.premultipliedAlpha;
|
|
479
482
|
this.forceSinglePass = source.forceSinglePass;
|
package/src/objects/Skeleton.js
CHANGED
|
@@ -289,7 +289,7 @@ class WebGLRenderer {
|
|
|
289
289
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
292
|
+
if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
293
293
|
|
|
294
294
|
console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
|
|
295
295
|
|
|
@@ -607,15 +607,13 @@ class WebGLRenderer {
|
|
|
607
607
|
const g = clearColor.g;
|
|
608
608
|
const b = clearColor.b;
|
|
609
609
|
|
|
610
|
-
const __webglFramebuffer = properties.get( _currentRenderTarget ).__webglFramebuffer;
|
|
611
|
-
|
|
612
610
|
if ( isUnsignedType ) {
|
|
613
611
|
|
|
614
612
|
uintClearColor[ 0 ] = r;
|
|
615
613
|
uintClearColor[ 1 ] = g;
|
|
616
614
|
uintClearColor[ 2 ] = b;
|
|
617
615
|
uintClearColor[ 3 ] = a;
|
|
618
|
-
_gl.clearBufferuiv( _gl.COLOR,
|
|
616
|
+
_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );
|
|
619
617
|
|
|
620
618
|
} else {
|
|
621
619
|
|
|
@@ -623,7 +621,7 @@ class WebGLRenderer {
|
|
|
623
621
|
intClearColor[ 1 ] = g;
|
|
624
622
|
intClearColor[ 2 ] = b;
|
|
625
623
|
intClearColor[ 3 ] = a;
|
|
626
|
-
_gl.clearBufferiv( _gl.COLOR,
|
|
624
|
+
_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );
|
|
627
625
|
|
|
628
626
|
}
|
|
629
627
|
|
|
@@ -1056,7 +1054,9 @@ class WebGLRenderer {
|
|
|
1056
1054
|
|
|
1057
1055
|
if ( xr.enabled === true && xr.isPresenting === true ) {
|
|
1058
1056
|
|
|
1059
|
-
|
|
1057
|
+
if ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );
|
|
1058
|
+
|
|
1059
|
+
camera = xr.getCamera(); // use XR camera for rendering
|
|
1060
1060
|
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
@@ -1091,6 +1091,8 @@ class WebGLRenderer {
|
|
|
1091
1091
|
|
|
1092
1092
|
//
|
|
1093
1093
|
|
|
1094
|
+
this.info.render.frame ++;
|
|
1095
|
+
|
|
1094
1096
|
if ( _clippingEnabled === true ) clipping.beginShadows();
|
|
1095
1097
|
|
|
1096
1098
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
@@ -1103,7 +1105,6 @@ class WebGLRenderer {
|
|
|
1103
1105
|
|
|
1104
1106
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
1105
1107
|
|
|
1106
|
-
this.info.render.frame ++;
|
|
1107
1108
|
|
|
1108
1109
|
//
|
|
1109
1110
|
|
|
@@ -1233,19 +1234,6 @@ class WebGLRenderer {
|
|
|
1233
1234
|
|
|
1234
1235
|
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
|
|
1235
1236
|
|
|
1236
|
-
if ( object.isSkinnedMesh ) {
|
|
1237
|
-
|
|
1238
|
-
// update skeleton only once in a frame
|
|
1239
|
-
|
|
1240
|
-
if ( object.skeleton.frame !== info.render.frame ) {
|
|
1241
|
-
|
|
1242
|
-
object.skeleton.update();
|
|
1243
|
-
object.skeleton.frame = info.render.frame;
|
|
1244
|
-
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
1237
|
const geometry = objects.update( object );
|
|
1250
1238
|
const material = object.material;
|
|
1251
1239
|
|
|
@@ -1346,7 +1334,7 @@ class WebGLRenderer {
|
|
|
1346
1334
|
generateMipmaps: true,
|
|
1347
1335
|
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
|
|
1348
1336
|
minFilter: LinearMipmapLinearFilter,
|
|
1349
|
-
samples: ( isWebGL2
|
|
1337
|
+
samples: ( isWebGL2 ) ? 4 : 0
|
|
1350
1338
|
} );
|
|
1351
1339
|
|
|
1352
1340
|
// debug
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export default /* glsl */`
|
|
2
|
+
#ifdef USE_ALPHAHASH
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* See: https://casual-effects.com/research/Wyman2017Hashed/index.html
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const float ALPHA_HASH_SCALE = 0.05; // Derived from trials only, and may be changed.
|
|
9
|
+
|
|
10
|
+
float hash2D( vec2 value ) {
|
|
11
|
+
|
|
12
|
+
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
float hash3D( vec3 value ) {
|
|
17
|
+
|
|
18
|
+
return hash2D( vec2( hash2D( value.xy ), value.z ) );
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
float getAlphaHashThreshold( vec3 position ) {
|
|
23
|
+
|
|
24
|
+
// Find the discretized derivatives of our coordinates
|
|
25
|
+
float maxDeriv = max(
|
|
26
|
+
length( dFdx( position.xyz ) ),
|
|
27
|
+
length( dFdy( position.xyz ) )
|
|
28
|
+
);
|
|
29
|
+
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
|
|
30
|
+
|
|
31
|
+
// Find two nearest log-discretized noise scales
|
|
32
|
+
vec2 pixScales = vec2(
|
|
33
|
+
exp2( floor( log2( pixScale ) ) ),
|
|
34
|
+
exp2( ceil( log2( pixScale ) ) )
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// Compute alpha thresholds at our two noise scales
|
|
38
|
+
vec2 alpha = vec2(
|
|
39
|
+
hash3D( floor( pixScales.x * position.xyz ) ),
|
|
40
|
+
hash3D( floor( pixScales.y * position.xyz ) )
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Factor to interpolate lerp with
|
|
44
|
+
float lerpFactor = fract( log2( pixScale ) );
|
|
45
|
+
|
|
46
|
+
// Interpolate alpha threshold from noise at two scales
|
|
47
|
+
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
|
|
48
|
+
|
|
49
|
+
// Pass into CDF to compute uniformly distrib threshold
|
|
50
|
+
float a = min( lerpFactor, 1.0 - lerpFactor );
|
|
51
|
+
vec3 cases = vec3(
|
|
52
|
+
x * x / ( 2.0 * a * ( 1.0 - a ) ),
|
|
53
|
+
( x - 0.5 * a ) / ( 1.0 - a ),
|
|
54
|
+
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// Find our final, uniformly distributed alpha threshold (ατ)
|
|
58
|
+
float threshold = ( x < ( 1.0 - a ) )
|
|
59
|
+
? ( ( x < a ) ? cases.x : cases.y )
|
|
60
|
+
: cases.z;
|
|
61
|
+
|
|
62
|
+
// Avoids ατ == 0. Could also do ατ =1-ατ
|
|
63
|
+
return clamp( threshold , 1.0e-6, 1.0 );
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#endif
|
|
68
|
+
`;
|
|
@@ -27,7 +27,15 @@ float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
|
|
27
27
|
|
|
28
28
|
#else
|
|
29
29
|
|
|
30
|
-
mat3 tbn = getTangentFrame( - vViewPosition, normal,
|
|
30
|
+
mat3 tbn = getTangentFrame( - vViewPosition, normal,
|
|
31
|
+
#if defined( USE_NORMALMAP )
|
|
32
|
+
vNormalMapUv
|
|
33
|
+
#elif defined( USE_CLEARCOAT_NORMALMAP )
|
|
34
|
+
vClearcoatNormalMapUv
|
|
35
|
+
#else
|
|
36
|
+
vUv
|
|
37
|
+
#endif
|
|
38
|
+
);
|
|
31
39
|
|
|
32
40
|
#endif
|
|
33
41
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import alphahash_fragment from './ShaderChunk/alphahash_fragment.glsl.js';
|
|
2
|
+
import alphahash_pars_fragment from './ShaderChunk/alphahash_pars_fragment.glsl.js';
|
|
1
3
|
import alphamap_fragment from './ShaderChunk/alphamap_fragment.glsl.js';
|
|
2
4
|
import alphamap_pars_fragment from './ShaderChunk/alphamap_pars_fragment.glsl.js';
|
|
3
5
|
import alphatest_fragment from './ShaderChunk/alphatest_fragment.glsl.js';
|
|
@@ -24,8 +26,8 @@ import displacementmap_pars_vertex from './ShaderChunk/displacementmap_pars_vert
|
|
|
24
26
|
import displacementmap_vertex from './ShaderChunk/displacementmap_vertex.glsl.js';
|
|
25
27
|
import emissivemap_fragment from './ShaderChunk/emissivemap_fragment.glsl.js';
|
|
26
28
|
import emissivemap_pars_fragment from './ShaderChunk/emissivemap_pars_fragment.glsl.js';
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
+
import colorspace_fragment from './ShaderChunk/colorspace_fragment.glsl.js';
|
|
30
|
+
import colorspace_pars_fragment from './ShaderChunk/colorspace_pars_fragment.glsl.js';
|
|
29
31
|
import envmap_fragment from './ShaderChunk/envmap_fragment.glsl.js';
|
|
30
32
|
import envmap_common_pars_fragment from './ShaderChunk/envmap_common_pars_fragment.glsl.js';
|
|
31
33
|
import envmap_pars_fragment from './ShaderChunk/envmap_pars_fragment.glsl.js';
|
|
@@ -75,7 +77,7 @@ import clearcoat_normal_fragment_begin from './ShaderChunk/clearcoat_normal_frag
|
|
|
75
77
|
import clearcoat_normal_fragment_maps from './ShaderChunk/clearcoat_normal_fragment_maps.glsl.js';
|
|
76
78
|
import clearcoat_pars_fragment from './ShaderChunk/clearcoat_pars_fragment.glsl.js';
|
|
77
79
|
import iridescence_pars_fragment from './ShaderChunk/iridescence_pars_fragment.glsl.js';
|
|
78
|
-
import
|
|
80
|
+
import opaque_fragment from './ShaderChunk/opaque_fragment.glsl.js';
|
|
79
81
|
import packing from './ShaderChunk/packing.glsl.js';
|
|
80
82
|
import premultiplied_alpha_fragment from './ShaderChunk/premultiplied_alpha_fragment.glsl.js';
|
|
81
83
|
import project_vertex from './ShaderChunk/project_vertex.glsl.js';
|
|
@@ -121,6 +123,8 @@ import * as shadow from './ShaderLib/shadow.glsl.js';
|
|
|
121
123
|
import * as sprite from './ShaderLib/sprite.glsl.js';
|
|
122
124
|
|
|
123
125
|
export const ShaderChunk = {
|
|
126
|
+
alphahash_fragment: alphahash_fragment,
|
|
127
|
+
alphahash_pars_fragment: alphahash_pars_fragment,
|
|
124
128
|
alphamap_fragment: alphamap_fragment,
|
|
125
129
|
alphamap_pars_fragment: alphamap_pars_fragment,
|
|
126
130
|
alphatest_fragment: alphatest_fragment,
|
|
@@ -147,8 +151,8 @@ export const ShaderChunk = {
|
|
|
147
151
|
displacementmap_vertex: displacementmap_vertex,
|
|
148
152
|
emissivemap_fragment: emissivemap_fragment,
|
|
149
153
|
emissivemap_pars_fragment: emissivemap_pars_fragment,
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
colorspace_fragment: colorspace_fragment,
|
|
155
|
+
colorspace_pars_fragment: colorspace_pars_fragment,
|
|
152
156
|
envmap_fragment: envmap_fragment,
|
|
153
157
|
envmap_common_pars_fragment: envmap_common_pars_fragment,
|
|
154
158
|
envmap_pars_fragment: envmap_pars_fragment,
|
|
@@ -198,7 +202,7 @@ export const ShaderChunk = {
|
|
|
198
202
|
clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,
|
|
199
203
|
clearcoat_pars_fragment: clearcoat_pars_fragment,
|
|
200
204
|
iridescence_pars_fragment: iridescence_pars_fragment,
|
|
201
|
-
|
|
205
|
+
opaque_fragment: opaque_fragment,
|
|
202
206
|
packing: packing,
|
|
203
207
|
premultiplied_alpha_fragment: premultiplied_alpha_fragment,
|
|
204
208
|
project_vertex: project_vertex,
|
|
@@ -52,6 +52,7 @@ export const fragment = /* glsl */`
|
|
|
52
52
|
#include <map_pars_fragment>
|
|
53
53
|
#include <alphamap_pars_fragment>
|
|
54
54
|
#include <alphatest_pars_fragment>
|
|
55
|
+
#include <alphahash_pars_fragment>
|
|
55
56
|
#include <logdepthbuf_pars_fragment>
|
|
56
57
|
#include <clipping_planes_pars_fragment>
|
|
57
58
|
|
|
@@ -72,6 +73,7 @@ void main() {
|
|
|
72
73
|
#include <map_fragment>
|
|
73
74
|
#include <alphamap_fragment>
|
|
74
75
|
#include <alphatest_fragment>
|
|
76
|
+
#include <alphahash_fragment>
|
|
75
77
|
|
|
76
78
|
#include <logdepthbuf_fragment>
|
|
77
79
|
|