super-three 0.160.1 → 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/LICENSE +1 -1
- package/build/three.cjs +867 -499
- package/build/three.module.js +867 -496
- package/build/three.module.min.js +1 -1
- package/examples/jsm/Addons.js +5 -1
- package/examples/jsm/capabilities/WebGPU.js +13 -9
- package/examples/jsm/controls/DragControls.js +91 -30
- package/examples/jsm/controls/OrbitControls.js +130 -15
- package/examples/jsm/controls/TransformControls.js +6 -6
- package/examples/jsm/curves/NURBSUtils.js +59 -4
- package/examples/jsm/curves/NURBSVolume.js +62 -0
- package/examples/jsm/exporters/GLTFExporter.js +11 -1
- package/examples/jsm/exporters/USDZExporter.js +8 -7
- package/examples/jsm/helpers/TextureHelper.js +3 -3
- 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 +57 -64
- package/examples/jsm/loaders/DDSLoader.js +1 -0
- package/examples/jsm/loaders/KTX2Loader.js +20 -5
- package/examples/jsm/loaders/LUT3dlLoader.js +78 -46
- package/examples/jsm/loaders/LUTCubeLoader.js +81 -67
- package/examples/jsm/loaders/LUTImageLoader.js +3 -2
- package/examples/jsm/loaders/MaterialXLoader.js +115 -16
- package/examples/jsm/loaders/SVGLoader.js +4 -3
- package/examples/jsm/loaders/VOXLoader.js +9 -2
- package/examples/jsm/loaders/VRMLLoader.js +7 -3
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +144 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +1 -0
- package/examples/jsm/misc/Timer.js +13 -4
- package/examples/jsm/nodes/Nodes.js +24 -11
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +10 -0
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +5 -3
- package/examples/jsm/nodes/accessors/CameraNode.js +9 -4
- package/examples/jsm/nodes/accessors/ClippingNode.js +144 -0
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +12 -1
- 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 +45 -0
- package/examples/jsm/nodes/accessors/TangentNode.js +8 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +1 -1
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +56 -3
- package/examples/jsm/nodes/accessors/UniformsNode.js +140 -0
- package/examples/jsm/nodes/accessors/VertexColorNode.js +70 -0
- package/examples/jsm/nodes/code/CodeNode.js +6 -0
- package/examples/jsm/nodes/core/AssignNode.js +68 -12
- package/examples/jsm/nodes/core/AttributeNode.js +1 -1
- package/examples/jsm/nodes/core/Node.js +14 -4
- package/examples/jsm/nodes/core/NodeBuilder.js +26 -27
- package/examples/jsm/nodes/core/NodeFrame.js +18 -10
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/core/constants.js +1 -0
- package/examples/jsm/nodes/display/AfterImageNode.js +148 -0
- package/examples/jsm/nodes/display/AnamorphicNode.js +148 -0
- package/examples/jsm/nodes/display/BlendModeNode.js +30 -1
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +3 -0
- package/examples/jsm/nodes/display/GaussianBlurNode.js +33 -13
- package/examples/jsm/nodes/display/NormalMapNode.js +3 -5
- package/examples/jsm/nodes/display/PassNode.js +3 -2
- package/examples/jsm/nodes/display/ToneMappingNode.js +46 -3
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +1 -4
- package/examples/jsm/nodes/display/ViewportNode.js +0 -2
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +4 -4
- package/examples/jsm/nodes/fog/FogNode.js +2 -1
- package/examples/jsm/nodes/lighting/AmbientLightNode.js +1 -1
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +13 -5
- package/examples/jsm/nodes/lighting/LightingContextNode.js +1 -1
- package/examples/jsm/nodes/lighting/LightsNode.js +1 -1
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +18 -30
- package/examples/jsm/nodes/materials/Materials.js +1 -0
- package/examples/jsm/nodes/materials/MeshSSSNodeMaterial.js +84 -0
- package/examples/jsm/nodes/materials/NodeMaterial.js +43 -10
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +1 -7
- package/examples/jsm/nodes/math/CondNode.js +42 -7
- package/examples/jsm/nodes/math/MathNode.js +32 -2
- package/examples/jsm/nodes/math/MathUtils.js +15 -0
- package/examples/jsm/nodes/math/OperatorNode.js +13 -5
- package/examples/jsm/nodes/math/TriNoise3D.js +71 -0
- package/examples/jsm/nodes/shadernode/ShaderNode.js +10 -1
- package/examples/jsm/nodes/utils/JoinNode.js +2 -2
- package/examples/jsm/nodes/utils/LoopNode.js +5 -3
- package/examples/jsm/nodes/utils/ReflectorNode.js +227 -0
- package/examples/jsm/nodes/utils/RotateNode.js +68 -0
- package/examples/jsm/nodes/utils/RotateUVNode.js +1 -9
- package/examples/jsm/nodes/utils/SplitNode.js +4 -4
- package/examples/jsm/nodes/utils/StorageArrayElementNode.js +91 -0
- package/examples/jsm/objects/GroundedSkybox.js +50 -0
- package/examples/jsm/objects/QuadMesh.js +8 -2
- package/examples/jsm/objects/Water2.js +8 -8
- package/examples/jsm/postprocessing/GTAOPass.js +11 -1
- package/examples/jsm/postprocessing/OutputPass.js +2 -0
- package/examples/jsm/renderers/common/Backend.js +14 -0
- package/examples/jsm/renderers/common/Background.js +2 -2
- package/examples/jsm/renderers/common/Bindings.js +1 -1
- package/examples/jsm/renderers/common/ClippingContext.js +165 -0
- package/examples/jsm/renderers/common/DataMap.js +1 -1
- package/examples/jsm/renderers/common/Info.js +25 -1
- package/examples/jsm/renderers/common/Pipelines.js +8 -8
- package/examples/jsm/renderers/common/PostProcessing.js +2 -2
- package/examples/jsm/renderers/common/ProgrammableStage.js +3 -1
- 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 +46 -1
- package/examples/jsm/renderers/common/RenderObjects.js +3 -1
- package/examples/jsm/renderers/common/Renderer.js +290 -17
- package/examples/jsm/renderers/common/StorageBufferAttribute.js +17 -0
- package/examples/jsm/renderers/common/StorageInstancedBufferAttribute.js +17 -0
- package/examples/jsm/renderers/common/Textures.js +28 -18
- package/examples/jsm/renderers/common/UniformsGroup.js +6 -4
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +2 -1
- 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 +5 -2
- package/examples/jsm/renderers/webgl/WebGLBackend.js +653 -272
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +171 -39
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +95 -8
- package/examples/jsm/renderers/webgl/utils/WebGLConstants.js +11 -0
- package/examples/jsm/renderers/webgl/utils/WebGLState.js +197 -0
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +424 -11
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +3 -2
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +1 -21
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +300 -112
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +7 -2
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +71 -79
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +15 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +38 -4
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +87 -14
- package/examples/jsm/shaders/OutputShader.js +4 -0
- package/examples/jsm/transpiler/AST.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +1 -1
- package/examples/jsm/transpiler/TSLEncoder.js +1 -1
- package/examples/jsm/utils/BufferGeometryUtils.js +23 -27
- package/examples/jsm/utils/SkeletonUtils.js +14 -3
- package/examples/jsm/utils/SortUtils.js +2 -0
- package/examples/jsm/webxr/ARButton.js +12 -2
- package/examples/jsm/webxr/VRButton.js +25 -7
- package/examples/jsm/webxr/XRButton.js +12 -3
- package/examples/jsm/webxr/XRControllerModelFactory.js +14 -1
- package/examples/jsm/webxr/XRHandMeshModel.js +3 -1
- package/package.json +5 -4
- package/src/Three.Legacy.js +20 -0
- package/src/Three.js +0 -1
- package/src/audio/Audio.js +1 -3
- package/src/cameras/PerspectiveCamera.js +35 -0
- package/src/constants.js +2 -6
- package/src/core/BufferAttribute.js +2 -12
- package/src/core/BufferGeometry.js +23 -29
- package/src/core/InterleavedBuffer.js +2 -1
- package/src/core/InterleavedBufferAttribute.js +20 -0
- 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/materials/ShaderMaterial.js +2 -1
- package/src/math/Quaternion.js +13 -12
- package/src/math/Triangle.js +0 -30
- package/src/math/Vector3.js +7 -7
- package/src/objects/BatchedMesh.js +6 -7
- package/src/objects/InstancedMesh.js +53 -0
- package/src/objects/Mesh.js +0 -1
- package/src/objects/SkinnedMesh.js +0 -8
- package/src/renderers/WebGLCubeRenderTarget.js +1 -10
- package/src/renderers/WebGLRenderer.js +20 -23
- package/src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js +56 -11
- 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 +38 -7
- 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 +3 -2
- package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +3 -2
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +4 -1
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/points.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib.js +2 -1
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/webgl/WebGLAttributes.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +18 -0
- package/src/renderers/webgl/WebGLCubeMaps.js +1 -1
- package/src/renderers/webgl/WebGLMaterials.js +24 -1
- package/src/renderers/webgl/WebGLMorphtargets.js +15 -8
- package/src/renderers/webgl/WebGLProgram.js +42 -4
- package/src/renderers/webgl/WebGLPrograms.js +38 -27
- package/src/renderers/webgl/WebGLState.js +11 -21
- package/src/renderers/webgl/WebGLTextures.js +170 -66
- package/src/renderers/webxr/WebXRDepthSensing.js +105 -0
- package/src/renderers/webxr/WebXRManager.js +46 -0
- package/src/scenes/Scene.js +8 -0
- package/src/textures/Source.js +1 -0
- package/src/textures/Texture.js +1 -29
- package/build/three.js +0 -54519
- package/build/three.min.js +0 -7
- package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
- package/examples/jsm/objects/GroundProjectedSkybox.js +0 -172
- package/src/renderers/WebGLMultipleRenderTargets.js +0 -82
|
@@ -11,8 +11,6 @@ import {
|
|
|
11
11
|
LinearMipmapLinearFilter,
|
|
12
12
|
SRGBColorSpace,
|
|
13
13
|
LinearSRGBColorSpace,
|
|
14
|
-
sRGBEncoding,
|
|
15
|
-
LinearEncoding,
|
|
16
14
|
RGBAIntegerFormat,
|
|
17
15
|
RGIntegerFormat,
|
|
18
16
|
RedIntegerFormat,
|
|
@@ -496,7 +494,7 @@ class WebGLRenderer {
|
|
|
496
494
|
|
|
497
495
|
}
|
|
498
496
|
|
|
499
|
-
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).
|
|
497
|
+
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );
|
|
500
498
|
|
|
501
499
|
};
|
|
502
500
|
|
|
@@ -518,7 +516,7 @@ class WebGLRenderer {
|
|
|
518
516
|
|
|
519
517
|
}
|
|
520
518
|
|
|
521
|
-
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).
|
|
519
|
+
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );
|
|
522
520
|
|
|
523
521
|
};
|
|
524
522
|
|
|
@@ -1214,7 +1212,11 @@ class WebGLRenderer {
|
|
|
1214
1212
|
|
|
1215
1213
|
//
|
|
1216
1214
|
|
|
1217
|
-
|
|
1215
|
+
if ( xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false ) {
|
|
1216
|
+
|
|
1217
|
+
background.render( currentRenderList, scene );
|
|
1218
|
+
|
|
1219
|
+
}
|
|
1218
1220
|
|
|
1219
1221
|
// render scene
|
|
1220
1222
|
|
|
@@ -1632,6 +1634,7 @@ class WebGLRenderer {
|
|
|
1632
1634
|
materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
1633
1635
|
materialProperties.fog = scene.fog;
|
|
1634
1636
|
materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );
|
|
1637
|
+
materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
|
|
1635
1638
|
|
|
1636
1639
|
if ( programs === undefined ) {
|
|
1637
1640
|
|
|
@@ -1744,6 +1747,7 @@ class WebGLRenderer {
|
|
|
1744
1747
|
materialProperties.batching = parameters.batching;
|
|
1745
1748
|
materialProperties.instancing = parameters.instancing;
|
|
1746
1749
|
materialProperties.instancingColor = parameters.instancingColor;
|
|
1750
|
+
materialProperties.instancingMorph = parameters.instancingMorph;
|
|
1747
1751
|
materialProperties.skinning = parameters.skinning;
|
|
1748
1752
|
materialProperties.morphTargets = parameters.morphTargets;
|
|
1749
1753
|
materialProperties.morphNormals = parameters.morphNormals;
|
|
@@ -1857,6 +1861,14 @@ class WebGLRenderer {
|
|
|
1857
1861
|
|
|
1858
1862
|
needsProgramChange = true;
|
|
1859
1863
|
|
|
1864
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {
|
|
1865
|
+
|
|
1866
|
+
needsProgramChange = true;
|
|
1867
|
+
|
|
1868
|
+
} else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {
|
|
1869
|
+
|
|
1870
|
+
needsProgramChange = true;
|
|
1871
|
+
|
|
1860
1872
|
} else if ( materialProperties.envMap !== envMap ) {
|
|
1861
1873
|
|
|
1862
1874
|
needsProgramChange = true;
|
|
@@ -2502,8 +2514,8 @@ class WebGLRenderer {
|
|
|
2502
2514
|
|
|
2503
2515
|
}
|
|
2504
2516
|
|
|
2505
|
-
const width = sourceBox.max.x - sourceBox.min.x
|
|
2506
|
-
const height = sourceBox.max.y - sourceBox.min.y
|
|
2517
|
+
const width = Math.round( sourceBox.max.x - sourceBox.min.x );
|
|
2518
|
+
const height = Math.round( sourceBox.max.y - sourceBox.min.y );
|
|
2507
2519
|
const depth = sourceBox.max.z - sourceBox.min.z + 1;
|
|
2508
2520
|
const glFormat = utils.convert( dstTexture.format );
|
|
2509
2521
|
const glType = utils.convert( dstTexture.type );
|
|
@@ -2550,9 +2562,8 @@ class WebGLRenderer {
|
|
|
2550
2562
|
|
|
2551
2563
|
} else {
|
|
2552
2564
|
|
|
2553
|
-
if (
|
|
2565
|
+
if ( dstTexture.isCompressedArrayTexture ) {
|
|
2554
2566
|
|
|
2555
|
-
console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
|
|
2556
2567
|
_gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
|
|
2557
2568
|
|
|
2558
2569
|
} else {
|
|
@@ -2641,20 +2652,6 @@ class WebGLRenderer {
|
|
|
2641
2652
|
|
|
2642
2653
|
}
|
|
2643
2654
|
|
|
2644
|
-
get outputEncoding() { // @deprecated, r152
|
|
2645
|
-
|
|
2646
|
-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
|
|
2647
|
-
return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
|
|
2648
|
-
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
set outputEncoding( encoding ) { // @deprecated, r152
|
|
2652
|
-
|
|
2653
|
-
console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
|
|
2654
|
-
this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
|
|
2655
|
-
|
|
2656
|
-
}
|
|
2657
|
-
|
|
2658
2655
|
get useLegacyLights() { // @deprecated, r155
|
|
2659
2656
|
|
|
2660
2657
|
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.' );
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export default /* glsl */`
|
|
2
2
|
#ifdef USE_ALPHATEST
|
|
3
3
|
|
|
4
|
+
#ifdef ALPHA_TO_COVERAGE
|
|
5
|
+
|
|
6
|
+
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
|
7
|
+
if ( diffuseColor.a == 0.0 ) discard;
|
|
8
|
+
|
|
9
|
+
#else
|
|
10
|
+
|
|
4
11
|
if ( diffuseColor.a < alphaTest ) discard;
|
|
5
12
|
|
|
13
|
+
#endif
|
|
14
|
+
|
|
6
15
|
#endif
|
|
7
16
|
`;
|
|
@@ -3,29 +3,74 @@ export default /* glsl */`
|
|
|
3
3
|
|
|
4
4
|
vec4 plane;
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
6
|
+
#ifdef ALPHA_TO_COVERAGE
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
float distanceToPlane, distanceGradient;
|
|
9
|
+
float clipOpacity = 1.0;
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
#pragma unroll_loop_start
|
|
12
|
+
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
13
|
+
|
|
14
|
+
plane = clippingPlanes[ i ];
|
|
15
|
+
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
|
16
|
+
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
|
17
|
+
clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
|
18
|
+
|
|
19
|
+
if ( clipOpacity == 0.0 ) discard;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
#pragma unroll_loop_end
|
|
23
|
+
|
|
24
|
+
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
|
25
|
+
|
|
26
|
+
float unionClipOpacity = 1.0;
|
|
27
|
+
|
|
28
|
+
#pragma unroll_loop_start
|
|
29
|
+
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
|
30
|
+
|
|
31
|
+
plane = clippingPlanes[ i ];
|
|
32
|
+
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
|
33
|
+
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
|
34
|
+
unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
}
|
|
37
|
+
#pragma unroll_loop_end
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
clipOpacity *= 1.0 - unionClipOpacity;
|
|
40
|
+
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
diffuseColor.a *= clipOpacity;
|
|
44
|
+
|
|
45
|
+
if ( diffuseColor.a == 0.0 ) discard;
|
|
46
|
+
|
|
47
|
+
#else
|
|
18
48
|
|
|
19
49
|
#pragma unroll_loop_start
|
|
20
|
-
for ( int i =
|
|
50
|
+
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
21
51
|
|
|
22
52
|
plane = clippingPlanes[ i ];
|
|
23
|
-
|
|
53
|
+
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
|
|
24
54
|
|
|
25
55
|
}
|
|
26
56
|
#pragma unroll_loop_end
|
|
27
57
|
|
|
28
|
-
if
|
|
58
|
+
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
|
59
|
+
|
|
60
|
+
bool clipped = true;
|
|
61
|
+
|
|
62
|
+
#pragma unroll_loop_start
|
|
63
|
+
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
|
64
|
+
|
|
65
|
+
plane = clippingPlanes[ i ];
|
|
66
|
+
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
#pragma unroll_loop_end
|
|
70
|
+
|
|
71
|
+
if ( clipped ) discard;
|
|
72
|
+
|
|
73
|
+
#endif
|
|
29
74
|
|
|
30
75
|
#endif
|
|
31
76
|
|
|
@@ -36,7 +36,7 @@ export default /* glsl */`
|
|
|
36
36
|
|
|
37
37
|
#ifdef ENVMAP_TYPE_CUBE
|
|
38
38
|
|
|
39
|
-
vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
|
|
39
|
+
vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
|
|
40
40
|
|
|
41
41
|
#else
|
|
42
42
|
|
|
@@ -7,7 +7,7 @@ export default /* glsl */`
|
|
|
7
7
|
|
|
8
8
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
9
9
|
|
|
10
|
-
vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
|
|
10
|
+
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
|
|
11
11
|
|
|
12
12
|
return PI * envMapColor.rgb * envMapIntensity;
|
|
13
13
|
|
|
@@ -30,7 +30,7 @@ export default /* glsl */`
|
|
|
30
30
|
|
|
31
31
|
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
|
32
32
|
|
|
33
|
-
vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
|
|
33
|
+
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
|
|
34
34
|
|
|
35
35
|
return envMapColor.rgb * envMapIntensity;
|
|
36
36
|
|
|
@@ -5,7 +5,7 @@ export default /* glsl */`
|
|
|
5
5
|
|
|
6
6
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
7
7
|
|
|
8
|
-
// use inline sRGB decode until browsers properly support
|
|
8
|
+
// use inline sRGB decode until browsers properly support SRGB8_ALPHA8 with video textures (#26516)
|
|
9
9
|
|
|
10
10
|
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
|
|
11
11
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default /* glsl */`
|
|
2
|
+
#ifdef USE_INSTANCING_MORPH
|
|
3
|
+
|
|
4
|
+
float morphTargetInfluences[MORPHTARGETS_COUNT];
|
|
5
|
+
|
|
6
|
+
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
|
7
|
+
|
|
8
|
+
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
9
|
+
|
|
10
|
+
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
#endif
|
|
14
|
+
`;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
export default /* glsl */`
|
|
2
2
|
#ifdef USE_MORPHTARGETS
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
#ifndef USE_INSTANCING_MORPH
|
|
5
|
+
|
|
6
|
+
uniform float morphTargetBaseInfluence;
|
|
7
|
+
|
|
8
|
+
#endif
|
|
5
9
|
|
|
6
10
|
#ifdef MORPHTARGETS_TEXTURE
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
#ifndef USE_INSTANCING_MORPH
|
|
13
|
+
|
|
14
|
+
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
15
|
+
|
|
16
|
+
#endif
|
|
17
|
+
|
|
9
18
|
uniform sampler2DArray morphTargetsTexture;
|
|
10
19
|
uniform ivec2 morphTargetsTextureSize;
|
|
11
20
|
|
|
@@ -105,7 +105,11 @@ vec3 agxDefaultContrastApprox( vec3 x ) {
|
|
|
105
105
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
//
|
|
108
|
+
// AgX Tone Mapping implementation based on Filament, which in turn is based
|
|
109
|
+
// on Blender's implementation using rec 2020 primaries
|
|
110
|
+
// https://github.com/google/filament/pull/7236
|
|
111
|
+
// Inputs and outputs are encoded as Linear-sRGB.
|
|
112
|
+
|
|
109
113
|
vec3 AgXToneMapping( vec3 color ) {
|
|
110
114
|
|
|
111
115
|
// AgX constants
|
|
@@ -122,15 +126,16 @@ vec3 AgXToneMapping( vec3 color ) {
|
|
|
122
126
|
vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
|
|
123
127
|
);
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
// LOG2_MIN = -10.0
|
|
130
|
+
// LOG2_MAX = +6.5
|
|
131
|
+
// MIDDLE_GRAY = 0.18
|
|
132
|
+
const float AgxMinEv = - 12.47393; // log2( pow( 2, LOG2_MIN ) * MIDDLE_GRAY )
|
|
133
|
+
const float AgxMaxEv = 4.026069; // log2( pow( 2, LOG2_MAX ) * MIDDLE_GRAY )
|
|
127
134
|
|
|
128
|
-
// AGX Tone Mapping implementation based on Filament, which is in turn based
|
|
129
|
-
// on Blender's implementation for rec 2020 colors:
|
|
130
|
-
// https://github.com/google/filament/pull/7236
|
|
131
|
-
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
|
|
132
135
|
color *= toneMappingExposure;
|
|
133
136
|
|
|
137
|
+
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
|
|
138
|
+
|
|
134
139
|
color = AgXInsetMatrix * color;
|
|
135
140
|
|
|
136
141
|
// Log2 encoding
|
|
@@ -153,9 +158,35 @@ vec3 AgXToneMapping( vec3 color ) {
|
|
|
153
158
|
|
|
154
159
|
color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
|
|
155
160
|
|
|
161
|
+
// Gamut mapping. Simple clamp for now.
|
|
162
|
+
color = clamp( color, 0.0, 1.0 );
|
|
163
|
+
|
|
156
164
|
return color;
|
|
157
165
|
|
|
158
166
|
}
|
|
159
167
|
|
|
168
|
+
// https://modelviewer.dev/examples/tone-mapping
|
|
169
|
+
|
|
170
|
+
vec3 NeutralToneMapping( vec3 color ) {
|
|
171
|
+
float startCompression = 0.8 - 0.04;
|
|
172
|
+
float desaturation = 0.15;
|
|
173
|
+
|
|
174
|
+
color *= toneMappingExposure;
|
|
175
|
+
|
|
176
|
+
float x = min(color.r, min(color.g, color.b));
|
|
177
|
+
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
|
|
178
|
+
color -= offset;
|
|
179
|
+
|
|
180
|
+
float peak = max(color.r, max(color.g, color.b));
|
|
181
|
+
if (peak < startCompression) return color;
|
|
182
|
+
|
|
183
|
+
float d = 1. - startCompression;
|
|
184
|
+
float newPeak = 1. - d * d / (peak + d - startCompression);
|
|
185
|
+
color *= newPeak / peak;
|
|
186
|
+
|
|
187
|
+
float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);
|
|
188
|
+
return mix(color, vec3(1, 1, 1), g);
|
|
189
|
+
}
|
|
190
|
+
|
|
160
191
|
vec3 CustomToneMapping( vec3 color ) { return color; }
|
|
161
192
|
`;
|
|
@@ -65,6 +65,7 @@ import map_particle_fragment from './ShaderChunk/map_particle_fragment.glsl.js';
|
|
|
65
65
|
import map_particle_pars_fragment from './ShaderChunk/map_particle_pars_fragment.glsl.js';
|
|
66
66
|
import metalnessmap_fragment from './ShaderChunk/metalnessmap_fragment.glsl.js';
|
|
67
67
|
import metalnessmap_pars_fragment from './ShaderChunk/metalnessmap_pars_fragment.glsl.js';
|
|
68
|
+
import morphinstance_vertex from './ShaderChunk/morphinstance_vertex.glsl.js';
|
|
68
69
|
import morphcolor_vertex from './ShaderChunk/morphcolor_vertex.glsl.js';
|
|
69
70
|
import morphnormal_vertex from './ShaderChunk/morphnormal_vertex.glsl.js';
|
|
70
71
|
import morphtarget_pars_vertex from './ShaderChunk/morphtarget_pars_vertex.glsl.js';
|
|
@@ -192,6 +193,7 @@ export const ShaderChunk = {
|
|
|
192
193
|
map_particle_pars_fragment: map_particle_pars_fragment,
|
|
193
194
|
metalnessmap_fragment: metalnessmap_fragment,
|
|
194
195
|
metalnessmap_pars_fragment: metalnessmap_pars_fragment,
|
|
196
|
+
morphinstance_vertex: morphinstance_vertex,
|
|
195
197
|
morphcolor_vertex: morphcolor_vertex,
|
|
196
198
|
morphnormal_vertex: morphnormal_vertex,
|
|
197
199
|
morphtarget_pars_vertex: morphtarget_pars_vertex,
|
|
@@ -30,6 +30,7 @@ export const fragment = /* glsl */`
|
|
|
30
30
|
uniform float flipEnvMap;
|
|
31
31
|
uniform float backgroundBlurriness;
|
|
32
32
|
uniform float backgroundIntensity;
|
|
33
|
+
uniform mat3 backgroundRotation;
|
|
33
34
|
|
|
34
35
|
varying vec3 vWorldDirection;
|
|
35
36
|
|
|
@@ -39,11 +40,11 @@ void main() {
|
|
|
39
40
|
|
|
40
41
|
#ifdef ENVMAP_TYPE_CUBE
|
|
41
42
|
|
|
42
|
-
vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
|
|
43
|
+
vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
|
|
43
44
|
|
|
44
45
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
45
46
|
|
|
46
|
-
vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );
|
|
47
|
+
vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
|
|
47
48
|
|
|
48
49
|
#else
|
|
49
50
|
|
|
@@ -20,6 +20,8 @@ void main() {
|
|
|
20
20
|
#include <batching_vertex>
|
|
21
21
|
#include <skinbase_vertex>
|
|
22
22
|
|
|
23
|
+
#include <morphinstance_vertex>
|
|
24
|
+
|
|
23
25
|
#ifdef USE_DISPLACEMENTMAP
|
|
24
26
|
|
|
25
27
|
#include <beginnormal_vertex>
|
|
@@ -62,9 +64,8 @@ varying vec2 vHighPrecisionZW;
|
|
|
62
64
|
|
|
63
65
|
void main() {
|
|
64
66
|
|
|
65
|
-
#include <clipping_planes_fragment>
|
|
66
|
-
|
|
67
67
|
vec4 diffuseColor = vec4( 1.0 );
|
|
68
|
+
#include <clipping_planes_fragment>
|
|
68
69
|
|
|
69
70
|
#if DEPTH_PACKING == 3200
|
|
70
71
|
|
|
@@ -18,6 +18,8 @@ void main() {
|
|
|
18
18
|
#include <batching_vertex>
|
|
19
19
|
#include <skinbase_vertex>
|
|
20
20
|
|
|
21
|
+
#include <morphinstance_vertex>
|
|
22
|
+
|
|
21
23
|
#ifdef USE_DISPLACEMENTMAP
|
|
22
24
|
|
|
23
25
|
#include <beginnormal_vertex>
|
|
@@ -58,9 +60,8 @@ varying vec3 vWorldPosition;
|
|
|
58
60
|
|
|
59
61
|
void main () {
|
|
60
62
|
|
|
61
|
-
#include <clipping_planes_fragment>
|
|
62
|
-
|
|
63
63
|
vec4 diffuseColor = vec4( 1.0 );
|
|
64
|
+
#include <clipping_planes_fragment>
|
|
64
65
|
|
|
65
66
|
#include <map_fragment>
|
|
66
67
|
#include <alphamap_fragment>
|
|
@@ -18,6 +18,7 @@ void main() {
|
|
|
18
18
|
|
|
19
19
|
#include <uv_vertex>
|
|
20
20
|
#include <color_vertex>
|
|
21
|
+
#include <morphinstance_vertex>
|
|
21
22
|
#include <morphcolor_vertex>
|
|
22
23
|
#include <begin_vertex>
|
|
23
24
|
#include <morphtarget_vertex>
|
|
@@ -48,6 +49,7 @@ varying float vLineDistance;
|
|
|
48
49
|
|
|
49
50
|
void main() {
|
|
50
51
|
|
|
52
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
51
53
|
#include <clipping_planes_fragment>
|
|
52
54
|
|
|
53
55
|
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
|
@@ -57,7 +59,6 @@ void main() {
|
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
vec3 outgoingLight = vec3( 0.0 );
|
|
60
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
61
62
|
|
|
62
63
|
#include <logdepthbuf_fragment>
|
|
63
64
|
#include <map_fragment>
|
|
@@ -14,6 +14,7 @@ void main() {
|
|
|
14
14
|
|
|
15
15
|
#include <uv_vertex>
|
|
16
16
|
#include <color_vertex>
|
|
17
|
+
#include <morphinstance_vertex>
|
|
17
18
|
#include <morphcolor_vertex>
|
|
18
19
|
#include <batching_vertex>
|
|
19
20
|
|
|
@@ -70,9 +71,8 @@ uniform float opacity;
|
|
|
70
71
|
|
|
71
72
|
void main() {
|
|
72
73
|
|
|
73
|
-
#include <clipping_planes_fragment>
|
|
74
|
-
|
|
75
74
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
75
|
+
#include <clipping_planes_fragment>
|
|
76
76
|
|
|
77
77
|
#include <logdepthbuf_fragment>
|
|
78
78
|
#include <map_fragment>
|
|
@@ -21,6 +21,7 @@ void main() {
|
|
|
21
21
|
|
|
22
22
|
#include <uv_vertex>
|
|
23
23
|
#include <color_vertex>
|
|
24
|
+
#include <morphinstance_vertex>
|
|
24
25
|
#include <morphcolor_vertex>
|
|
25
26
|
#include <batching_vertex>
|
|
26
27
|
|
|
@@ -84,9 +85,9 @@ uniform float opacity;
|
|
|
84
85
|
|
|
85
86
|
void main() {
|
|
86
87
|
|
|
88
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
87
89
|
#include <clipping_planes_fragment>
|
|
88
90
|
|
|
89
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
90
91
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
91
92
|
vec3 totalEmissiveRadiance = emissive;
|
|
92
93
|
|
|
@@ -20,6 +20,7 @@ void main() {
|
|
|
20
20
|
|
|
21
21
|
#include <uv_vertex>
|
|
22
22
|
#include <color_vertex>
|
|
23
|
+
#include <morphinstance_vertex>
|
|
23
24
|
#include <morphcolor_vertex>
|
|
24
25
|
#include <batching_vertex>
|
|
25
26
|
|
|
@@ -71,9 +72,8 @@ varying vec3 vViewPosition;
|
|
|
71
72
|
|
|
72
73
|
void main() {
|
|
73
74
|
|
|
74
|
-
#include <clipping_planes_fragment>
|
|
75
|
-
|
|
76
75
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
76
|
+
#include <clipping_planes_fragment>
|
|
77
77
|
|
|
78
78
|
#include <logdepthbuf_fragment>
|
|
79
79
|
#include <map_fragment>
|
|
@@ -23,6 +23,7 @@ void main() {
|
|
|
23
23
|
#include <batching_vertex>
|
|
24
24
|
|
|
25
25
|
#include <beginnormal_vertex>
|
|
26
|
+
#include <morphinstance_vertex>
|
|
26
27
|
#include <morphnormal_vertex>
|
|
27
28
|
#include <skinbase_vertex>
|
|
28
29
|
#include <skinnormal_vertex>
|
|
@@ -67,12 +68,14 @@ uniform float opacity;
|
|
|
67
68
|
|
|
68
69
|
void main() {
|
|
69
70
|
|
|
71
|
+
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
|
|
72
|
+
|
|
70
73
|
#include <clipping_planes_fragment>
|
|
71
74
|
#include <logdepthbuf_fragment>
|
|
72
75
|
#include <normal_fragment_begin>
|
|
73
76
|
#include <normal_fragment_maps>
|
|
74
77
|
|
|
75
|
-
gl_FragColor = vec4( packNormalToRGB( normal ),
|
|
78
|
+
gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
|
|
76
79
|
|
|
77
80
|
#ifdef OPAQUE
|
|
78
81
|
|
|
@@ -25,6 +25,7 @@ void main() {
|
|
|
25
25
|
#include <batching_vertex>
|
|
26
26
|
|
|
27
27
|
#include <beginnormal_vertex>
|
|
28
|
+
#include <morphinstance_vertex>
|
|
28
29
|
#include <morphnormal_vertex>
|
|
29
30
|
#include <skinbase_vertex>
|
|
30
31
|
#include <skinnormal_vertex>
|
|
@@ -86,9 +87,9 @@ uniform float opacity;
|
|
|
86
87
|
|
|
87
88
|
void main() {
|
|
88
89
|
|
|
90
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
89
91
|
#include <clipping_planes_fragment>
|
|
90
92
|
|
|
91
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
92
93
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
93
94
|
vec3 totalEmissiveRadiance = emissive;
|
|
94
95
|
|
|
@@ -26,6 +26,7 @@ void main() {
|
|
|
26
26
|
|
|
27
27
|
#include <uv_vertex>
|
|
28
28
|
#include <color_vertex>
|
|
29
|
+
#include <morphinstance_vertex>
|
|
29
30
|
#include <morphcolor_vertex>
|
|
30
31
|
#include <batching_vertex>
|
|
31
32
|
|
|
@@ -157,9 +158,9 @@ varying vec3 vViewPosition;
|
|
|
157
158
|
|
|
158
159
|
void main() {
|
|
159
160
|
|
|
161
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
160
162
|
#include <clipping_planes_fragment>
|
|
161
163
|
|
|
162
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
163
164
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
164
165
|
vec3 totalEmissiveRadiance = emissive;
|
|
165
166
|
|
|
@@ -20,6 +20,7 @@ void main() {
|
|
|
20
20
|
|
|
21
21
|
#include <uv_vertex>
|
|
22
22
|
#include <color_vertex>
|
|
23
|
+
#include <morphinstance_vertex>
|
|
23
24
|
#include <morphcolor_vertex>
|
|
24
25
|
#include <batching_vertex>
|
|
25
26
|
|
|
@@ -80,9 +81,9 @@ uniform float opacity;
|
|
|
80
81
|
|
|
81
82
|
void main() {
|
|
82
83
|
|
|
84
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
83
85
|
#include <clipping_planes_fragment>
|
|
84
86
|
|
|
85
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
86
87
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
87
88
|
vec3 totalEmissiveRadiance = emissive;
|
|
88
89
|
|
|
@@ -25,6 +25,7 @@ void main() {
|
|
|
25
25
|
#endif
|
|
26
26
|
|
|
27
27
|
#include <color_vertex>
|
|
28
|
+
#include <morphinstance_vertex>
|
|
28
29
|
#include <morphcolor_vertex>
|
|
29
30
|
#include <begin_vertex>
|
|
30
31
|
#include <morphtarget_vertex>
|
|
@@ -63,10 +64,10 @@ uniform float opacity;
|
|
|
63
64
|
|
|
64
65
|
void main() {
|
|
65
66
|
|
|
67
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
66
68
|
#include <clipping_planes_fragment>
|
|
67
69
|
|
|
68
70
|
vec3 outgoingLight = vec3( 0.0 );
|
|
69
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
70
71
|
|
|
71
72
|
#include <logdepthbuf_fragment>
|
|
72
73
|
#include <map_particle_fragment>
|
|
@@ -59,10 +59,10 @@ uniform float opacity;
|
|
|
59
59
|
|
|
60
60
|
void main() {
|
|
61
61
|
|
|
62
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
62
63
|
#include <clipping_planes_fragment>
|
|
63
64
|
|
|
64
65
|
vec3 outgoingLight = vec3( 0.0 );
|
|
65
|
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
66
66
|
|
|
67
67
|
#include <logdepthbuf_fragment>
|
|
68
68
|
#include <map_fragment>
|
|
@@ -232,7 +232,8 @@ const ShaderLib = {
|
|
|
232
232
|
envMap: { value: null },
|
|
233
233
|
flipEnvMap: { value: - 1 },
|
|
234
234
|
backgroundBlurriness: { value: 0 },
|
|
235
|
-
backgroundIntensity: { value: 1 }
|
|
235
|
+
backgroundIntensity: { value: 1 },
|
|
236
|
+
backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
|
|
236
237
|
},
|
|
237
238
|
|
|
238
239
|
vertexShader: ShaderChunk.backgroundCube_vert,
|