super-three 0.161.0 → 0.162.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/build/three.cjs +490 -393
- package/build/three.module.js +490 -391
- package/build/three.module.min.js +1 -1
- package/examples/jsm/controls/DragControls.js +91 -30
- package/examples/jsm/controls/OrbitControls.js +32 -6
- package/examples/jsm/controls/TransformControls.js +6 -6
- package/examples/jsm/exporters/GLTFExporter.js +11 -1
- package/examples/jsm/interactive/InteractiveGroup.js +15 -25
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +1 -8723
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +1 -8734
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/tween.module.js +32 -14
- package/examples/jsm/loaders/3DMLoader.js +13 -21
- package/examples/jsm/loaders/VOXLoader.js +9 -2
- package/examples/jsm/loaders/VRMLLoader.js +6 -2
- package/examples/jsm/misc/ProgressiveLightMap.js +1 -0
- package/examples/jsm/nodes/Nodes.js +9 -7
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +10 -0
- package/examples/jsm/nodes/accessors/ClippingNode.js +144 -0
- package/examples/jsm/nodes/accessors/MaterialNode.js +2 -2
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -12
- package/examples/jsm/nodes/accessors/MorphNode.js +8 -8
- package/examples/jsm/nodes/accessors/ReferenceNode.js +87 -29
- package/examples/jsm/nodes/accessors/SkinningNode.js +31 -10
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +18 -0
- package/examples/jsm/nodes/accessors/TangentNode.js +8 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +1 -1
- package/examples/jsm/nodes/accessors/UniformsNode.js +140 -0
- package/examples/jsm/nodes/code/CodeNode.js +6 -0
- package/examples/jsm/nodes/core/AssignNode.js +68 -12
- package/examples/jsm/nodes/core/Node.js +14 -4
- package/examples/jsm/nodes/core/NodeBuilder.js +3 -9
- package/examples/jsm/nodes/core/NodeFrame.js +2 -2
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/display/BlendModeNode.js +30 -1
- package/examples/jsm/nodes/display/NormalMapNode.js +3 -5
- package/examples/jsm/nodes/materials/NodeMaterial.js +37 -6
- package/examples/jsm/nodes/math/CondNode.js +42 -7
- package/examples/jsm/nodes/math/MathNode.js +20 -0
- package/examples/jsm/nodes/utils/ArrayElementNode.js +0 -6
- package/examples/jsm/nodes/utils/LoopNode.js +2 -0
- package/examples/jsm/nodes/utils/StorageArrayElementNode.js +91 -0
- package/examples/jsm/postprocessing/OutputPass.js +2 -0
- package/examples/jsm/renderers/common/Background.js +2 -2
- package/examples/jsm/renderers/common/ClippingContext.js +165 -0
- package/examples/jsm/renderers/common/RenderContext.js +2 -0
- package/examples/jsm/renderers/common/RenderContexts.js +2 -13
- package/examples/jsm/renderers/common/RenderObject.js +44 -1
- package/examples/jsm/renderers/common/RenderObjects.js +3 -1
- package/examples/jsm/renderers/common/Renderer.js +94 -37
- package/examples/jsm/renderers/common/StorageBufferAttribute.js +2 -2
- package/examples/jsm/renderers/common/StorageInstancedBufferAttribute.js +17 -0
- package/examples/jsm/renderers/common/Textures.js +3 -13
- package/examples/jsm/renderers/common/UniformsGroup.js +6 -4
- package/examples/jsm/renderers/common/nodes/NodeStorageBuffer.js +23 -0
- package/examples/jsm/renderers/common/nodes/NodeUniformBuffer.js +23 -0
- package/examples/jsm/renderers/common/nodes/Nodes.js +1 -0
- package/examples/jsm/renderers/webgl/WebGLBackend.js +26 -6
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +135 -10
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +7 -1
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +47 -0
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +1 -0
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +13 -12
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +15 -40
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +7 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +2 -2
- package/examples/jsm/shaders/OutputShader.js +4 -0
- package/examples/jsm/utils/SkeletonUtils.js +14 -3
- package/examples/jsm/webxr/VRButton.js +13 -5
- package/examples/jsm/webxr/XRButton.js +0 -1
- package/examples/jsm/webxr/XRControllerModelFactory.js +8 -0
- package/package.json +4 -3
- package/src/Three.Legacy.js +20 -0
- package/src/Three.js +0 -1
- package/src/constants.js +2 -5
- package/src/core/BufferAttribute.js +0 -11
- package/src/core/BufferGeometry.js +23 -29
- package/src/core/Object3D.js +11 -0
- package/src/core/Raycaster.js +18 -4
- package/src/core/RenderTarget.js +44 -21
- package/src/extras/PMREMGenerator.js +2 -0
- package/src/extras/curves/EllipseCurve.js +2 -2
- package/src/helpers/SpotLightHelper.js +18 -1
- package/src/loaders/DataTextureLoader.js +0 -4
- package/src/loaders/MaterialLoader.js +1 -0
- package/src/loaders/ObjectLoader.js +2 -1
- package/src/materials/Material.js +2 -1
- package/src/materials/MeshBasicMaterial.js +3 -0
- package/src/materials/MeshLambertMaterial.js +3 -0
- package/src/materials/MeshPhongMaterial.js +3 -0
- package/src/materials/MeshStandardMaterial.js +3 -0
- package/src/math/Quaternion.js +13 -12
- package/src/math/Vector3.js +7 -7
- package/src/objects/InstancedMesh.js +53 -0
- package/src/objects/Mesh.js +0 -1
- package/src/renderers/WebGLCubeRenderTarget.js +1 -10
- package/src/renderers/WebGLRenderer.js +15 -22
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -0
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +11 -2
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +23 -0
- package/src/renderers/shaders/ShaderChunk.js +2 -0
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +3 -2
- 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/linedashed.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/points.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib.js +2 -1
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/webgl/WebGLBackground.js +18 -0
- package/src/renderers/webgl/WebGLMaterials.js +24 -1
- package/src/renderers/webgl/WebGLMorphtargets.js +15 -8
- package/src/renderers/webgl/WebGLProgram.js +12 -1
- package/src/renderers/webgl/WebGLPrograms.js +19 -16
- package/src/renderers/webgl/WebGLState.js +11 -21
- package/src/renderers/webgl/WebGLTextures.js +80 -50
- package/src/scenes/Scene.js +8 -0
- package/src/textures/Texture.js +1 -29
- package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
- package/src/renderers/WebGLMultipleRenderTargets.js +0 -82
package/build/three.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const REVISION = '
|
|
8
|
+
const REVISION = '162';
|
|
9
9
|
|
|
10
10
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
11
11
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -64,6 +64,7 @@ const CineonToneMapping = 3;
|
|
|
64
64
|
const ACESFilmicToneMapping = 4;
|
|
65
65
|
const CustomToneMapping = 5;
|
|
66
66
|
const AgXToneMapping = 6;
|
|
67
|
+
const NeutralToneMapping = 7;
|
|
67
68
|
const AttachedBindMode = 'attached';
|
|
68
69
|
const DetachedBindMode = 'detached';
|
|
69
70
|
|
|
@@ -155,10 +156,6 @@ const AdditiveAnimationBlendMode = 2501;
|
|
|
155
156
|
const TrianglesDrawMode = 0;
|
|
156
157
|
const TriangleStripDrawMode = 1;
|
|
157
158
|
const TriangleFanDrawMode = 2;
|
|
158
|
-
/** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
|
|
159
|
-
const LinearEncoding = 3000;
|
|
160
|
-
/** @deprecated Use SRGBColorSpace in three.js r152+. */
|
|
161
|
-
const sRGBEncoding = 3001;
|
|
162
159
|
const BasicDepthPacking = 3200;
|
|
163
160
|
const RGBADepthPacking = 3201;
|
|
164
161
|
const TangentSpaceNormalMap = 0;
|
|
@@ -1998,17 +1995,7 @@ class Texture extends EventDispatcher {
|
|
|
1998
1995
|
this.flipY = true;
|
|
1999
1996
|
this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
|
|
2000
1997
|
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
this.colorSpace = colorSpace;
|
|
2004
|
-
|
|
2005
|
-
} else { // @deprecated, r152
|
|
2006
|
-
|
|
2007
|
-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
|
|
2008
|
-
this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
|
|
2009
|
-
|
|
2010
|
-
}
|
|
2011
|
-
|
|
1998
|
+
this.colorSpace = colorSpace;
|
|
2012
1999
|
|
|
2013
2000
|
this.userData = {};
|
|
2014
2001
|
|
|
@@ -2247,20 +2234,6 @@ class Texture extends EventDispatcher {
|
|
|
2247
2234
|
|
|
2248
2235
|
}
|
|
2249
2236
|
|
|
2250
|
-
get encoding() { // @deprecated, r152
|
|
2251
|
-
|
|
2252
|
-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
|
|
2253
|
-
return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
|
|
2254
|
-
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
set encoding( encoding ) { // @deprecated, r152
|
|
2258
|
-
|
|
2259
|
-
warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
|
|
2260
|
-
this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
|
|
2261
|
-
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
2237
|
}
|
|
2265
2238
|
|
|
2266
2239
|
Texture.DEFAULT_IMAGE = null;
|
|
@@ -2934,14 +2907,6 @@ class RenderTarget extends EventDispatcher {
|
|
|
2934
2907
|
|
|
2935
2908
|
const image = { width: width, height: height, depth: 1 };
|
|
2936
2909
|
|
|
2937
|
-
if ( options.encoding !== undefined ) {
|
|
2938
|
-
|
|
2939
|
-
// @deprecated, r152
|
|
2940
|
-
warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' );
|
|
2941
|
-
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
|
|
2942
|
-
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
2910
|
options = Object.assign( {
|
|
2946
2911
|
generateMipmaps: false,
|
|
2947
2912
|
internalFormat: null,
|
|
@@ -2949,15 +2914,25 @@ class RenderTarget extends EventDispatcher {
|
|
|
2949
2914
|
depthBuffer: true,
|
|
2950
2915
|
stencilBuffer: false,
|
|
2951
2916
|
depthTexture: null,
|
|
2952
|
-
samples: 0
|
|
2917
|
+
samples: 0,
|
|
2918
|
+
count: 1
|
|
2953
2919
|
}, options );
|
|
2954
2920
|
|
|
2955
|
-
|
|
2956
|
-
|
|
2921
|
+
const texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
|
|
2922
|
+
|
|
2923
|
+
texture.flipY = false;
|
|
2924
|
+
texture.generateMipmaps = options.generateMipmaps;
|
|
2925
|
+
texture.internalFormat = options.internalFormat;
|
|
2926
|
+
|
|
2927
|
+
this.textures = [];
|
|
2928
|
+
|
|
2929
|
+
const count = options.count;
|
|
2930
|
+
for ( let i = 0; i < count; i ++ ) {
|
|
2957
2931
|
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2932
|
+
this.textures[ i ] = texture.clone();
|
|
2933
|
+
this.textures[ i ].isRenderTargetTexture = true;
|
|
2934
|
+
|
|
2935
|
+
}
|
|
2961
2936
|
|
|
2962
2937
|
this.depthBuffer = options.depthBuffer;
|
|
2963
2938
|
this.stencilBuffer = options.stencilBuffer;
|
|
@@ -2968,6 +2943,18 @@ class RenderTarget extends EventDispatcher {
|
|
|
2968
2943
|
|
|
2969
2944
|
}
|
|
2970
2945
|
|
|
2946
|
+
get texture() {
|
|
2947
|
+
|
|
2948
|
+
return this.textures[ 0 ];
|
|
2949
|
+
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
set texture( value ) {
|
|
2953
|
+
|
|
2954
|
+
this.textures[ 0 ] = value;
|
|
2955
|
+
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2971
2958
|
setSize( width, height, depth = 1 ) {
|
|
2972
2959
|
|
|
2973
2960
|
if ( this.width !== width || this.height !== height || this.depth !== depth ) {
|
|
@@ -2976,9 +2963,13 @@ class RenderTarget extends EventDispatcher {
|
|
|
2976
2963
|
this.height = height;
|
|
2977
2964
|
this.depth = depth;
|
|
2978
2965
|
|
|
2979
|
-
this.
|
|
2980
|
-
|
|
2981
|
-
|
|
2966
|
+
for ( let i = 0, il = this.textures.length; i < il; i ++ ) {
|
|
2967
|
+
|
|
2968
|
+
this.textures[ i ].image.width = width;
|
|
2969
|
+
this.textures[ i ].image.height = height;
|
|
2970
|
+
this.textures[ i ].image.depth = depth;
|
|
2971
|
+
|
|
2972
|
+
}
|
|
2982
2973
|
|
|
2983
2974
|
this.dispose();
|
|
2984
2975
|
|
|
@@ -3006,8 +2997,14 @@ class RenderTarget extends EventDispatcher {
|
|
|
3006
2997
|
|
|
3007
2998
|
this.viewport.copy( source.viewport );
|
|
3008
2999
|
|
|
3009
|
-
this.
|
|
3010
|
-
|
|
3000
|
+
this.textures.length = 0;
|
|
3001
|
+
|
|
3002
|
+
for ( let i = 0, il = source.textures.length; i < il; i ++ ) {
|
|
3003
|
+
|
|
3004
|
+
this.textures[ i ] = source.textures[ i ].clone();
|
|
3005
|
+
this.textures[ i ].isRenderTargetTexture = true;
|
|
3006
|
+
|
|
3007
|
+
}
|
|
3011
3008
|
|
|
3012
3009
|
// ensure image object is not shared, see #20328
|
|
3013
3010
|
|
|
@@ -3135,85 +3132,6 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
|
|
|
3135
3132
|
|
|
3136
3133
|
}
|
|
3137
3134
|
|
|
3138
|
-
class WebGLMultipleRenderTargets extends WebGLRenderTarget {
|
|
3139
|
-
|
|
3140
|
-
constructor( width = 1, height = 1, count = 1, options = {} ) {
|
|
3141
|
-
|
|
3142
|
-
super( width, height, options );
|
|
3143
|
-
|
|
3144
|
-
this.isWebGLMultipleRenderTargets = true;
|
|
3145
|
-
|
|
3146
|
-
const texture = this.texture;
|
|
3147
|
-
|
|
3148
|
-
this.texture = [];
|
|
3149
|
-
|
|
3150
|
-
for ( let i = 0; i < count; i ++ ) {
|
|
3151
|
-
|
|
3152
|
-
this.texture[ i ] = texture.clone();
|
|
3153
|
-
this.texture[ i ].isRenderTargetTexture = true;
|
|
3154
|
-
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
}
|
|
3158
|
-
|
|
3159
|
-
setSize( width, height, depth = 1 ) {
|
|
3160
|
-
|
|
3161
|
-
if ( this.width !== width || this.height !== height || this.depth !== depth ) {
|
|
3162
|
-
|
|
3163
|
-
this.width = width;
|
|
3164
|
-
this.height = height;
|
|
3165
|
-
this.depth = depth;
|
|
3166
|
-
|
|
3167
|
-
for ( let i = 0, il = this.texture.length; i < il; i ++ ) {
|
|
3168
|
-
|
|
3169
|
-
this.texture[ i ].image.width = width;
|
|
3170
|
-
this.texture[ i ].image.height = height;
|
|
3171
|
-
this.texture[ i ].image.depth = depth;
|
|
3172
|
-
|
|
3173
|
-
}
|
|
3174
|
-
|
|
3175
|
-
this.dispose();
|
|
3176
|
-
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
|
-
this.viewport.set( 0, 0, width, height );
|
|
3180
|
-
this.scissor.set( 0, 0, width, height );
|
|
3181
|
-
|
|
3182
|
-
}
|
|
3183
|
-
|
|
3184
|
-
copy( source ) {
|
|
3185
|
-
|
|
3186
|
-
this.dispose();
|
|
3187
|
-
|
|
3188
|
-
this.width = source.width;
|
|
3189
|
-
this.height = source.height;
|
|
3190
|
-
this.depth = source.depth;
|
|
3191
|
-
|
|
3192
|
-
this.scissor.copy( source.scissor );
|
|
3193
|
-
this.scissorTest = source.scissorTest;
|
|
3194
|
-
|
|
3195
|
-
this.viewport.copy( source.viewport );
|
|
3196
|
-
|
|
3197
|
-
this.depthBuffer = source.depthBuffer;
|
|
3198
|
-
this.stencilBuffer = source.stencilBuffer;
|
|
3199
|
-
|
|
3200
|
-
if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
|
|
3201
|
-
|
|
3202
|
-
this.texture.length = 0;
|
|
3203
|
-
|
|
3204
|
-
for ( let i = 0, il = source.texture.length; i < il; i ++ ) {
|
|
3205
|
-
|
|
3206
|
-
this.texture[ i ] = source.texture[ i ].clone();
|
|
3207
|
-
this.texture[ i ].isRenderTargetTexture = true;
|
|
3208
|
-
|
|
3209
|
-
}
|
|
3210
|
-
|
|
3211
|
-
return this;
|
|
3212
|
-
|
|
3213
|
-
}
|
|
3214
|
-
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
3135
|
class Quaternion {
|
|
3218
3136
|
|
|
3219
3137
|
constructor( x = 0, y = 0, z = 0, w = 1 ) {
|
|
@@ -3805,23 +3723,24 @@ class Quaternion {
|
|
|
3805
3723
|
|
|
3806
3724
|
random() {
|
|
3807
3725
|
|
|
3808
|
-
//
|
|
3809
|
-
// Note, this source uses w, x, y, z ordering,
|
|
3810
|
-
// so we swap the order below.
|
|
3726
|
+
// sets this quaternion to a uniform random unit quaternnion
|
|
3811
3727
|
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3728
|
+
// Ken Shoemake
|
|
3729
|
+
// Uniform random rotations
|
|
3730
|
+
// D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.
|
|
3815
3731
|
|
|
3816
|
-
const
|
|
3732
|
+
const theta1 = 2 * Math.PI * Math.random();
|
|
3733
|
+
const theta2 = 2 * Math.PI * Math.random();
|
|
3817
3734
|
|
|
3818
|
-
const
|
|
3735
|
+
const x0 = Math.random();
|
|
3736
|
+
const r1 = Math.sqrt( 1 - x0 );
|
|
3737
|
+
const r2 = Math.sqrt( x0 );
|
|
3819
3738
|
|
|
3820
3739
|
return this.set(
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3740
|
+
r1 * Math.sin( theta1 ),
|
|
3741
|
+
r1 * Math.cos( theta1 ),
|
|
3742
|
+
r2 * Math.sin( theta2 ),
|
|
3743
|
+
r2 * Math.cos( theta2 ),
|
|
3825
3744
|
);
|
|
3826
3745
|
|
|
3827
3746
|
}
|
|
@@ -4589,15 +4508,15 @@ class Vector3 {
|
|
|
4589
4508
|
|
|
4590
4509
|
randomDirection() {
|
|
4591
4510
|
|
|
4592
|
-
//
|
|
4511
|
+
// https://mathworld.wolfram.com/SpherePointPicking.html
|
|
4593
4512
|
|
|
4594
|
-
const
|
|
4595
|
-
const
|
|
4596
|
-
const
|
|
4513
|
+
const theta = Math.random() * Math.PI * 2;
|
|
4514
|
+
const u = Math.random() * 2 - 1;
|
|
4515
|
+
const c = Math.sqrt( 1 - u * u );
|
|
4597
4516
|
|
|
4598
|
-
this.x =
|
|
4599
|
-
this.y =
|
|
4600
|
-
this.z =
|
|
4517
|
+
this.x = c * Math.cos( theta );
|
|
4518
|
+
this.y = u;
|
|
4519
|
+
this.z = c * Math.sin( theta );
|
|
4601
4520
|
|
|
4602
4521
|
return this;
|
|
4603
4522
|
|
|
@@ -6623,25 +6542,25 @@ class Matrix4 {
|
|
|
6623
6542
|
position.z = te[ 14 ];
|
|
6624
6543
|
|
|
6625
6544
|
// scale the rotation part
|
|
6626
|
-
_m1$
|
|
6545
|
+
_m1$4.copy( this );
|
|
6627
6546
|
|
|
6628
6547
|
const invSX = 1 / sx;
|
|
6629
6548
|
const invSY = 1 / sy;
|
|
6630
6549
|
const invSZ = 1 / sz;
|
|
6631
6550
|
|
|
6632
|
-
_m1$
|
|
6633
|
-
_m1$
|
|
6634
|
-
_m1$
|
|
6551
|
+
_m1$4.elements[ 0 ] *= invSX;
|
|
6552
|
+
_m1$4.elements[ 1 ] *= invSX;
|
|
6553
|
+
_m1$4.elements[ 2 ] *= invSX;
|
|
6635
6554
|
|
|
6636
|
-
_m1$
|
|
6637
|
-
_m1$
|
|
6638
|
-
_m1$
|
|
6555
|
+
_m1$4.elements[ 4 ] *= invSY;
|
|
6556
|
+
_m1$4.elements[ 5 ] *= invSY;
|
|
6557
|
+
_m1$4.elements[ 6 ] *= invSY;
|
|
6639
6558
|
|
|
6640
|
-
_m1$
|
|
6641
|
-
_m1$
|
|
6642
|
-
_m1$
|
|
6559
|
+
_m1$4.elements[ 8 ] *= invSZ;
|
|
6560
|
+
_m1$4.elements[ 9 ] *= invSZ;
|
|
6561
|
+
_m1$4.elements[ 10 ] *= invSZ;
|
|
6643
6562
|
|
|
6644
|
-
quaternion.setFromRotationMatrix( _m1$
|
|
6563
|
+
quaternion.setFromRotationMatrix( _m1$4 );
|
|
6645
6564
|
|
|
6646
6565
|
scale.x = sx;
|
|
6647
6566
|
scale.y = sy;
|
|
@@ -6782,14 +6701,14 @@ class Matrix4 {
|
|
|
6782
6701
|
}
|
|
6783
6702
|
|
|
6784
6703
|
const _v1$5 = /*@__PURE__*/ new Vector3();
|
|
6785
|
-
const _m1$
|
|
6704
|
+
const _m1$4 = /*@__PURE__*/ new Matrix4();
|
|
6786
6705
|
const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );
|
|
6787
6706
|
const _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );
|
|
6788
6707
|
const _x = /*@__PURE__*/ new Vector3();
|
|
6789
6708
|
const _y = /*@__PURE__*/ new Vector3();
|
|
6790
6709
|
const _z = /*@__PURE__*/ new Vector3();
|
|
6791
6710
|
|
|
6792
|
-
const _matrix$
|
|
6711
|
+
const _matrix$2 = /*@__PURE__*/ new Matrix4();
|
|
6793
6712
|
const _quaternion$3 = /*@__PURE__*/ new Quaternion();
|
|
6794
6713
|
|
|
6795
6714
|
class Euler {
|
|
@@ -7024,9 +6943,9 @@ class Euler {
|
|
|
7024
6943
|
|
|
7025
6944
|
setFromQuaternion( q, order, update ) {
|
|
7026
6945
|
|
|
7027
|
-
_matrix$
|
|
6946
|
+
_matrix$2.makeRotationFromQuaternion( q );
|
|
7028
6947
|
|
|
7029
|
-
return this.setFromRotationMatrix( _matrix$
|
|
6948
|
+
return this.setFromRotationMatrix( _matrix$2, order, update );
|
|
7030
6949
|
|
|
7031
6950
|
}
|
|
7032
6951
|
|
|
@@ -7161,7 +7080,7 @@ let _object3DId = 0;
|
|
|
7161
7080
|
|
|
7162
7081
|
const _v1$4 = /*@__PURE__*/ new Vector3();
|
|
7163
7082
|
const _q1 = /*@__PURE__*/ new Quaternion();
|
|
7164
|
-
const _m1$
|
|
7083
|
+
const _m1$3 = /*@__PURE__*/ new Matrix4();
|
|
7165
7084
|
const _target = /*@__PURE__*/ new Vector3();
|
|
7166
7085
|
|
|
7167
7086
|
const _position$3 = /*@__PURE__*/ new Vector3();
|
|
@@ -7175,6 +7094,9 @@ const _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );
|
|
|
7175
7094
|
const _addedEvent = { type: 'added' };
|
|
7176
7095
|
const _removedEvent = { type: 'removed' };
|
|
7177
7096
|
|
|
7097
|
+
const _childaddedEvent = { type: 'childadded', child: null };
|
|
7098
|
+
const _childremovedEvent = { type: 'childremoved', child: null };
|
|
7099
|
+
|
|
7178
7100
|
class Object3D extends EventDispatcher {
|
|
7179
7101
|
|
|
7180
7102
|
constructor() {
|
|
@@ -7411,7 +7333,7 @@ class Object3D extends EventDispatcher {
|
|
|
7411
7333
|
|
|
7412
7334
|
this.updateWorldMatrix( true, false );
|
|
7413
7335
|
|
|
7414
|
-
return vector.applyMatrix4( _m1$
|
|
7336
|
+
return vector.applyMatrix4( _m1$3.copy( this.matrixWorld ).invert() );
|
|
7415
7337
|
|
|
7416
7338
|
}
|
|
7417
7339
|
|
|
@@ -7437,20 +7359,20 @@ class Object3D extends EventDispatcher {
|
|
|
7437
7359
|
|
|
7438
7360
|
if ( this.isCamera || this.isLight ) {
|
|
7439
7361
|
|
|
7440
|
-
_m1$
|
|
7362
|
+
_m1$3.lookAt( _position$3, _target, this.up );
|
|
7441
7363
|
|
|
7442
7364
|
} else {
|
|
7443
7365
|
|
|
7444
|
-
_m1$
|
|
7366
|
+
_m1$3.lookAt( _target, _position$3, this.up );
|
|
7445
7367
|
|
|
7446
7368
|
}
|
|
7447
7369
|
|
|
7448
|
-
this.quaternion.setFromRotationMatrix( _m1$
|
|
7370
|
+
this.quaternion.setFromRotationMatrix( _m1$3 );
|
|
7449
7371
|
|
|
7450
7372
|
if ( parent ) {
|
|
7451
7373
|
|
|
7452
|
-
_m1$
|
|
7453
|
-
_q1.setFromRotationMatrix( _m1$
|
|
7374
|
+
_m1$3.extractRotation( parent.matrixWorld );
|
|
7375
|
+
_q1.setFromRotationMatrix( _m1$3 );
|
|
7454
7376
|
this.quaternion.premultiply( _q1.invert() );
|
|
7455
7377
|
|
|
7456
7378
|
}
|
|
@@ -7491,6 +7413,10 @@ class Object3D extends EventDispatcher {
|
|
|
7491
7413
|
|
|
7492
7414
|
object.dispatchEvent( _addedEvent );
|
|
7493
7415
|
|
|
7416
|
+
_childaddedEvent.child = object;
|
|
7417
|
+
this.dispatchEvent( _childaddedEvent );
|
|
7418
|
+
_childaddedEvent.child = null;
|
|
7419
|
+
|
|
7494
7420
|
} else {
|
|
7495
7421
|
|
|
7496
7422
|
console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
|
|
@@ -7524,6 +7450,10 @@ class Object3D extends EventDispatcher {
|
|
|
7524
7450
|
|
|
7525
7451
|
object.dispatchEvent( _removedEvent );
|
|
7526
7452
|
|
|
7453
|
+
_childremovedEvent.child = object;
|
|
7454
|
+
this.dispatchEvent( _childremovedEvent );
|
|
7455
|
+
_childremovedEvent.child = null;
|
|
7456
|
+
|
|
7527
7457
|
}
|
|
7528
7458
|
|
|
7529
7459
|
return this;
|
|
@@ -7558,17 +7488,17 @@ class Object3D extends EventDispatcher {
|
|
|
7558
7488
|
|
|
7559
7489
|
this.updateWorldMatrix( true, false );
|
|
7560
7490
|
|
|
7561
|
-
_m1$
|
|
7491
|
+
_m1$3.copy( this.matrixWorld ).invert();
|
|
7562
7492
|
|
|
7563
7493
|
if ( object.parent !== null ) {
|
|
7564
7494
|
|
|
7565
7495
|
object.parent.updateWorldMatrix( true, false );
|
|
7566
7496
|
|
|
7567
|
-
_m1$
|
|
7497
|
+
_m1$3.multiply( object.parent.matrixWorld );
|
|
7568
7498
|
|
|
7569
7499
|
}
|
|
7570
7500
|
|
|
7571
|
-
object.applyMatrix4( _m1$
|
|
7501
|
+
object.applyMatrix4( _m1$3 );
|
|
7572
7502
|
|
|
7573
7503
|
this.add( object );
|
|
7574
7504
|
|
|
@@ -9268,7 +9198,7 @@ class Material extends EventDispatcher {
|
|
|
9268
9198
|
if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();
|
|
9269
9199
|
if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;
|
|
9270
9200
|
if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();
|
|
9271
|
-
if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
|
|
9201
|
+
if ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
|
|
9272
9202
|
|
|
9273
9203
|
if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();
|
|
9274
9204
|
if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;
|
|
@@ -9378,6 +9308,7 @@ class Material extends EventDispatcher {
|
|
|
9378
9308
|
|
|
9379
9309
|
}
|
|
9380
9310
|
|
|
9311
|
+
if ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();
|
|
9381
9312
|
if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
|
|
9382
9313
|
if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;
|
|
9383
9314
|
if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;
|
|
@@ -9622,6 +9553,7 @@ class MeshBasicMaterial extends Material {
|
|
|
9622
9553
|
this.alphaMap = null;
|
|
9623
9554
|
|
|
9624
9555
|
this.envMap = null;
|
|
9556
|
+
this.envMapRotation = new Euler();
|
|
9625
9557
|
this.combine = MultiplyOperation;
|
|
9626
9558
|
this.reflectivity = 1;
|
|
9627
9559
|
this.refractionRatio = 0.98;
|
|
@@ -9656,6 +9588,7 @@ class MeshBasicMaterial extends Material {
|
|
|
9656
9588
|
this.alphaMap = source.alphaMap;
|
|
9657
9589
|
|
|
9658
9590
|
this.envMap = source.envMap;
|
|
9591
|
+
this.envMapRotation.copy( source.envMapRotation );
|
|
9659
9592
|
this.combine = source.combine;
|
|
9660
9593
|
this.reflectivity = source.reflectivity;
|
|
9661
9594
|
this.refractionRatio = source.refractionRatio;
|
|
@@ -10460,19 +10393,9 @@ class Float32BufferAttribute extends BufferAttribute {
|
|
|
10460
10393
|
|
|
10461
10394
|
}
|
|
10462
10395
|
|
|
10463
|
-
class Float64BufferAttribute extends BufferAttribute {
|
|
10464
|
-
|
|
10465
|
-
constructor( array, itemSize, normalized ) {
|
|
10466
|
-
|
|
10467
|
-
super( new Float64Array( array ), itemSize, normalized );
|
|
10468
|
-
|
|
10469
|
-
}
|
|
10470
|
-
|
|
10471
|
-
}
|
|
10472
|
-
|
|
10473
10396
|
let _id$2 = 0;
|
|
10474
10397
|
|
|
10475
|
-
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
10398
|
+
const _m1$2 = /*@__PURE__*/ new Matrix4();
|
|
10476
10399
|
const _obj = /*@__PURE__*/ new Object3D();
|
|
10477
10400
|
const _offset = /*@__PURE__*/ new Vector3();
|
|
10478
10401
|
const _box$2 = /*@__PURE__*/ new Box3();
|
|
@@ -10638,9 +10561,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10638
10561
|
|
|
10639
10562
|
applyQuaternion( q ) {
|
|
10640
10563
|
|
|
10641
|
-
_m1.makeRotationFromQuaternion( q );
|
|
10564
|
+
_m1$2.makeRotationFromQuaternion( q );
|
|
10642
10565
|
|
|
10643
|
-
this.applyMatrix4( _m1 );
|
|
10566
|
+
this.applyMatrix4( _m1$2 );
|
|
10644
10567
|
|
|
10645
10568
|
return this;
|
|
10646
10569
|
|
|
@@ -10650,9 +10573,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10650
10573
|
|
|
10651
10574
|
// rotate geometry around world x-axis
|
|
10652
10575
|
|
|
10653
|
-
_m1.makeRotationX( angle );
|
|
10576
|
+
_m1$2.makeRotationX( angle );
|
|
10654
10577
|
|
|
10655
|
-
this.applyMatrix4( _m1 );
|
|
10578
|
+
this.applyMatrix4( _m1$2 );
|
|
10656
10579
|
|
|
10657
10580
|
return this;
|
|
10658
10581
|
|
|
@@ -10662,9 +10585,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10662
10585
|
|
|
10663
10586
|
// rotate geometry around world y-axis
|
|
10664
10587
|
|
|
10665
|
-
_m1.makeRotationY( angle );
|
|
10588
|
+
_m1$2.makeRotationY( angle );
|
|
10666
10589
|
|
|
10667
|
-
this.applyMatrix4( _m1 );
|
|
10590
|
+
this.applyMatrix4( _m1$2 );
|
|
10668
10591
|
|
|
10669
10592
|
return this;
|
|
10670
10593
|
|
|
@@ -10674,9 +10597,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10674
10597
|
|
|
10675
10598
|
// rotate geometry around world z-axis
|
|
10676
10599
|
|
|
10677
|
-
_m1.makeRotationZ( angle );
|
|
10600
|
+
_m1$2.makeRotationZ( angle );
|
|
10678
10601
|
|
|
10679
|
-
this.applyMatrix4( _m1 );
|
|
10602
|
+
this.applyMatrix4( _m1$2 );
|
|
10680
10603
|
|
|
10681
10604
|
return this;
|
|
10682
10605
|
|
|
@@ -10686,9 +10609,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10686
10609
|
|
|
10687
10610
|
// translate geometry
|
|
10688
10611
|
|
|
10689
|
-
_m1.makeTranslation( x, y, z );
|
|
10612
|
+
_m1$2.makeTranslation( x, y, z );
|
|
10690
10613
|
|
|
10691
|
-
this.applyMatrix4( _m1 );
|
|
10614
|
+
this.applyMatrix4( _m1$2 );
|
|
10692
10615
|
|
|
10693
10616
|
return this;
|
|
10694
10617
|
|
|
@@ -10698,9 +10621,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10698
10621
|
|
|
10699
10622
|
// scale geometry
|
|
10700
10623
|
|
|
10701
|
-
_m1.makeScale( x, y, z );
|
|
10624
|
+
_m1$2.makeScale( x, y, z );
|
|
10702
10625
|
|
|
10703
|
-
this.applyMatrix4( _m1 );
|
|
10626
|
+
this.applyMatrix4( _m1$2 );
|
|
10704
10627
|
|
|
10705
10628
|
return this;
|
|
10706
10629
|
|
|
@@ -10760,7 +10683,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10760
10683
|
|
|
10761
10684
|
if ( position && position.isGLBufferAttribute ) {
|
|
10762
10685
|
|
|
10763
|
-
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.
|
|
10686
|
+
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
|
|
10764
10687
|
|
|
10765
10688
|
this.boundingBox.set(
|
|
10766
10689
|
new Vector3( - Infinity, - Infinity, - Infinity ),
|
|
@@ -10830,7 +10753,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10830
10753
|
|
|
10831
10754
|
if ( position && position.isGLBufferAttribute ) {
|
|
10832
10755
|
|
|
10833
|
-
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.
|
|
10756
|
+
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
|
|
10834
10757
|
|
|
10835
10758
|
this.boundingSphere.set( new Vector3(), Infinity );
|
|
10836
10759
|
|
|
@@ -10947,24 +10870,21 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10947
10870
|
|
|
10948
10871
|
}
|
|
10949
10872
|
|
|
10950
|
-
const
|
|
10951
|
-
const
|
|
10952
|
-
const
|
|
10953
|
-
const uvs = attributes.uv.array;
|
|
10954
|
-
|
|
10955
|
-
const nVertices = positions.length / 3;
|
|
10873
|
+
const positionAttribute = attributes.position;
|
|
10874
|
+
const normalAttribute = attributes.normal;
|
|
10875
|
+
const uvAttribute = attributes.uv;
|
|
10956
10876
|
|
|
10957
10877
|
if ( this.hasAttribute( 'tangent' ) === false ) {
|
|
10958
10878
|
|
|
10959
|
-
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 *
|
|
10879
|
+
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
|
|
10960
10880
|
|
|
10961
10881
|
}
|
|
10962
10882
|
|
|
10963
|
-
const
|
|
10883
|
+
const tangentAttribute = this.getAttribute( 'tangent' );
|
|
10964
10884
|
|
|
10965
10885
|
const tan1 = [], tan2 = [];
|
|
10966
10886
|
|
|
10967
|
-
for ( let i = 0; i <
|
|
10887
|
+
for ( let i = 0; i < positionAttribute.count; i ++ ) {
|
|
10968
10888
|
|
|
10969
10889
|
tan1[ i ] = new Vector3();
|
|
10970
10890
|
tan2[ i ] = new Vector3();
|
|
@@ -10984,13 +10904,13 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10984
10904
|
|
|
10985
10905
|
function handleTriangle( a, b, c ) {
|
|
10986
10906
|
|
|
10987
|
-
vA.
|
|
10988
|
-
vB.
|
|
10989
|
-
vC.
|
|
10907
|
+
vA.fromBufferAttribute( positionAttribute, a );
|
|
10908
|
+
vB.fromBufferAttribute( positionAttribute, b );
|
|
10909
|
+
vC.fromBufferAttribute( positionAttribute, c );
|
|
10990
10910
|
|
|
10991
|
-
uvA.
|
|
10992
|
-
uvB.
|
|
10993
|
-
uvC.
|
|
10911
|
+
uvA.fromBufferAttribute( uvAttribute, a );
|
|
10912
|
+
uvB.fromBufferAttribute( uvAttribute, b );
|
|
10913
|
+
uvC.fromBufferAttribute( uvAttribute, c );
|
|
10994
10914
|
|
|
10995
10915
|
vB.sub( vA );
|
|
10996
10916
|
vC.sub( vA );
|
|
@@ -11023,7 +10943,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11023
10943
|
|
|
11024
10944
|
groups = [ {
|
|
11025
10945
|
start: 0,
|
|
11026
|
-
count:
|
|
10946
|
+
count: index.count
|
|
11027
10947
|
} ];
|
|
11028
10948
|
|
|
11029
10949
|
}
|
|
@@ -11038,9 +10958,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11038
10958
|
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
|
|
11039
10959
|
|
|
11040
10960
|
handleTriangle(
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
10961
|
+
index.getX( j + 0 ),
|
|
10962
|
+
index.getX( j + 1 ),
|
|
10963
|
+
index.getX( j + 2 )
|
|
11044
10964
|
);
|
|
11045
10965
|
|
|
11046
10966
|
}
|
|
@@ -11052,7 +10972,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11052
10972
|
|
|
11053
10973
|
function handleVertex( v ) {
|
|
11054
10974
|
|
|
11055
|
-
n.
|
|
10975
|
+
n.fromBufferAttribute( normalAttribute, v );
|
|
11056
10976
|
n2.copy( n );
|
|
11057
10977
|
|
|
11058
10978
|
const t = tan1[ v ];
|
|
@@ -11068,10 +10988,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11068
10988
|
const test = tmp2.dot( tan2[ v ] );
|
|
11069
10989
|
const w = ( test < 0.0 ) ? - 1.0 : 1.0;
|
|
11070
10990
|
|
|
11071
|
-
|
|
11072
|
-
tangents[ v * 4 + 1 ] = tmp.y;
|
|
11073
|
-
tangents[ v * 4 + 2 ] = tmp.z;
|
|
11074
|
-
tangents[ v * 4 + 3 ] = w;
|
|
10991
|
+
tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
|
|
11075
10992
|
|
|
11076
10993
|
}
|
|
11077
10994
|
|
|
@@ -11084,9 +11001,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11084
11001
|
|
|
11085
11002
|
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
|
|
11086
11003
|
|
|
11087
|
-
handleVertex(
|
|
11088
|
-
handleVertex(
|
|
11089
|
-
handleVertex(
|
|
11004
|
+
handleVertex( index.getX( j + 0 ) );
|
|
11005
|
+
handleVertex( index.getX( j + 1 ) );
|
|
11006
|
+
handleVertex( index.getX( j + 2 ) );
|
|
11090
11007
|
|
|
11091
11008
|
}
|
|
11092
11009
|
|
|
@@ -11915,7 +11832,6 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
|
|
|
11915
11832
|
_uvC$1.fromBufferAttribute( uv1, c );
|
|
11916
11833
|
|
|
11917
11834
|
intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
|
|
11918
|
-
intersection.uv2 = intersection.uv1; // @deprecated, r152
|
|
11919
11835
|
|
|
11920
11836
|
}
|
|
11921
11837
|
|
|
@@ -12949,14 +12865,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
|
|
|
12949
12865
|
const image = { width: size, height: size, depth: 1 };
|
|
12950
12866
|
const images = [ image, image, image, image, image, image ];
|
|
12951
12867
|
|
|
12952
|
-
if ( options.encoding !== undefined ) {
|
|
12953
|
-
|
|
12954
|
-
// @deprecated, r152
|
|
12955
|
-
warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
|
|
12956
|
-
options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
|
|
12957
|
-
|
|
12958
|
-
}
|
|
12959
|
-
|
|
12960
12868
|
this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
|
|
12961
12869
|
|
|
12962
12870
|
// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
|
|
@@ -13899,9 +13807,9 @@ var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
|
|
|
13899
13807
|
|
|
13900
13808
|
var colorspace_pars_fragment = "\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}";
|
|
13901
13809
|
|
|
13902
|
-
var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
|
|
13810
|
+
var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
|
|
13903
13811
|
|
|
13904
|
-
var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
|
|
13812
|
+
var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
|
|
13905
13813
|
|
|
13906
13814
|
var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";
|
|
13907
13815
|
|
|
@@ -13929,7 +13837,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
|
|
|
13929
13837
|
|
|
13930
13838
|
var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
|
|
13931
13839
|
|
|
13932
|
-
var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
|
|
13840
|
+
var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
|
|
13933
13841
|
|
|
13934
13842
|
var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
|
|
13935
13843
|
|
|
@@ -13969,11 +13877,13 @@ var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_META
|
|
|
13969
13877
|
|
|
13970
13878
|
var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";
|
|
13971
13879
|
|
|
13880
|
+
var morphinstance_vertex = "#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif";
|
|
13881
|
+
|
|
13972
13882
|
var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif";
|
|
13973
13883
|
|
|
13974
13884
|
var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif";
|
|
13975
13885
|
|
|
13976
|
-
var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";
|
|
13886
|
+
var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";
|
|
13977
13887
|
|
|
13978
13888
|
var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";
|
|
13979
13889
|
|
|
@@ -14035,7 +13945,7 @@ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D spe
|
|
|
14035
13945
|
|
|
14036
13946
|
var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
|
|
14037
13947
|
|
|
14038
|
-
var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
|
|
13948
|
+
var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
|
|
14039
13949
|
|
|
14040
13950
|
var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif";
|
|
14041
13951
|
|
|
@@ -14055,17 +13965,17 @@ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\n
|
|
|
14055
13965
|
|
|
14056
13966
|
const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
14057
13967
|
|
|
14058
|
-
const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13968
|
+
const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
14059
13969
|
|
|
14060
13970
|
const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
14061
13971
|
|
|
14062
13972
|
const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
14063
13973
|
|
|
14064
|
-
const vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
|
|
13974
|
+
const vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
|
|
14065
13975
|
|
|
14066
13976
|
const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
|
|
14067
13977
|
|
|
14068
|
-
const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
|
|
13978
|
+
const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
|
|
14069
13979
|
|
|
14070
13980
|
const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
|
|
14071
13981
|
|
|
@@ -14073,43 +13983,43 @@ const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main()
|
|
|
14073
13983
|
|
|
14074
13984
|
const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
14075
13985
|
|
|
14076
|
-
const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
|
|
13986
|
+
const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
|
|
14077
13987
|
|
|
14078
13988
|
const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
|
|
14079
13989
|
|
|
14080
|
-
const vertex$a = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13990
|
+
const vertex$a = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14081
13991
|
|
|
14082
13992
|
const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14083
13993
|
|
|
14084
|
-
const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
13994
|
+
const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14085
13995
|
|
|
14086
13996
|
const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14087
13997
|
|
|
14088
|
-
const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
|
|
13998
|
+
const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
|
|
14089
13999
|
|
|
14090
14000
|
const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14091
14001
|
|
|
14092
|
-
const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
|
|
14002
|
+
const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
|
|
14093
14003
|
|
|
14094
14004
|
const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";
|
|
14095
14005
|
|
|
14096
|
-
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14006
|
+
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14097
14007
|
|
|
14098
14008
|
const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14099
14009
|
|
|
14100
|
-
const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
|
|
14010
|
+
const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
|
|
14101
14011
|
|
|
14102
14012
|
const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14103
14013
|
|
|
14104
|
-
const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14014
|
+
const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14105
14015
|
|
|
14106
14016
|
const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
|
|
14107
14017
|
|
|
14108
|
-
const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
|
|
14018
|
+
const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
|
|
14109
14019
|
|
|
14110
14020
|
const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
|
|
14111
14021
|
|
|
14112
|
-
const vertex$2 = "#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14022
|
+
const vertex$2 = "#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
14113
14023
|
|
|
14114
14024
|
const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
|
|
14115
14025
|
|
|
@@ -14185,6 +14095,7 @@ const ShaderChunk = {
|
|
|
14185
14095
|
map_particle_pars_fragment: map_particle_pars_fragment,
|
|
14186
14096
|
metalnessmap_fragment: metalnessmap_fragment,
|
|
14187
14097
|
metalnessmap_pars_fragment: metalnessmap_pars_fragment,
|
|
14098
|
+
morphinstance_vertex: morphinstance_vertex,
|
|
14188
14099
|
morphcolor_vertex: morphcolor_vertex,
|
|
14189
14100
|
morphnormal_vertex: morphnormal_vertex,
|
|
14190
14101
|
morphtarget_pars_vertex: morphtarget_pars_vertex,
|
|
@@ -14293,6 +14204,7 @@ const UniformsLib = {
|
|
|
14293
14204
|
envmap: {
|
|
14294
14205
|
|
|
14295
14206
|
envMap: { value: null },
|
|
14207
|
+
envMapRotation: { value: /*@__PURE__*/ new Matrix3() },
|
|
14296
14208
|
flipEnvMap: { value: - 1 },
|
|
14297
14209
|
reflectivity: { value: 1.0 }, // basic, lambert, phong
|
|
14298
14210
|
ior: { value: 1.5 }, // physical
|
|
@@ -14713,7 +14625,8 @@ const ShaderLib = {
|
|
|
14713
14625
|
envMap: { value: null },
|
|
14714
14626
|
flipEnvMap: { value: - 1 },
|
|
14715
14627
|
backgroundBlurriness: { value: 0 },
|
|
14716
|
-
backgroundIntensity: { value: 1 }
|
|
14628
|
+
backgroundIntensity: { value: 1 },
|
|
14629
|
+
backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
|
|
14717
14630
|
},
|
|
14718
14631
|
|
|
14719
14632
|
vertexShader: ShaderChunk.backgroundCube_vert,
|
|
@@ -14837,6 +14750,8 @@ ShaderLib.physical = {
|
|
|
14837
14750
|
};
|
|
14838
14751
|
|
|
14839
14752
|
const _rgb = { r: 0, b: 0, g: 0 };
|
|
14753
|
+
const _e1$1 = /*@__PURE__*/ new Euler();
|
|
14754
|
+
const _m1$1 = /*@__PURE__*/ new Matrix4();
|
|
14840
14755
|
|
|
14841
14756
|
function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
|
|
14842
14757
|
|
|
@@ -14933,10 +14848,24 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
14933
14848
|
|
|
14934
14849
|
}
|
|
14935
14850
|
|
|
14851
|
+
_e1$1.copy( scene.backgroundRotation );
|
|
14852
|
+
|
|
14853
|
+
// accommodate left-handed frame
|
|
14854
|
+
_e1$1.x *= - 1; _e1$1.y *= - 1; _e1$1.z *= - 1;
|
|
14855
|
+
|
|
14856
|
+
if ( background.isCubeTexture && background.isRenderTargetTexture === false ) {
|
|
14857
|
+
|
|
14858
|
+
// environment maps which are not cube render targets or PMREMs follow a different convention
|
|
14859
|
+
_e1$1.y *= - 1;
|
|
14860
|
+
_e1$1.z *= - 1;
|
|
14861
|
+
|
|
14862
|
+
}
|
|
14863
|
+
|
|
14936
14864
|
boxMesh.material.uniforms.envMap.value = background;
|
|
14937
14865
|
boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
|
|
14938
14866
|
boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
|
|
14939
14867
|
boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
|
|
14868
|
+
boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );
|
|
14940
14869
|
boxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;
|
|
14941
14870
|
|
|
14942
14871
|
if ( currentBackground !== background ||
|
|
@@ -16401,6 +16330,7 @@ class PMREMGenerator {
|
|
|
16401
16330
|
* Generates a PMREM from an equirectangular texture, which can be either LDR
|
|
16402
16331
|
* or HDR. The ideal input image size is 1k (1024 x 512),
|
|
16403
16332
|
* as this matches best with the 256 x 256 cubemap output.
|
|
16333
|
+
* The smallest supported equirectangular image size is 64 x 32.
|
|
16404
16334
|
*/
|
|
16405
16335
|
fromEquirectangular( equirectangular, renderTarget = null ) {
|
|
16406
16336
|
|
|
@@ -16412,6 +16342,7 @@ class PMREMGenerator {
|
|
|
16412
16342
|
* Generates a PMREM from an cubemap texture, which can be either LDR
|
|
16413
16343
|
* or HDR. The ideal input cube size is 256 x 256,
|
|
16414
16344
|
* as this matches best with the 256 x 256 cubemap output.
|
|
16345
|
+
* The smallest supported cube size is 16 x 16.
|
|
16415
16346
|
*/
|
|
16416
16347
|
fromCubemap( cubemap, renderTarget = null ) {
|
|
16417
16348
|
|
|
@@ -17919,24 +17850,31 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
|
17919
17850
|
}
|
|
17920
17851
|
|
|
17921
17852
|
//
|
|
17853
|
+
if ( object.isInstancedMesh === true && object.morphTexture !== null ) {
|
|
17922
17854
|
|
|
17923
|
-
|
|
17855
|
+
program.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );
|
|
17924
17856
|
|
|
17925
|
-
|
|
17857
|
+
} else {
|
|
17926
17858
|
|
|
17927
|
-
morphInfluencesSum
|
|
17859
|
+
let morphInfluencesSum = 0;
|
|
17928
17860
|
|
|
17929
|
-
|
|
17861
|
+
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
17930
17862
|
|
|
17931
|
-
|
|
17863
|
+
morphInfluencesSum += objectInfluences[ i ];
|
|
17932
17864
|
|
|
17933
|
-
|
|
17934
|
-
|
|
17865
|
+
}
|
|
17866
|
+
|
|
17867
|
+
const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
|
|
17868
|
+
|
|
17869
|
+
|
|
17870
|
+
program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
|
|
17871
|
+
program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
|
|
17872
|
+
|
|
17873
|
+
}
|
|
17935
17874
|
|
|
17936
17875
|
program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );
|
|
17937
17876
|
program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );
|
|
17938
17877
|
|
|
17939
|
-
|
|
17940
17878
|
} else {
|
|
17941
17879
|
|
|
17942
17880
|
// When object doesn't have morph target influences defined, we treat it as a 0-length array
|
|
@@ -19582,6 +19520,10 @@ function getToneMappingFunction( functionName, toneMapping ) {
|
|
|
19582
19520
|
toneMappingName = 'AgX';
|
|
19583
19521
|
break;
|
|
19584
19522
|
|
|
19523
|
+
case NeutralToneMapping:
|
|
19524
|
+
toneMappingName = 'Neutral';
|
|
19525
|
+
break;
|
|
19526
|
+
|
|
19585
19527
|
case CustomToneMapping:
|
|
19586
19528
|
toneMappingName = 'Custom';
|
|
19587
19529
|
break;
|
|
@@ -20007,6 +19949,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
20007
19949
|
parameters.batching ? '#define USE_BATCHING' : '',
|
|
20008
19950
|
parameters.instancing ? '#define USE_INSTANCING' : '',
|
|
20009
19951
|
parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',
|
|
19952
|
+
parameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',
|
|
20010
19953
|
|
|
20011
19954
|
parameters.useFog && parameters.fog ? '#define USE_FOG' : '',
|
|
20012
19955
|
parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',
|
|
@@ -20138,6 +20081,12 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
20138
20081
|
|
|
20139
20082
|
'#endif',
|
|
20140
20083
|
|
|
20084
|
+
'#ifdef USE_INSTANCING_MORPH',
|
|
20085
|
+
|
|
20086
|
+
' uniform sampler2D morphTexture;',
|
|
20087
|
+
|
|
20088
|
+
'#endif',
|
|
20089
|
+
|
|
20141
20090
|
'attribute vec3 position;',
|
|
20142
20091
|
'attribute vec3 normal;',
|
|
20143
20092
|
'attribute vec2 uv;',
|
|
@@ -20929,6 +20878,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20929
20878
|
batching: IS_BATCHEDMESH,
|
|
20930
20879
|
instancing: IS_INSTANCEDMESH,
|
|
20931
20880
|
instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
|
|
20881
|
+
instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
|
|
20932
20882
|
|
|
20933
20883
|
supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
|
|
20934
20884
|
numMultiviewViews: numMultiviewViews,
|
|
@@ -21216,38 +21166,40 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
21216
21166
|
_programLayers.enable( 2 );
|
|
21217
21167
|
if ( parameters.instancingColor )
|
|
21218
21168
|
_programLayers.enable( 3 );
|
|
21219
|
-
if ( parameters.
|
|
21169
|
+
if ( parameters.instancingMorph )
|
|
21220
21170
|
_programLayers.enable( 4 );
|
|
21221
|
-
if ( parameters.
|
|
21171
|
+
if ( parameters.matcap )
|
|
21222
21172
|
_programLayers.enable( 5 );
|
|
21223
|
-
if ( parameters.
|
|
21173
|
+
if ( parameters.envMap )
|
|
21224
21174
|
_programLayers.enable( 6 );
|
|
21225
|
-
if ( parameters.
|
|
21175
|
+
if ( parameters.normalMapObjectSpace )
|
|
21226
21176
|
_programLayers.enable( 7 );
|
|
21227
|
-
if ( parameters.
|
|
21177
|
+
if ( parameters.normalMapTangentSpace )
|
|
21228
21178
|
_programLayers.enable( 8 );
|
|
21229
|
-
if ( parameters.
|
|
21179
|
+
if ( parameters.clearcoat )
|
|
21230
21180
|
_programLayers.enable( 9 );
|
|
21231
|
-
if ( parameters.
|
|
21181
|
+
if ( parameters.iridescence )
|
|
21232
21182
|
_programLayers.enable( 10 );
|
|
21233
|
-
if ( parameters.
|
|
21183
|
+
if ( parameters.alphaTest )
|
|
21234
21184
|
_programLayers.enable( 11 );
|
|
21235
|
-
if ( parameters.
|
|
21185
|
+
if ( parameters.vertexColors )
|
|
21236
21186
|
_programLayers.enable( 12 );
|
|
21237
|
-
if ( parameters.
|
|
21187
|
+
if ( parameters.vertexAlphas )
|
|
21238
21188
|
_programLayers.enable( 13 );
|
|
21239
|
-
if ( parameters.
|
|
21189
|
+
if ( parameters.vertexUv1s )
|
|
21240
21190
|
_programLayers.enable( 14 );
|
|
21241
|
-
if ( parameters.
|
|
21191
|
+
if ( parameters.vertexUv2s )
|
|
21242
21192
|
_programLayers.enable( 15 );
|
|
21243
|
-
if ( parameters.
|
|
21193
|
+
if ( parameters.vertexUv3s )
|
|
21244
21194
|
_programLayers.enable( 16 );
|
|
21245
|
-
if ( parameters.
|
|
21195
|
+
if ( parameters.vertexTangents )
|
|
21246
21196
|
_programLayers.enable( 17 );
|
|
21247
|
-
if ( parameters.
|
|
21197
|
+
if ( parameters.anisotropy )
|
|
21248
21198
|
_programLayers.enable( 18 );
|
|
21249
|
-
if ( parameters.
|
|
21199
|
+
if ( parameters.alphaHash )
|
|
21250
21200
|
_programLayers.enable( 19 );
|
|
21201
|
+
if ( parameters.batching )
|
|
21202
|
+
_programLayers.enable( 20 );
|
|
21251
21203
|
|
|
21252
21204
|
array.push( _programLayers.mask );
|
|
21253
21205
|
_programLayers.disableAll();
|
|
@@ -23354,33 +23306,19 @@ function WebGLState( gl, extensions, capabilities ) {
|
|
|
23354
23306
|
|
|
23355
23307
|
}
|
|
23356
23308
|
|
|
23357
|
-
|
|
23309
|
+
const textures = renderTarget.textures;
|
|
23358
23310
|
|
|
23359
|
-
|
|
23311
|
+
if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
|
|
23360
23312
|
|
|
23361
|
-
|
|
23313
|
+
for ( let i = 0, il = textures.length; i < il; i ++ ) {
|
|
23362
23314
|
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
|
|
23366
|
-
|
|
23367
|
-
}
|
|
23368
|
-
|
|
23369
|
-
drawBuffers.length = textures.length;
|
|
23370
|
-
|
|
23371
|
-
needsUpdate = true;
|
|
23315
|
+
drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
|
|
23372
23316
|
|
|
23373
23317
|
}
|
|
23374
23318
|
|
|
23375
|
-
|
|
23319
|
+
drawBuffers.length = textures.length;
|
|
23376
23320
|
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0;
|
|
23380
|
-
|
|
23381
|
-
needsUpdate = true;
|
|
23382
|
-
|
|
23383
|
-
}
|
|
23321
|
+
needsUpdate = true;
|
|
23384
23322
|
|
|
23385
23323
|
}
|
|
23386
23324
|
|
|
@@ -23402,10 +23340,14 @@ function WebGLState( gl, extensions, capabilities ) {
|
|
|
23402
23340
|
|
|
23403
23341
|
gl.drawBuffers( drawBuffers );
|
|
23404
23342
|
|
|
23405
|
-
} else {
|
|
23343
|
+
} else if ( extensions.has( 'WEBGL_draw_buffers' ) === true ) {
|
|
23406
23344
|
|
|
23407
23345
|
extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers );
|
|
23408
23346
|
|
|
23347
|
+
} else {
|
|
23348
|
+
|
|
23349
|
+
throw new Error( 'THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension' );
|
|
23350
|
+
|
|
23409
23351
|
}
|
|
23410
23352
|
|
|
23411
23353
|
}
|
|
@@ -24193,6 +24135,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24193
24135
|
const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
|
|
24194
24136
|
const multiviewExt = extensions.has( 'OCULUS_multiview' ) ? extensions.get( 'OCULUS_multiview' ) : null;
|
|
24195
24137
|
|
|
24138
|
+
const _imageDimensions = new Vector2();
|
|
24196
24139
|
const _videoTextures = new WeakMap();
|
|
24197
24140
|
let _canvas;
|
|
24198
24141
|
|
|
@@ -24233,11 +24176,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24233
24176
|
|
|
24234
24177
|
let scale = 1;
|
|
24235
24178
|
|
|
24179
|
+
const dimensions = getDimensions( image );
|
|
24180
|
+
|
|
24236
24181
|
// handle case if texture exceeds max size
|
|
24237
24182
|
|
|
24238
|
-
if (
|
|
24183
|
+
if ( dimensions.width > maxSize || dimensions.height > maxSize ) {
|
|
24239
24184
|
|
|
24240
|
-
scale = maxSize / Math.max(
|
|
24185
|
+
scale = maxSize / Math.max( dimensions.width, dimensions.height );
|
|
24241
24186
|
|
|
24242
24187
|
}
|
|
24243
24188
|
|
|
@@ -24249,12 +24194,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24249
24194
|
|
|
24250
24195
|
if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
|
|
24251
24196
|
( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
|
|
24252
|
-
( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap )
|
|
24197
|
+
( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||
|
|
24198
|
+
( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {
|
|
24253
24199
|
|
|
24254
24200
|
const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;
|
|
24255
24201
|
|
|
24256
|
-
const width = floor( scale *
|
|
24257
|
-
const height = floor( scale *
|
|
24202
|
+
const width = floor( scale * dimensions.width );
|
|
24203
|
+
const height = floor( scale * dimensions.height );
|
|
24258
24204
|
|
|
24259
24205
|
if ( _canvas === undefined ) _canvas = createCanvas( width, height );
|
|
24260
24206
|
|
|
@@ -24268,7 +24214,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24268
24214
|
const context = canvas.getContext( '2d' );
|
|
24269
24215
|
context.drawImage( image, 0, 0, width, height );
|
|
24270
24216
|
|
|
24271
|
-
console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' +
|
|
24217
|
+
console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );
|
|
24272
24218
|
|
|
24273
24219
|
return canvas;
|
|
24274
24220
|
|
|
@@ -24276,7 +24222,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24276
24222
|
|
|
24277
24223
|
if ( 'data' in image ) {
|
|
24278
24224
|
|
|
24279
|
-
console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' +
|
|
24225
|
+
console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );
|
|
24280
24226
|
|
|
24281
24227
|
}
|
|
24282
24228
|
|
|
@@ -24292,7 +24238,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24292
24238
|
|
|
24293
24239
|
function isPowerOfTwo$1( image ) {
|
|
24294
24240
|
|
|
24295
|
-
|
|
24241
|
+
const dimensions = getDimensions( image );
|
|
24242
|
+
|
|
24243
|
+
return isPowerOfTwo( dimensions.width ) && isPowerOfTwo( dimensions.height );
|
|
24296
24244
|
|
|
24297
24245
|
}
|
|
24298
24246
|
|
|
@@ -24359,6 +24307,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24359
24307
|
|
|
24360
24308
|
}
|
|
24361
24309
|
|
|
24310
|
+
if ( glFormat === _gl.RG_INTEGER ) {
|
|
24311
|
+
|
|
24312
|
+
if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;
|
|
24313
|
+
if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;
|
|
24314
|
+
if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;
|
|
24315
|
+
if ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;
|
|
24316
|
+
if ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;
|
|
24317
|
+
if ( glType === _gl.INT ) internalFormat = _gl.RG32I;
|
|
24318
|
+
|
|
24319
|
+
}
|
|
24320
|
+
|
|
24362
24321
|
if ( glFormat === _gl.RGBA ) {
|
|
24363
24322
|
|
|
24364
24323
|
const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );
|
|
@@ -24506,18 +24465,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24506
24465
|
|
|
24507
24466
|
function deallocateRenderTarget( renderTarget ) {
|
|
24508
24467
|
|
|
24509
|
-
const texture = renderTarget.texture;
|
|
24510
|
-
|
|
24511
24468
|
const renderTargetProperties = properties.get( renderTarget );
|
|
24512
|
-
const textureProperties = properties.get( texture );
|
|
24513
|
-
|
|
24514
|
-
if ( textureProperties.__webglTexture !== undefined ) {
|
|
24515
|
-
|
|
24516
|
-
_gl.deleteTexture( textureProperties.__webglTexture );
|
|
24517
|
-
|
|
24518
|
-
info.memory.textures --;
|
|
24519
|
-
|
|
24520
|
-
}
|
|
24521
24469
|
|
|
24522
24470
|
if ( renderTarget.depthTexture ) {
|
|
24523
24471
|
|
|
@@ -24572,27 +24520,24 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24572
24520
|
|
|
24573
24521
|
}
|
|
24574
24522
|
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
for ( let i = 0, il = texture.length; i < il; i ++ ) {
|
|
24578
|
-
|
|
24579
|
-
const attachmentProperties = properties.get( texture[ i ] );
|
|
24523
|
+
const textures = renderTarget.textures;
|
|
24580
24524
|
|
|
24581
|
-
|
|
24525
|
+
for ( let i = 0, il = textures.length; i < il; i ++ ) {
|
|
24582
24526
|
|
|
24583
|
-
|
|
24527
|
+
const attachmentProperties = properties.get( textures[ i ] );
|
|
24584
24528
|
|
|
24585
|
-
|
|
24529
|
+
if ( attachmentProperties.__webglTexture ) {
|
|
24586
24530
|
|
|
24587
|
-
|
|
24531
|
+
_gl.deleteTexture( attachmentProperties.__webglTexture );
|
|
24588
24532
|
|
|
24589
|
-
|
|
24533
|
+
info.memory.textures --;
|
|
24590
24534
|
|
|
24591
24535
|
}
|
|
24592
24536
|
|
|
24537
|
+
properties.remove( textures[ i ] );
|
|
24538
|
+
|
|
24593
24539
|
}
|
|
24594
24540
|
|
|
24595
|
-
properties.remove( texture );
|
|
24596
24541
|
properties.remove( renderTarget );
|
|
24597
24542
|
|
|
24598
24543
|
}
|
|
@@ -24815,8 +24760,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24815
24760
|
|
|
24816
24761
|
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
|
|
24817
24762
|
|
|
24818
|
-
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|
|
24819
|
-
|
|
24820
24763
|
if ( texture.magFilter === NearestFilter ) return;
|
|
24821
24764
|
if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;
|
|
24822
24765
|
if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
|
|
@@ -24824,6 +24767,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
24824
24767
|
|
|
24825
24768
|
if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {
|
|
24826
24769
|
|
|
24770
|
+
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|
|
24827
24771
|
_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );
|
|
24828
24772
|
properties.get( texture ).__currentAnisotropy = texture.anisotropy;
|
|
24829
24773
|
|
|
@@ -25344,7 +25288,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25344
25288
|
|
|
25345
25289
|
if ( useTexStorage && allocateMemory ) {
|
|
25346
25290
|
|
|
25347
|
-
|
|
25291
|
+
const dimensions = getDimensions( mipmaps[ 0 ] );
|
|
25292
|
+
|
|
25293
|
+
state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
|
|
25348
25294
|
|
|
25349
25295
|
}
|
|
25350
25296
|
|
|
@@ -25376,7 +25322,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25376
25322
|
|
|
25377
25323
|
if ( allocateMemory ) {
|
|
25378
25324
|
|
|
25379
|
-
|
|
25325
|
+
const dimensions = getDimensions( image );
|
|
25326
|
+
|
|
25327
|
+
state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
|
|
25380
25328
|
|
|
25381
25329
|
}
|
|
25382
25330
|
|
|
@@ -25547,7 +25495,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25547
25495
|
|
|
25548
25496
|
if ( mipmaps.length > 0 ) levels ++;
|
|
25549
25497
|
|
|
25550
|
-
|
|
25498
|
+
const dimensions = getDimensions( cubeImage[ 0 ] );
|
|
25499
|
+
|
|
25500
|
+
state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );
|
|
25551
25501
|
|
|
25552
25502
|
}
|
|
25553
25503
|
|
|
@@ -25837,7 +25787,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
25837
25787
|
|
|
25838
25788
|
} else {
|
|
25839
25789
|
|
|
25840
|
-
const textures = renderTarget.
|
|
25790
|
+
const textures = renderTarget.textures;
|
|
25841
25791
|
|
|
25842
25792
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
25843
25793
|
|
|
@@ -26049,7 +25999,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26049
25999
|
|
|
26050
26000
|
renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
|
|
26051
26001
|
|
|
26052
|
-
|
|
26002
|
+
const textures = renderTarget.textures;
|
|
26003
|
+
|
|
26004
|
+
const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
|
|
26005
|
+
const isMultipleRenderTargets = ( textures.length > 1 );
|
|
26006
|
+
const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
|
|
26007
|
+
|
|
26008
|
+
if ( ! isMultipleRenderTargets ) {
|
|
26053
26009
|
|
|
26054
26010
|
if ( textureProperties.__webglTexture === undefined ) {
|
|
26055
26011
|
|
|
@@ -26062,10 +26018,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26062
26018
|
|
|
26063
26019
|
}
|
|
26064
26020
|
|
|
26065
|
-
const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
|
|
26066
|
-
const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
|
|
26067
|
-
const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
|
|
26068
|
-
|
|
26069
26021
|
// Setup framebuffer
|
|
26070
26022
|
|
|
26071
26023
|
if ( isCube ) {
|
|
@@ -26114,8 +26066,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26114
26066
|
|
|
26115
26067
|
if ( capabilities.drawBuffers ) {
|
|
26116
26068
|
|
|
26117
|
-
const textures = renderTarget.texture;
|
|
26118
|
-
|
|
26119
26069
|
for ( let i = 0, il = textures.length; i < il; i ++ ) {
|
|
26120
26070
|
|
|
26121
26071
|
const attachmentProperties = properties.get( textures[ i ] );
|
|
@@ -26140,8 +26090,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26140
26090
|
|
|
26141
26091
|
if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
|
|
26142
26092
|
|
|
26143
|
-
const textures = isMultipleRenderTargets ? texture : [ texture ];
|
|
26144
|
-
|
|
26145
26093
|
renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();
|
|
26146
26094
|
renderTargetProperties.__webglColorRenderbuffer = [];
|
|
26147
26095
|
|
|
@@ -26214,8 +26162,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26214
26162
|
|
|
26215
26163
|
} else if ( isMultipleRenderTargets ) {
|
|
26216
26164
|
|
|
26217
|
-
const textures = renderTarget.texture;
|
|
26218
|
-
|
|
26219
26165
|
for ( let i = 0, il = textures.length; i < il; i ++ ) {
|
|
26220
26166
|
|
|
26221
26167
|
const attachment = textures[ i ];
|
|
@@ -26300,7 +26246,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26300
26246
|
|
|
26301
26247
|
const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
|
|
26302
26248
|
|
|
26303
|
-
const textures = renderTarget.
|
|
26249
|
+
const textures = renderTarget.textures;
|
|
26304
26250
|
|
|
26305
26251
|
for ( let i = 0, il = textures.length; i < il; i ++ ) {
|
|
26306
26252
|
|
|
@@ -26325,14 +26271,14 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26325
26271
|
|
|
26326
26272
|
if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
|
|
26327
26273
|
|
|
26328
|
-
const textures = renderTarget.
|
|
26274
|
+
const textures = renderTarget.textures;
|
|
26329
26275
|
const width = renderTarget.width;
|
|
26330
26276
|
const height = renderTarget.height;
|
|
26331
26277
|
let mask = _gl.COLOR_BUFFER_BIT;
|
|
26332
26278
|
const invalidationArray = [];
|
|
26333
26279
|
const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
|
|
26334
26280
|
const renderTargetProperties = properties.get( renderTarget );
|
|
26335
|
-
const isMultipleRenderTargets = (
|
|
26281
|
+
const isMultipleRenderTargets = ( textures.length > 1 );
|
|
26336
26282
|
|
|
26337
26283
|
// If MRT we need to remove FBO attachments
|
|
26338
26284
|
if ( isMultipleRenderTargets ) {
|
|
@@ -26516,6 +26462,31 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
26516
26462
|
|
|
26517
26463
|
}
|
|
26518
26464
|
|
|
26465
|
+
function getDimensions( image ) {
|
|
26466
|
+
|
|
26467
|
+
if ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {
|
|
26468
|
+
|
|
26469
|
+
// if intrinsic data are not available, fallback to width/height
|
|
26470
|
+
|
|
26471
|
+
_imageDimensions.width = image.naturalWidth || image.width;
|
|
26472
|
+
_imageDimensions.height = image.naturalHeight || image.height;
|
|
26473
|
+
|
|
26474
|
+
} else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {
|
|
26475
|
+
|
|
26476
|
+
_imageDimensions.width = image.displayWidth;
|
|
26477
|
+
_imageDimensions.height = image.displayHeight;
|
|
26478
|
+
|
|
26479
|
+
} else {
|
|
26480
|
+
|
|
26481
|
+
_imageDimensions.width = image.width;
|
|
26482
|
+
_imageDimensions.height = image.height;
|
|
26483
|
+
|
|
26484
|
+
}
|
|
26485
|
+
|
|
26486
|
+
return _imageDimensions;
|
|
26487
|
+
|
|
26488
|
+
}
|
|
26489
|
+
|
|
26519
26490
|
//
|
|
26520
26491
|
|
|
26521
26492
|
this.allocateTextureUnit = allocateTextureUnit;
|
|
@@ -28731,6 +28702,9 @@ class WebXRManager extends EventDispatcher {
|
|
|
28731
28702
|
|
|
28732
28703
|
}
|
|
28733
28704
|
|
|
28705
|
+
const _e1 = /*@__PURE__*/ new Euler();
|
|
28706
|
+
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
28707
|
+
|
|
28734
28708
|
function WebGLMaterials( renderer, properties ) {
|
|
28735
28709
|
|
|
28736
28710
|
function refreshTransformUniform( map, uniform ) {
|
|
@@ -28939,12 +28913,30 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
28939
28913
|
|
|
28940
28914
|
}
|
|
28941
28915
|
|
|
28942
|
-
const
|
|
28916
|
+
const materialProperties = properties.get( material );
|
|
28917
|
+
|
|
28918
|
+
const envMap = materialProperties.envMap;
|
|
28919
|
+
const envMapRotation = materialProperties.envMapRotation;
|
|
28943
28920
|
|
|
28944
28921
|
if ( envMap ) {
|
|
28945
28922
|
|
|
28946
28923
|
uniforms.envMap.value = envMap;
|
|
28947
28924
|
|
|
28925
|
+
_e1.copy( envMapRotation );
|
|
28926
|
+
|
|
28927
|
+
// accommodate left-handed frame
|
|
28928
|
+
_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;
|
|
28929
|
+
|
|
28930
|
+
if ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {
|
|
28931
|
+
|
|
28932
|
+
// environment maps which are not cube render targets or PMREMs follow a different convention
|
|
28933
|
+
_e1.y *= - 1;
|
|
28934
|
+
_e1.z *= - 1;
|
|
28935
|
+
|
|
28936
|
+
}
|
|
28937
|
+
|
|
28938
|
+
uniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );
|
|
28939
|
+
|
|
28948
28940
|
uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;
|
|
28949
28941
|
|
|
28950
28942
|
uniforms.reflectivity.value = material.reflectivity;
|
|
@@ -30115,7 +30107,7 @@ class WebGLRenderer {
|
|
|
30115
30107
|
|
|
30116
30108
|
}
|
|
30117
30109
|
|
|
30118
|
-
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).
|
|
30110
|
+
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );
|
|
30119
30111
|
|
|
30120
30112
|
};
|
|
30121
30113
|
|
|
@@ -30137,7 +30129,7 @@ class WebGLRenderer {
|
|
|
30137
30129
|
|
|
30138
30130
|
}
|
|
30139
30131
|
|
|
30140
|
-
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).
|
|
30132
|
+
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );
|
|
30141
30133
|
|
|
30142
30134
|
};
|
|
30143
30135
|
|
|
@@ -31255,6 +31247,7 @@ class WebGLRenderer {
|
|
|
31255
31247
|
materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
31256
31248
|
materialProperties.fog = scene.fog;
|
|
31257
31249
|
materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );
|
|
31250
|
+
materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
|
|
31258
31251
|
|
|
31259
31252
|
if ( programs === undefined ) {
|
|
31260
31253
|
|
|
@@ -31367,6 +31360,7 @@ class WebGLRenderer {
|
|
|
31367
31360
|
materialProperties.batching = parameters.batching;
|
|
31368
31361
|
materialProperties.instancing = parameters.instancing;
|
|
31369
31362
|
materialProperties.instancingColor = parameters.instancingColor;
|
|
31363
|
+
materialProperties.instancingMorph = parameters.instancingMorph;
|
|
31370
31364
|
materialProperties.skinning = parameters.skinning;
|
|
31371
31365
|
materialProperties.morphTargets = parameters.morphTargets;
|
|
31372
31366
|
materialProperties.morphNormals = parameters.morphNormals;
|
|
@@ -31480,6 +31474,14 @@ class WebGLRenderer {
|
|
|
31480
31474
|
|
|
31481
31475
|
needsProgramChange = true;
|
|
31482
31476
|
|
|
31477
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {
|
|
31478
|
+
|
|
31479
|
+
needsProgramChange = true;
|
|
31480
|
+
|
|
31481
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {
|
|
31482
|
+
|
|
31483
|
+
needsProgramChange = true;
|
|
31484
|
+
|
|
31483
31485
|
} else if ( materialProperties.envMap !== envMap ) {
|
|
31484
31486
|
|
|
31485
31487
|
needsProgramChange = true;
|
|
@@ -32125,8 +32127,8 @@ class WebGLRenderer {
|
|
|
32125
32127
|
|
|
32126
32128
|
}
|
|
32127
32129
|
|
|
32128
|
-
const width = sourceBox.max.x - sourceBox.min.x
|
|
32129
|
-
const height = sourceBox.max.y - sourceBox.min.y
|
|
32130
|
+
const width = Math.round( sourceBox.max.x - sourceBox.min.x );
|
|
32131
|
+
const height = Math.round( sourceBox.max.y - sourceBox.min.y );
|
|
32130
32132
|
const depth = sourceBox.max.z - sourceBox.min.z + 1;
|
|
32131
32133
|
const glFormat = utils.convert( dstTexture.format );
|
|
32132
32134
|
const glType = utils.convert( dstTexture.type );
|
|
@@ -32173,9 +32175,8 @@ class WebGLRenderer {
|
|
|
32173
32175
|
|
|
32174
32176
|
} else {
|
|
32175
32177
|
|
|
32176
|
-
if (
|
|
32178
|
+
if ( dstTexture.isCompressedArrayTexture ) {
|
|
32177
32179
|
|
|
32178
|
-
console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
|
|
32179
32180
|
_gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
|
|
32180
32181
|
|
|
32181
32182
|
} else {
|
|
@@ -32264,20 +32265,6 @@ class WebGLRenderer {
|
|
|
32264
32265
|
|
|
32265
32266
|
}
|
|
32266
32267
|
|
|
32267
|
-
get outputEncoding() { // @deprecated, r152
|
|
32268
|
-
|
|
32269
|
-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
|
|
32270
|
-
return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
|
|
32271
|
-
|
|
32272
|
-
}
|
|
32273
|
-
|
|
32274
|
-
set outputEncoding( encoding ) { // @deprecated, r152
|
|
32275
|
-
|
|
32276
|
-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
|
|
32277
|
-
this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
|
|
32278
|
-
|
|
32279
|
-
}
|
|
32280
|
-
|
|
32281
32268
|
get useLegacyLights() { // @deprecated, r155
|
|
32282
32269
|
|
|
32283
32270
|
console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
|
|
@@ -32381,6 +32368,8 @@ class Scene extends Object3D {
|
|
|
32381
32368
|
|
|
32382
32369
|
this.backgroundBlurriness = 0;
|
|
32383
32370
|
this.backgroundIntensity = 1;
|
|
32371
|
+
this.backgroundRotation = new Euler();
|
|
32372
|
+
this.environmentRotation = new Euler();
|
|
32384
32373
|
|
|
32385
32374
|
this.overrideMaterial = null;
|
|
32386
32375
|
|
|
@@ -32402,6 +32391,8 @@ class Scene extends Object3D {
|
|
|
32402
32391
|
|
|
32403
32392
|
this.backgroundBlurriness = source.backgroundBlurriness;
|
|
32404
32393
|
this.backgroundIntensity = source.backgroundIntensity;
|
|
32394
|
+
this.backgroundRotation.copy( source.backgroundRotation );
|
|
32395
|
+
this.environmentRotation.copy( source.environmentRotation );
|
|
32405
32396
|
|
|
32406
32397
|
if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
|
|
32407
32398
|
|
|
@@ -32419,6 +32410,9 @@ class Scene extends Object3D {
|
|
|
32419
32410
|
if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
|
|
32420
32411
|
if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
|
|
32421
32412
|
|
|
32413
|
+
data.object.backgroundRotation = this.backgroundRotation.toArray();
|
|
32414
|
+
data.object.environmentRotation = this.environmentRotation.toArray();
|
|
32415
|
+
|
|
32422
32416
|
return data;
|
|
32423
32417
|
|
|
32424
32418
|
}
|
|
@@ -33962,6 +33956,7 @@ class InstancedMesh extends Mesh {
|
|
|
33962
33956
|
|
|
33963
33957
|
this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );
|
|
33964
33958
|
this.instanceColor = null;
|
|
33959
|
+
this.morphTexture = null;
|
|
33965
33960
|
|
|
33966
33961
|
this.count = count;
|
|
33967
33962
|
|
|
@@ -34067,6 +34062,24 @@ class InstancedMesh extends Mesh {
|
|
|
34067
34062
|
|
|
34068
34063
|
}
|
|
34069
34064
|
|
|
34065
|
+
getMorphAt( index, object ) {
|
|
34066
|
+
|
|
34067
|
+
const objectInfluences = object.morphTargetInfluences;
|
|
34068
|
+
|
|
34069
|
+
const array = this.morphTexture.source.data.data;
|
|
34070
|
+
|
|
34071
|
+
const len = objectInfluences.length + 1; // All influences + the baseInfluenceSum
|
|
34072
|
+
|
|
34073
|
+
const dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning
|
|
34074
|
+
|
|
34075
|
+
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
34076
|
+
|
|
34077
|
+
objectInfluences[ i ] = array[ dataIndex + i ];
|
|
34078
|
+
|
|
34079
|
+
}
|
|
34080
|
+
|
|
34081
|
+
}
|
|
34082
|
+
|
|
34070
34083
|
raycast( raycaster, intersects ) {
|
|
34071
34084
|
|
|
34072
34085
|
const matrixWorld = this.matrixWorld;
|
|
@@ -34137,6 +34150,38 @@ class InstancedMesh extends Mesh {
|
|
|
34137
34150
|
|
|
34138
34151
|
}
|
|
34139
34152
|
|
|
34153
|
+
setMorphAt( index, object ) {
|
|
34154
|
+
|
|
34155
|
+
const objectInfluences = object.morphTargetInfluences;
|
|
34156
|
+
|
|
34157
|
+
const len = objectInfluences.length + 1; // morphBaseInfluence + all influences
|
|
34158
|
+
|
|
34159
|
+
if ( this.morphTexture === null ) {
|
|
34160
|
+
|
|
34161
|
+
this.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );
|
|
34162
|
+
|
|
34163
|
+
}
|
|
34164
|
+
|
|
34165
|
+
const array = this.morphTexture.source.data.data;
|
|
34166
|
+
|
|
34167
|
+
let morphInfluencesSum = 0;
|
|
34168
|
+
|
|
34169
|
+
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
34170
|
+
|
|
34171
|
+
morphInfluencesSum += objectInfluences[ i ];
|
|
34172
|
+
|
|
34173
|
+
}
|
|
34174
|
+
|
|
34175
|
+
const morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
|
|
34176
|
+
|
|
34177
|
+
const dataIndex = len * index;
|
|
34178
|
+
|
|
34179
|
+
array[ dataIndex ] = morphBaseInfluence;
|
|
34180
|
+
|
|
34181
|
+
array.set( objectInfluences, dataIndex + 1 );
|
|
34182
|
+
|
|
34183
|
+
}
|
|
34184
|
+
|
|
34140
34185
|
updateMorphTargets() {
|
|
34141
34186
|
|
|
34142
34187
|
}
|
|
@@ -34207,7 +34252,7 @@ class MultiDrawRenderList {
|
|
|
34207
34252
|
}
|
|
34208
34253
|
|
|
34209
34254
|
const ID_ATTR_NAME = 'batchId';
|
|
34210
|
-
const _matrix = /*@__PURE__*/ new Matrix4();
|
|
34255
|
+
const _matrix$1 = /*@__PURE__*/ new Matrix4();
|
|
34211
34256
|
const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
|
|
34212
34257
|
const _identityMatrix = /*@__PURE__*/ new Matrix4();
|
|
34213
34258
|
const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
@@ -34430,8 +34475,8 @@ class BatchedMesh extends Mesh {
|
|
|
34430
34475
|
|
|
34431
34476
|
if ( active[ i ] === false ) continue;
|
|
34432
34477
|
|
|
34433
|
-
this.getMatrixAt( i, _matrix );
|
|
34434
|
-
this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix );
|
|
34478
|
+
this.getMatrixAt( i, _matrix$1 );
|
|
34479
|
+
this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix$1 );
|
|
34435
34480
|
boundingBox.union( _box$1 );
|
|
34436
34481
|
|
|
34437
34482
|
}
|
|
@@ -34455,8 +34500,8 @@ class BatchedMesh extends Mesh {
|
|
|
34455
34500
|
|
|
34456
34501
|
if ( active[ i ] === false ) continue;
|
|
34457
34502
|
|
|
34458
|
-
this.getMatrixAt( i, _matrix );
|
|
34459
|
-
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
|
|
34503
|
+
this.getMatrixAt( i, _matrix$1 );
|
|
34504
|
+
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
|
|
34460
34505
|
boundingSphere.union( _sphere$2 );
|
|
34461
34506
|
|
|
34462
34507
|
}
|
|
@@ -35063,8 +35108,8 @@ class BatchedMesh extends Mesh {
|
|
|
35063
35108
|
if ( visibility[ i ] && active[ i ] ) {
|
|
35064
35109
|
|
|
35065
35110
|
// get the bounds in world space
|
|
35066
|
-
this.getMatrixAt( i, _matrix );
|
|
35067
|
-
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
|
|
35111
|
+
this.getMatrixAt( i, _matrix$1 );
|
|
35112
|
+
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
|
|
35068
35113
|
|
|
35069
35114
|
// determine whether the batched geometry is within the frustum
|
|
35070
35115
|
let culled = false;
|
|
@@ -35121,8 +35166,8 @@ class BatchedMesh extends Mesh {
|
|
|
35121
35166
|
if ( perObjectFrustumCulled ) {
|
|
35122
35167
|
|
|
35123
35168
|
// get the bounds in world space
|
|
35124
|
-
this.getMatrixAt( i, _matrix );
|
|
35125
|
-
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
|
|
35169
|
+
this.getMatrixAt( i, _matrix$1 );
|
|
35170
|
+
this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
|
|
35126
35171
|
culled = ! _frustum.intersectsSphere( _sphere$2 );
|
|
35127
35172
|
|
|
35128
35173
|
}
|
|
@@ -36251,9 +36296,9 @@ class EllipseCurve extends Curve {
|
|
|
36251
36296
|
|
|
36252
36297
|
}
|
|
36253
36298
|
|
|
36254
|
-
getPoint( t, optionalTarget ) {
|
|
36299
|
+
getPoint( t, optionalTarget = new Vector2() ) {
|
|
36255
36300
|
|
|
36256
|
-
const point = optionalTarget
|
|
36301
|
+
const point = optionalTarget;
|
|
36257
36302
|
|
|
36258
36303
|
const twoPi = Math.PI * 2;
|
|
36259
36304
|
let deltaAngle = this.aEndAngle - this.aStartAngle;
|
|
@@ -41910,6 +41955,7 @@ class MeshStandardMaterial extends Material {
|
|
|
41910
41955
|
this.alphaMap = null;
|
|
41911
41956
|
|
|
41912
41957
|
this.envMap = null;
|
|
41958
|
+
this.envMapRotation = new Euler();
|
|
41913
41959
|
this.envMapIntensity = 1.0;
|
|
41914
41960
|
|
|
41915
41961
|
this.wireframe = false;
|
|
@@ -41965,6 +42011,7 @@ class MeshStandardMaterial extends Material {
|
|
|
41965
42011
|
this.alphaMap = source.alphaMap;
|
|
41966
42012
|
|
|
41967
42013
|
this.envMap = source.envMap;
|
|
42014
|
+
this.envMapRotation.copy( source.envMapRotation );
|
|
41968
42015
|
this.envMapIntensity = source.envMapIntensity;
|
|
41969
42016
|
|
|
41970
42017
|
this.wireframe = source.wireframe;
|
|
@@ -42242,6 +42289,7 @@ class MeshPhongMaterial extends Material {
|
|
|
42242
42289
|
this.alphaMap = null;
|
|
42243
42290
|
|
|
42244
42291
|
this.envMap = null;
|
|
42292
|
+
this.envMapRotation = new Euler();
|
|
42245
42293
|
this.combine = MultiplyOperation;
|
|
42246
42294
|
this.reflectivity = 1;
|
|
42247
42295
|
this.refractionRatio = 0.98;
|
|
@@ -42295,6 +42343,7 @@ class MeshPhongMaterial extends Material {
|
|
|
42295
42343
|
this.alphaMap = source.alphaMap;
|
|
42296
42344
|
|
|
42297
42345
|
this.envMap = source.envMap;
|
|
42346
|
+
this.envMapRotation.copy( source.envMapRotation );
|
|
42298
42347
|
this.combine = source.combine;
|
|
42299
42348
|
this.reflectivity = source.reflectivity;
|
|
42300
42349
|
this.refractionRatio = source.refractionRatio;
|
|
@@ -42506,6 +42555,7 @@ class MeshLambertMaterial extends Material {
|
|
|
42506
42555
|
this.alphaMap = null;
|
|
42507
42556
|
|
|
42508
42557
|
this.envMap = null;
|
|
42558
|
+
this.envMapRotation = new Euler();
|
|
42509
42559
|
this.combine = MultiplyOperation;
|
|
42510
42560
|
this.reflectivity = 1;
|
|
42511
42561
|
this.refractionRatio = 0.98;
|
|
@@ -42557,6 +42607,7 @@ class MeshLambertMaterial extends Material {
|
|
|
42557
42607
|
this.alphaMap = source.alphaMap;
|
|
42558
42608
|
|
|
42559
42609
|
this.envMap = source.envMap;
|
|
42610
|
+
this.envMapRotation.copy( source.envMapRotation );
|
|
42560
42611
|
this.combine = source.combine;
|
|
42561
42612
|
this.reflectivity = source.reflectivity;
|
|
42562
42613
|
this.refractionRatio = source.refractionRatio;
|
|
@@ -45399,10 +45450,6 @@ class DataTextureLoader extends Loader {
|
|
|
45399
45450
|
|
|
45400
45451
|
texture.colorSpace = texData.colorSpace;
|
|
45401
45452
|
|
|
45402
|
-
} else if ( texData.encoding !== undefined ) { // @deprecated, r152
|
|
45403
|
-
|
|
45404
|
-
texture.encoding = texData.encoding;
|
|
45405
|
-
|
|
45406
45453
|
}
|
|
45407
45454
|
|
|
45408
45455
|
if ( texData.flipY !== undefined ) {
|
|
@@ -46638,6 +46685,7 @@ class MaterialLoader extends Loader {
|
|
|
46638
46685
|
if ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );
|
|
46639
46686
|
|
|
46640
46687
|
if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );
|
|
46688
|
+
if ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );
|
|
46641
46689
|
if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;
|
|
46642
46690
|
|
|
46643
46691
|
if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;
|
|
@@ -47633,7 +47681,6 @@ class ObjectLoader extends Loader {
|
|
|
47633
47681
|
if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;
|
|
47634
47682
|
if ( data.type !== undefined ) texture.type = data.type;
|
|
47635
47683
|
if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;
|
|
47636
|
-
if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152
|
|
47637
47684
|
|
|
47638
47685
|
if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
|
|
47639
47686
|
if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );
|
|
@@ -47772,6 +47819,8 @@ class ObjectLoader extends Loader {
|
|
|
47772
47819
|
|
|
47773
47820
|
if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;
|
|
47774
47821
|
if ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;
|
|
47822
|
+
if ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );
|
|
47823
|
+
if ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );
|
|
47775
47824
|
|
|
47776
47825
|
break;
|
|
47777
47826
|
|
|
@@ -52280,6 +52329,8 @@ class GLBufferAttribute {
|
|
|
52280
52329
|
|
|
52281
52330
|
}
|
|
52282
52331
|
|
|
52332
|
+
const _matrix = /*@__PURE__*/ new Matrix4();
|
|
52333
|
+
|
|
52283
52334
|
class Raycaster {
|
|
52284
52335
|
|
|
52285
52336
|
constructor( origin, direction, near = 0, far = Infinity ) {
|
|
@@ -52332,9 +52383,20 @@ class Raycaster {
|
|
|
52332
52383
|
|
|
52333
52384
|
}
|
|
52334
52385
|
|
|
52386
|
+
setFromXRController( controller ) {
|
|
52387
|
+
|
|
52388
|
+
_matrix.identity().extractRotation( controller.matrixWorld );
|
|
52389
|
+
|
|
52390
|
+
this.ray.origin.setFromMatrixPosition( controller.matrixWorld );
|
|
52391
|
+
this.ray.direction.set( 0, 0, - 1 ).applyMatrix4( _matrix );
|
|
52392
|
+
|
|
52393
|
+
return this;
|
|
52394
|
+
|
|
52395
|
+
}
|
|
52396
|
+
|
|
52335
52397
|
intersectObject( object, recursive = true, intersects = [] ) {
|
|
52336
52398
|
|
|
52337
|
-
|
|
52399
|
+
intersect( object, this, intersects, recursive );
|
|
52338
52400
|
|
|
52339
52401
|
intersects.sort( ascSort );
|
|
52340
52402
|
|
|
@@ -52346,7 +52408,7 @@ class Raycaster {
|
|
|
52346
52408
|
|
|
52347
52409
|
for ( let i = 0, l = objects.length; i < l; i ++ ) {
|
|
52348
52410
|
|
|
52349
|
-
|
|
52411
|
+
intersect( objects[ i ], this, intersects, recursive );
|
|
52350
52412
|
|
|
52351
52413
|
}
|
|
52352
52414
|
|
|
@@ -52364,7 +52426,7 @@ function ascSort( a, b ) {
|
|
|
52364
52426
|
|
|
52365
52427
|
}
|
|
52366
52428
|
|
|
52367
|
-
function
|
|
52429
|
+
function intersect( object, raycaster, intersects, recursive ) {
|
|
52368
52430
|
|
|
52369
52431
|
if ( object.layers.test( raycaster.layers ) ) {
|
|
52370
52432
|
|
|
@@ -52378,7 +52440,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
|
|
|
52378
52440
|
|
|
52379
52441
|
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
52380
52442
|
|
|
52381
|
-
|
|
52443
|
+
intersect( children[ i ], raycaster, intersects, true );
|
|
52382
52444
|
|
|
52383
52445
|
}
|
|
52384
52446
|
|
|
@@ -52852,7 +52914,6 @@ class SpotLightHelper extends Object3D {
|
|
|
52852
52914
|
|
|
52853
52915
|
this.light = light;
|
|
52854
52916
|
|
|
52855
|
-
this.matrix = light.matrixWorld;
|
|
52856
52917
|
this.matrixAutoUpdate = false;
|
|
52857
52918
|
|
|
52858
52919
|
this.color = color;
|
|
@@ -52904,6 +52965,24 @@ class SpotLightHelper extends Object3D {
|
|
|
52904
52965
|
this.light.updateWorldMatrix( true, false );
|
|
52905
52966
|
this.light.target.updateWorldMatrix( true, false );
|
|
52906
52967
|
|
|
52968
|
+
// update the local matrix based on the parent and light target transforms
|
|
52969
|
+
if ( this.parent ) {
|
|
52970
|
+
|
|
52971
|
+
this.parent.updateWorldMatrix( true );
|
|
52972
|
+
|
|
52973
|
+
this.matrix
|
|
52974
|
+
.copy( this.parent.matrixWorld )
|
|
52975
|
+
.invert()
|
|
52976
|
+
.multiply( this.light.matrixWorld );
|
|
52977
|
+
|
|
52978
|
+
} else {
|
|
52979
|
+
|
|
52980
|
+
this.matrix.copy( this.light.matrixWorld );
|
|
52981
|
+
|
|
52982
|
+
}
|
|
52983
|
+
|
|
52984
|
+
this.matrixWorld.copy( this.light.matrixWorld );
|
|
52985
|
+
|
|
52907
52986
|
const coneLength = this.light.distance ? this.light.distance : 1000;
|
|
52908
52987
|
const coneWidth = coneLength * Math.tan( this.light.angle );
|
|
52909
52988
|
|
|
@@ -54344,6 +54423,26 @@ class ShapePath {
|
|
|
54344
54423
|
|
|
54345
54424
|
}
|
|
54346
54425
|
|
|
54426
|
+
class WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162
|
|
54427
|
+
|
|
54428
|
+
constructor( width = 1, height = 1, count = 1, options = {} ) {
|
|
54429
|
+
|
|
54430
|
+
console.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.' );
|
|
54431
|
+
|
|
54432
|
+
super( width, height, { ...options, count } );
|
|
54433
|
+
|
|
54434
|
+
this.isWebGLMultipleRenderTargets = true;
|
|
54435
|
+
|
|
54436
|
+
}
|
|
54437
|
+
|
|
54438
|
+
get texture() {
|
|
54439
|
+
|
|
54440
|
+
return this.textures;
|
|
54441
|
+
|
|
54442
|
+
}
|
|
54443
|
+
|
|
54444
|
+
}
|
|
54445
|
+
|
|
54347
54446
|
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
54348
54447
|
|
|
54349
54448
|
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
@@ -54483,7 +54582,6 @@ exports.ExtrudeGeometry = ExtrudeGeometry;
|
|
|
54483
54582
|
exports.FileLoader = FileLoader;
|
|
54484
54583
|
exports.Float16BufferAttribute = Float16BufferAttribute;
|
|
54485
54584
|
exports.Float32BufferAttribute = Float32BufferAttribute;
|
|
54486
|
-
exports.Float64BufferAttribute = Float64BufferAttribute;
|
|
54487
54585
|
exports.FloatType = FloatType;
|
|
54488
54586
|
exports.Fog = Fog;
|
|
54489
54587
|
exports.FogExp2 = FogExp2;
|
|
@@ -54547,7 +54645,6 @@ exports.LineDashedMaterial = LineDashedMaterial;
|
|
|
54547
54645
|
exports.LineLoop = LineLoop;
|
|
54548
54646
|
exports.LineSegments = LineSegments;
|
|
54549
54647
|
exports.LinearDisplayP3ColorSpace = LinearDisplayP3ColorSpace;
|
|
54550
|
-
exports.LinearEncoding = LinearEncoding;
|
|
54551
54648
|
exports.LinearFilter = LinearFilter;
|
|
54552
54649
|
exports.LinearInterpolant = LinearInterpolant;
|
|
54553
54650
|
exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;
|
|
@@ -54593,6 +54690,7 @@ exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;
|
|
|
54593
54690
|
exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;
|
|
54594
54691
|
exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;
|
|
54595
54692
|
exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
|
|
54693
|
+
exports.NeutralToneMapping = NeutralToneMapping;
|
|
54596
54694
|
exports.NeverCompare = NeverCompare;
|
|
54597
54695
|
exports.NeverDepth = NeverDepth;
|
|
54598
54696
|
exports.NeverStencilFunc = NeverStencilFunc;
|
|
@@ -54780,4 +54878,3 @@ exports.ZeroSlopeEnding = ZeroSlopeEnding;
|
|
|
54780
54878
|
exports.ZeroStencilOp = ZeroStencilOp;
|
|
54781
54879
|
exports._SRGBAFormat = _SRGBAFormat;
|
|
54782
54880
|
exports.createCanvasElement = createCanvasElement;
|
|
54783
|
-
exports.sRGBEncoding = sRGBEncoding;
|