@plastic-software/three 0.175.8 → 0.175.10
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 +204 -204
- package/build/three.core.js +158 -158
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +47 -47
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +96 -114
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +96 -114
- package/build/three.webgpu.nodes.min.js +1 -1
- package/package.json +1 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +22 -14
package/build/three.module.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { Matrix3, Vector2, Color, Matrix4, mergeUniforms, Vector3, CubeUVReflectionMapping, Mesh, BoxGeometry, ShaderMaterial, BackSide, cloneUniforms, Euler, ColorManagement, SRGBTransfer, PlaneGeometry, FrontSide, getUnlitUniformColorSpace, IntType, HalfFloatType, UnsignedByteType, FloatType, RGBAFormat, Plane, EquirectangularReflectionMapping, EquirectangularRefractionMapping, WebGLCubeRenderTarget, CubeReflectionMapping, CubeRefractionMapping, OrthographicCamera, PerspectiveCamera, NoToneMapping, MeshBasicMaterial, NoBlending, WebGLRenderTarget, BufferGeometry, BufferAttribute, LinearSRGBColorSpace, LinearFilter, warnOnce, Uint32BufferAttribute, Uint16BufferAttribute, arrayNeedsUint32, Vector4, DataArrayTexture, CubeTexture, Data3DTexture, LessEqualCompare, DepthTexture, Texture, TriPlanarMapping, CylindricalMapping, UVMapping, GLSL3, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, CustomToneMapping, NeutralToneMapping, AgXToneMapping, ACESFilmicToneMapping, CineonToneMapping, ReinhardToneMapping, LinearToneMapping, LinearTransfer, AddOperation, MixOperation, MultiplyOperation, UniformsUtils, DoubleSide, NormalBlending, TangentSpaceNormalMap, ObjectSpaceNormalMap, Layers, Frustum, MeshDepthMaterial, RGBADepthPacking, MeshDistanceMaterial, NearestFilter, LessEqualDepth, ReverseSubtractEquation, SubtractEquation, AddEquation, OneMinusConstantAlphaFactor, ConstantAlphaFactor, OneMinusConstantColorFactor, ConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, DstAlphaFactor, DstColorFactor, SrcAlphaSaturateFactor, SrcAlphaFactor, SrcColorFactor, OneFactor, ZeroFactor, NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessDepth, AlwaysDepth, NeverDepth, CullFaceNone, CullFaceBack, CullFaceFront, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, MinEquation, MaxEquation, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NotEqualCompare, GreaterCompare, GreaterEqualCompare, EqualCompare, LessCompare, AlwaysCompare, NeverCompare, NoColorSpace, DepthStencilFormat, getByteLength, DepthFormat, UnsignedIntType, UnsignedInt248Type, UnsignedShortType, createElementNS, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt5999Type, ByteType, ShortType, AlphaFormat, RGBFormat, LuminanceFormat, LuminanceAlphaFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, EventDispatcher, ArrayCamera, WebXRController, RAD2DEG, createCanvasElement, SRGBColorSpace, REVISION, toNormalizedProjectionMatrix, toReversedProjectionMatrix, probeAsync, WebGLCoordinateSystem } from './three.core.js';
|
|
7
7
|
export { AdditiveAnimationBlendMode, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxHelper, BufferGeometryLoader, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CircleGeometry, Clock, ColorKeyframeTrack, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, Controls, CubeCamera, CubeTextureLoader, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceFrontBack, Curve, CurvePath, CylinderGeometry, Cylindrical, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualStencilFunc, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Fog, FogExp2, FramebufferTexture, GLBufferAttribute, GLSL1, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NeverStencilFunc, NormalAnimationBlendMode, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, OctahedronGeometry, Path, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RGBDepthPacking, RGBIntegerFormat, RGDepthPacking, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RenderTarget, RenderTarget3D, RenderTargetArray, ReplaceStencilOp, RingGeometry, Scene, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, TOUCH, TetrahedronGeometry, TextureLoader, TextureUtils, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, ZeroStencilOp } from './three.core.js';
|
|
8
8
|
|
|
9
9
|
function WebGLAnimation() {
|
|
@@ -433,7 +433,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING
|
|
|
433
433
|
|
|
434
434
|
var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif";
|
|
435
435
|
|
|
436
|
-
var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#if defined( USE_TANGENT )\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #elif defined( USE_NORMALMAP_UV )\n\t mat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n #elif defined( USE_NORMALMAP_CYLINDRICAL ) || defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL ) || (defined( USE_ANISOTROPY ) && !defined( USE_UV1 ) || !defined( USE_UV2 ) && !defined( USE_UV3 ))\n \n #if defined( USE_NORMALMAP_CYLINDRICAL )\n vec2 vNormalMapUv = ( normalMapTransform * vec3( positionBasedUv, 1 ) ).xy;\n #endif\n #if defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL )\n vec2 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( positionBasedUv, 1 ) ).xy;\n #endif\n vec3 tangent = normalize(cross(normal, mat3(modelViewMatrix) * transpose(mat3(texture3DMatrix)) * vec3(0, 1, 0)));\n vec3 bitangent = cross(tangent, normal);\n \tmat3 tbn = mat3(tangent, bitangent, normal);\n\t#else\n\t mat3 tbn = getTangentFrame( - vViewPosition, normal, vUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t
|
|
436
|
+
var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#if defined( USE_TANGENT )\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #elif defined( USE_NORMALMAP_UV )\n\t mat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n #elif defined( USE_NORMALMAP_CYLINDRICAL ) || defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL ) || (defined( USE_ANISOTROPY ) && !defined( USE_UV1 ) || !defined( USE_UV2 ) && !defined( USE_UV3 ))\n \n #if defined( USE_NORMALMAP_CYLINDRICAL )\n vec2 vNormalMapUv = ( normalMapTransform * vec3( positionBasedUv, 1 ) ).xy;\n #endif\n #if defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL )\n vec2 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( positionBasedUv, 1 ) ).xy;\n #endif\n vec3 tangent = normalize(cross(normal, mat3(modelViewMatrix) * transpose(mat3(texture3DMatrix)) * vec3(0, 1, 0)));\n vec3 bitangent = cross(tangent, normal);\n \tmat3 tbn = mat3(tangent, bitangent, normal);\n \n\t#elif defined( USE_CLEARCOAT_NORMALMAP_UV )\n\t mat3 tbn = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#else\n\t mat3 tbn = getTangentFrame( - vViewPosition, normal, vUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#if !defined( USE_CLEARCOAT_NORMALMAP_TRIPLANAR )\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL )\n\t\t\tvec3 tangent2 = normalize(cross(normal, mat3(modelViewMatrix) * transpose(mat3(texture3DMatrix)) * vec3(0, 1, 0)));\n\t\t\tvec3 bitangent2 = cross(tangent2, normal);\n\t\t\tmat3 tbn2 = mat3(tangent2, bitangent2, normal);\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP_UV )\n\t\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t\t#else\n\t\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vUv );\n\t\t#endif\n\t\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\t\ttbn2[0] *= faceDirection;\n\t\t\ttbn2[1] *= faceDirection;\n\t\t#endif\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;";
|
|
437
437
|
|
|
438
438
|
var normal_fragment_maps = "#ifdef USE_NORMALMAP_TRIPLANAR\n\tnormal = normalize(normalMatrix * transpose(mat3(texture3DMatrix)) * texture2DTriplanarNormal( normalMap, normalMapTransform, normalScale, normalize(mat3(texture3DMatrix) * vModelNormal.xyz), triplanarCoords, triplanarWeights ));\n#elif defined( USE_NORMALMAP_OBJECTSPACE )\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
|
|
439
439
|
|
|
@@ -751,7 +751,7 @@ const UniformsLib = {
|
|
|
751
751
|
|
|
752
752
|
envMap: { value: null },
|
|
753
753
|
envMapRotation: { value: /*@__PURE__*/ new Matrix3() },
|
|
754
|
-
flipEnvMap: { value: -
|
|
754
|
+
flipEnvMap: { value: -1 },
|
|
755
755
|
reflectivity: { value: 1.0 }, // basic, lambert, phong
|
|
756
756
|
ior: { value: 1.5 }, // physical
|
|
757
757
|
refractionRatio: { value: 0.98 }, // basic, lambert, phong
|
|
@@ -1172,7 +1172,7 @@ const ShaderLib = {
|
|
|
1172
1172
|
|
|
1173
1173
|
uniforms: {
|
|
1174
1174
|
envMap: { value: null },
|
|
1175
|
-
flipEnvMap: { value: -
|
|
1175
|
+
flipEnvMap: { value: -1 },
|
|
1176
1176
|
backgroundBlurriness: { value: 0 },
|
|
1177
1177
|
backgroundIntensity: { value: 1 },
|
|
1178
1178
|
backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
|
|
@@ -1187,7 +1187,7 @@ const ShaderLib = {
|
|
|
1187
1187
|
|
|
1188
1188
|
uniforms: {
|
|
1189
1189
|
tCube: { value: null },
|
|
1190
|
-
tFlip: { value: -
|
|
1190
|
+
tFlip: { value: -1 },
|
|
1191
1191
|
opacity: { value: 1.0 }
|
|
1192
1192
|
},
|
|
1193
1193
|
|
|
@@ -1422,18 +1422,18 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
1422
1422
|
_e1$1.copy( scene.backgroundRotation );
|
|
1423
1423
|
|
|
1424
1424
|
// accommodate left-handed frame
|
|
1425
|
-
_e1$1.x *= -
|
|
1425
|
+
_e1$1.x *= -1; _e1$1.y *= -1; _e1$1.z *= -1;
|
|
1426
1426
|
|
|
1427
1427
|
if ( background.isCubeTexture && background.isRenderTargetTexture === false ) {
|
|
1428
1428
|
|
|
1429
1429
|
// environment maps which are not cube render targets or PMREMs follow a different convention
|
|
1430
|
-
_e1$1.y *= -
|
|
1431
|
-
_e1$1.z *= -
|
|
1430
|
+
_e1$1.y *= -1;
|
|
1431
|
+
_e1$1.z *= -1;
|
|
1432
1432
|
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
1435
|
boxMesh.material.uniforms.envMap.value = background;
|
|
1436
|
-
boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? -
|
|
1436
|
+
boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? -1 : 1;
|
|
1437
1437
|
boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
|
|
1438
1438
|
boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
|
|
1439
1439
|
boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );
|
|
@@ -2698,9 +2698,9 @@ const _axisDirections = [
|
|
|
2698
2698
|
/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
|
|
2699
2699
|
/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
|
|
2700
2700
|
/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
|
|
2701
|
-
/*@__PURE__*/ new Vector3( -
|
|
2702
|
-
/*@__PURE__*/ new Vector3( 1, 1, -
|
|
2703
|
-
/*@__PURE__*/ new Vector3( -
|
|
2701
|
+
/*@__PURE__*/ new Vector3( -1, 1, -1 ),
|
|
2702
|
+
/*@__PURE__*/ new Vector3( 1, 1, -1 ),
|
|
2703
|
+
/*@__PURE__*/ new Vector3( -1, 1, 1 ),
|
|
2704
2704
|
/*@__PURE__*/ new Vector3( 1, 1, 1 ) ];
|
|
2705
2705
|
|
|
2706
2706
|
const _origin = /*@__PURE__*/ new Vector3();
|
|
@@ -2979,8 +2979,8 @@ class PMREMGenerator {
|
|
|
2979
2979
|
const fov = 90;
|
|
2980
2980
|
const aspect = 1;
|
|
2981
2981
|
const cubeCamera = new PerspectiveCamera( fov, aspect, near, far );
|
|
2982
|
-
const upSign = [ 1, -
|
|
2983
|
-
const forwardSign = [ 1, 1, 1, -
|
|
2982
|
+
const upSign = [ 1, -1, 1, 1, 1, 1 ];
|
|
2983
|
+
const forwardSign = [ 1, 1, 1, -1, -1, -1 ];
|
|
2984
2984
|
const renderer = this._renderer;
|
|
2985
2985
|
|
|
2986
2986
|
const originalAutoClear = renderer.autoClear;
|
|
@@ -3083,7 +3083,7 @@ class PMREMGenerator {
|
|
|
3083
3083
|
|
|
3084
3084
|
}
|
|
3085
3085
|
|
|
3086
|
-
this._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? -
|
|
3086
|
+
this._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? -1 : 1;
|
|
3087
3087
|
|
|
3088
3088
|
} else {
|
|
3089
3089
|
|
|
@@ -3303,7 +3303,7 @@ function _createPlanes( lodMax ) {
|
|
|
3303
3303
|
for ( let face = 0; face < cubeFaces; face ++ ) {
|
|
3304
3304
|
|
|
3305
3305
|
const x = ( face % 3 ) * 2 / 3 - 1;
|
|
3306
|
-
const y = face > 2 ? 0 : -
|
|
3306
|
+
const y = face > 2 ? 0 : -1;
|
|
3307
3307
|
const coordinates = [
|
|
3308
3308
|
x, y, 0,
|
|
3309
3309
|
x + 2 / 3, y, 0,
|
|
@@ -3502,7 +3502,7 @@ function _getCubemapMaterial() {
|
|
|
3502
3502
|
|
|
3503
3503
|
uniforms: {
|
|
3504
3504
|
'envMap': { value: null },
|
|
3505
|
-
'flipEnvMap': { value: -
|
|
3505
|
+
'flipEnvMap': { value: -1 }
|
|
3506
3506
|
},
|
|
3507
3507
|
|
|
3508
3508
|
vertexShader: _getCommonVertexShader(),
|
|
@@ -7910,18 +7910,18 @@ function WebGLLights( extensions ) {
|
|
|
7910
7910
|
version: 0,
|
|
7911
7911
|
|
|
7912
7912
|
hash: {
|
|
7913
|
-
directionalLength: -
|
|
7914
|
-
pointLength: -
|
|
7915
|
-
spotLength: -
|
|
7916
|
-
rectAreaLength: -
|
|
7917
|
-
hemiLength: -
|
|
7918
|
-
|
|
7919
|
-
numDirectionalShadows: -
|
|
7920
|
-
numPointShadows: -
|
|
7921
|
-
numSpotShadows: -
|
|
7922
|
-
numSpotMaps: -
|
|
7923
|
-
|
|
7924
|
-
numLightProbes: -
|
|
7913
|
+
directionalLength: -1,
|
|
7914
|
+
pointLength: -1,
|
|
7915
|
+
spotLength: -1,
|
|
7916
|
+
rectAreaLength: -1,
|
|
7917
|
+
hemiLength: -1,
|
|
7918
|
+
|
|
7919
|
+
numDirectionalShadows: -1,
|
|
7920
|
+
numPointShadows: -1,
|
|
7921
|
+
numSpotShadows: -1,
|
|
7922
|
+
numSpotMaps: -1,
|
|
7923
|
+
|
|
7924
|
+
numLightProbes: -1
|
|
7925
7925
|
},
|
|
7926
7926
|
|
|
7927
7927
|
ambient: [ 0, 0, 0 ],
|
|
@@ -8462,7 +8462,7 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
|
|
|
8462
8462
|
fullScreenTri.setAttribute(
|
|
8463
8463
|
'position',
|
|
8464
8464
|
new BufferAttribute(
|
|
8465
|
-
new Float32Array( [ -
|
|
8465
|
+
new Float32Array( [ -1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5 ] ),
|
|
8466
8466
|
3
|
|
8467
8467
|
)
|
|
8468
8468
|
);
|
|
@@ -8895,7 +8895,7 @@ function WebGLState( gl, extensions ) {
|
|
|
8895
8895
|
locked = false;
|
|
8896
8896
|
|
|
8897
8897
|
currentColorMask = null;
|
|
8898
|
-
currentColorClear.set( -
|
|
8898
|
+
currentColorClear.set( -1, 0, 0, 0 ); // set to invalid state
|
|
8899
8899
|
|
|
8900
8900
|
}
|
|
8901
8901
|
|
|
@@ -9224,12 +9224,12 @@ function WebGLState( gl, extensions ) {
|
|
|
9224
9224
|
let version = 0;
|
|
9225
9225
|
const glVersion = gl.getParameter( gl.VERSION );
|
|
9226
9226
|
|
|
9227
|
-
if ( glVersion.indexOf( 'WebGL' ) !== -
|
|
9227
|
+
if ( glVersion.indexOf( 'WebGL' ) !== -1 ) {
|
|
9228
9228
|
|
|
9229
9229
|
version = parseFloat( /^WebGL (\d)/.exec( glVersion )[ 1 ] );
|
|
9230
9230
|
lineWidthAvailable = ( version >= 1.0 );
|
|
9231
9231
|
|
|
9232
|
-
} else if ( glVersion.indexOf( 'OpenGL ES' ) !== -
|
|
9232
|
+
} else if ( glVersion.indexOf( 'OpenGL ES' ) !== -1 ) {
|
|
9233
9233
|
|
|
9234
9234
|
version = parseFloat( /^OpenGL ES (\d)/.exec( glVersion )[ 1 ] );
|
|
9235
9235
|
lineWidthAvailable = ( version >= 2.0 );
|
|
@@ -12872,7 +12872,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
12872
12872
|
|
|
12873
12873
|
const controllerIndex = controllerInputSources.indexOf( event.inputSource );
|
|
12874
12874
|
|
|
12875
|
-
if ( controllerIndex === -
|
|
12875
|
+
if ( controllerIndex === -1 ) {
|
|
12876
12876
|
|
|
12877
12877
|
return;
|
|
12878
12878
|
|
|
@@ -13231,7 +13231,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
13231
13231
|
|
|
13232
13232
|
let controllerIndex = controllerInputSources.indexOf( inputSource );
|
|
13233
13233
|
|
|
13234
|
-
if ( controllerIndex === -
|
|
13234
|
+
if ( controllerIndex === -1 ) {
|
|
13235
13235
|
|
|
13236
13236
|
// Assign input source a controller that currently has no input source
|
|
13237
13237
|
|
|
@@ -13255,7 +13255,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
13255
13255
|
|
|
13256
13256
|
// If all controllers do currently receive input we ignore new ones
|
|
13257
13257
|
|
|
13258
|
-
if ( controllerIndex === -
|
|
13258
|
+
if ( controllerIndex === -1 ) break;
|
|
13259
13259
|
|
|
13260
13260
|
}
|
|
13261
13261
|
|
|
@@ -13322,7 +13322,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
13322
13322
|
camera.matrixWorldInverse.copy( camera.matrixWorld ).invert();
|
|
13323
13323
|
|
|
13324
13324
|
// Check if the projection uses an infinite far plane.
|
|
13325
|
-
if ( projL[ 10 ] === -
|
|
13325
|
+
if ( projL[ 10 ] === -1 ) {
|
|
13326
13326
|
|
|
13327
13327
|
// Use the projection matrix from the left eye.
|
|
13328
13328
|
// The camera offset is sufficient to include the view volumes
|
|
@@ -13875,7 +13875,7 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
13875
13875
|
|
|
13876
13876
|
if ( material.side === BackSide ) {
|
|
13877
13877
|
|
|
13878
|
-
uniforms.bumpScale.value *= -
|
|
13878
|
+
uniforms.bumpScale.value *= -1;
|
|
13879
13879
|
|
|
13880
13880
|
}
|
|
13881
13881
|
|
|
@@ -13942,19 +13942,19 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
13942
13942
|
_e1.copy( envMapRotation );
|
|
13943
13943
|
|
|
13944
13944
|
// accommodate left-handed frame
|
|
13945
|
-
_e1.x *= -
|
|
13945
|
+
_e1.x *= -1; _e1.y *= -1; _e1.z *= -1;
|
|
13946
13946
|
|
|
13947
13947
|
if ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {
|
|
13948
13948
|
|
|
13949
13949
|
// environment maps which are not cube render targets or PMREMs follow a different convention
|
|
13950
|
-
_e1.y *= -
|
|
13951
|
-
_e1.z *= -
|
|
13950
|
+
_e1.y *= -1;
|
|
13951
|
+
_e1.z *= -1;
|
|
13952
13952
|
|
|
13953
13953
|
}
|
|
13954
13954
|
|
|
13955
13955
|
uniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );
|
|
13956
13956
|
|
|
13957
|
-
uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -
|
|
13957
|
+
uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -1 : 1;
|
|
13958
13958
|
|
|
13959
13959
|
uniforms.reflectivity.value = material.reflectivity;
|
|
13960
13960
|
uniforms.ior.value = material.ior;
|
|
@@ -14377,7 +14377,7 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) {
|
|
|
14377
14377
|
|
|
14378
14378
|
for ( let i = 0; i < maxBindingPoints; i ++ ) {
|
|
14379
14379
|
|
|
14380
|
-
if ( allocatedBindingPoints.indexOf( i ) === -
|
|
14380
|
+
if ( allocatedBindingPoints.indexOf( i ) === -1 ) {
|
|
14381
14381
|
|
|
14382
14382
|
allocatedBindingPoints.push( i );
|
|
14383
14383
|
return i;
|
|
@@ -14917,7 +14917,7 @@ class WebGLRenderer {
|
|
|
14917
14917
|
let _currentActiveCubeFace = 0;
|
|
14918
14918
|
let _currentActiveMipmapLevel = 0;
|
|
14919
14919
|
let _currentRenderTarget = null;
|
|
14920
|
-
let _currentMaterialId = -
|
|
14920
|
+
let _currentMaterialId = -1;
|
|
14921
14921
|
|
|
14922
14922
|
let _currentCamera = null;
|
|
14923
14923
|
|
|
@@ -16315,7 +16315,7 @@ class WebGLRenderer {
|
|
|
16315
16315
|
// _gl.finish();
|
|
16316
16316
|
|
|
16317
16317
|
bindingStates.resetDefaultState();
|
|
16318
|
-
_currentMaterialId = -
|
|
16318
|
+
_currentMaterialId = -1;
|
|
16319
16319
|
_currentCamera = null;
|
|
16320
16320
|
|
|
16321
16321
|
renderStateStack.pop();
|
|
@@ -17153,7 +17153,7 @@ class WebGLRenderer {
|
|
|
17153
17153
|
|
|
17154
17154
|
m_uniforms.envMap.value = envMap;
|
|
17155
17155
|
|
|
17156
|
-
m_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -
|
|
17156
|
+
m_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -1 : 1;
|
|
17157
17157
|
|
|
17158
17158
|
}
|
|
17159
17159
|
|
|
@@ -17483,7 +17483,7 @@ class WebGLRenderer {
|
|
|
17483
17483
|
|
|
17484
17484
|
}
|
|
17485
17485
|
|
|
17486
|
-
_currentMaterialId = -
|
|
17486
|
+
_currentMaterialId = -1; // reset current material to ensure correct uniform bindings
|
|
17487
17487
|
|
|
17488
17488
|
};
|
|
17489
17489
|
|