super-three 0.152.0 → 0.154.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +778 -557
- package/build/three.js +778 -557
- package/build/three.min.js +1 -1
- package/build/three.module.js +769 -539
- package/build/three.module.min.js +1 -1
- package/examples/jsm/cameras/CinematicCamera.js +1 -2
- package/examples/jsm/capabilities/WebGPU.js +15 -1
- package/examples/jsm/controls/ArcballControls.js +2 -1
- package/examples/jsm/controls/FlyControls.js +25 -9
- package/examples/jsm/controls/OrbitControls.js +5 -1
- package/examples/jsm/csm/CSM.js +1 -3
- package/examples/jsm/effects/AnaglyphEffect.js +6 -20
- package/examples/jsm/effects/OutlineEffect.js +1 -1
- package/examples/jsm/effects/ParallaxBarrierEffect.js +3 -0
- package/examples/jsm/environments/RoomEnvironment.js +6 -2
- package/examples/jsm/exporters/GLTFExporter.js +74 -2
- package/examples/jsm/exporters/USDZExporter.js +170 -129
- package/examples/jsm/helpers/ViewHelper.js +1 -1
- package/examples/jsm/lines/LineMaterial.js +1 -1
- package/examples/jsm/loaders/3DMLoader.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +5 -1
- package/examples/jsm/loaders/AMFLoader.js +5 -1
- package/examples/jsm/loaders/ColladaLoader.js +4 -1
- package/examples/jsm/loaders/DRACOLoader.js +2 -0
- package/examples/jsm/loaders/FBXLoader.js +9 -2
- package/examples/jsm/loaders/GLTFLoader.js +230 -94
- package/examples/jsm/loaders/KTX2Loader.js +106 -47
- package/examples/jsm/loaders/LDrawLoader.js +4 -7
- package/examples/jsm/loaders/MMDLoader.js +40 -13
- package/examples/jsm/loaders/PCDLoader.js +25 -10
- package/examples/jsm/loaders/PDBLoader.js +7 -2
- package/examples/jsm/loaders/PLYLoader.js +30 -8
- package/examples/jsm/loaders/STLLoader.js +8 -3
- package/examples/jsm/loaders/VRMLLoader.js +55 -7
- package/examples/jsm/loaders/VTKLoader.js +12 -4
- package/examples/jsm/loaders/XYZLoader.js +9 -3
- package/examples/jsm/materials/MeshGouraudMaterial.js +2 -2
- package/examples/jsm/math/Lut.js +5 -4
- package/examples/jsm/math/MeshSurfaceSampler.js +82 -37
- package/examples/jsm/misc/GPUComputationRenderer.js +1 -0
- package/examples/jsm/misc/VolumeSlice.js +3 -1
- package/examples/jsm/nodes/Nodes.js +22 -16
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +99 -0
- package/examples/jsm/nodes/accessors/BufferNode.js +2 -2
- package/examples/jsm/nodes/accessors/CameraNode.js +25 -4
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +7 -1
- package/examples/jsm/nodes/accessors/InstanceNode.js +29 -12
- package/examples/jsm/nodes/accessors/MaterialNode.js +55 -47
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -2
- package/examples/jsm/nodes/accessors/ModelNode.js +3 -1
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +4 -9
- package/examples/jsm/nodes/accessors/MorphNode.js +70 -0
- package/examples/jsm/nodes/accessors/NormalNode.js +3 -2
- package/examples/jsm/nodes/accessors/Object3DNode.js +10 -2
- package/examples/jsm/nodes/accessors/ReferenceNode.js +2 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +46 -0
- package/examples/jsm/nodes/accessors/SkinningNode.js +43 -62
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +2 -2
- package/examples/jsm/nodes/accessors/TangentNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +94 -0
- package/examples/jsm/nodes/accessors/TextureNode.js +68 -6
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +35 -0
- package/examples/jsm/nodes/accessors/UVNode.js +1 -1
- package/examples/jsm/nodes/code/CodeNode.js +3 -0
- package/examples/jsm/nodes/code/FunctionNode.js +25 -4
- package/examples/jsm/nodes/core/AttributeNode.js +1 -1
- package/examples/jsm/nodes/core/BypassNode.js +2 -2
- package/examples/jsm/nodes/core/ContextNode.js +2 -0
- package/examples/jsm/nodes/core/IndexNode.js +66 -0
- package/examples/jsm/nodes/core/LightingModel.js +2 -1
- package/examples/jsm/nodes/core/Node.js +13 -16
- package/examples/jsm/nodes/core/NodeAttribute.js +2 -1
- package/examples/jsm/nodes/core/NodeBuilder.js +86 -8
- package/examples/jsm/nodes/core/NodeUtils.js +10 -0
- package/examples/jsm/nodes/core/PropertyNode.js +6 -2
- package/examples/jsm/nodes/core/StackNode.js +8 -1
- package/examples/jsm/nodes/core/UniformNode.js +1 -1
- package/examples/jsm/nodes/core/VarNode.js +1 -3
- package/examples/jsm/nodes/display/BlendModeNode.js +9 -9
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +7 -7
- package/examples/jsm/nodes/display/ColorSpaceNode.js +50 -49
- package/examples/jsm/nodes/display/NormalMapNode.js +3 -3
- package/examples/jsm/nodes/display/ToneMappingNode.js +24 -15
- package/examples/jsm/nodes/display/ViewportDepthNode.js +69 -0
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +34 -0
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +7 -6
- package/examples/jsm/nodes/display/ViewportTextureNode.js +33 -19
- package/examples/jsm/nodes/functions/BSDF/BRDF_BlinnPhong.js +5 -5
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +10 -8
- package/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.js +43 -0
- package/examples/jsm/nodes/functions/BSDF/DFGApprox.js +4 -4
- package/examples/jsm/nodes/functions/BSDF/D_GGX.js +2 -2
- package/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js +13 -0
- package/examples/jsm/nodes/functions/BSDF/F_Schlick.js +2 -4
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/examples/jsm/nodes/functions/PhongLightingModel.js +7 -7
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +132 -19
- package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/examples/jsm/nodes/functions/material/getRoughness.js +3 -3
- package/examples/jsm/nodes/geometry/RangeNode.js +33 -51
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +6 -3
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +107 -62
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightUtils.js +2 -2
- package/examples/jsm/nodes/lighting/LightingContextNode.js +17 -15
- package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/SpotLightNode.js +3 -3
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -15
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -15
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -10
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -9
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +41 -0
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +1 -14
- package/examples/jsm/nodes/materials/NodeMaterial.js +119 -29
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -9
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -7
- package/examples/jsm/nodes/materialx/lib/mx_hsv.js +3 -3
- package/examples/jsm/nodes/materialx/lib/mx_noise.js +14 -14
- package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +4 -4
- package/examples/jsm/nodes/math/MathNode.js +6 -0
- package/examples/jsm/nodes/math/OperatorNode.js +1 -1
- package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
- package/examples/jsm/nodes/shadernode/ShaderNode.js +60 -33
- package/examples/jsm/nodes/utils/EquirectUVNode.js +2 -3
- package/examples/jsm/nodes/utils/LoopNode.js +186 -0
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +1 -1
- package/examples/jsm/objects/GroundProjectedSkybox.js +1 -1
- package/examples/jsm/objects/Lensflare.js +3 -4
- package/examples/jsm/objects/MarchingCubes.js +5 -1
- package/examples/jsm/objects/Reflector.js +4 -1
- package/examples/jsm/objects/Refractor.js +1 -1
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/Water.js +2 -1
- package/examples/jsm/objects/Water2.js +1 -1
- package/examples/jsm/offscreen/scene.js +1 -0
- package/examples/jsm/physics/RapierPhysics.js +93 -133
- package/examples/jsm/postprocessing/AfterimagePass.js +3 -0
- package/examples/jsm/postprocessing/BloomPass.js +7 -2
- package/examples/jsm/postprocessing/BokehPass.js +3 -2
- package/examples/jsm/postprocessing/DotScreenPass.js +1 -0
- package/examples/jsm/postprocessing/EffectComposer.js +4 -1
- package/examples/jsm/postprocessing/FilmPass.js +1 -0
- package/examples/jsm/postprocessing/OutlinePass.js +8 -9
- package/examples/jsm/postprocessing/OutputPass.js +72 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +4 -3
- package/examples/jsm/postprocessing/SAOPass.js +4 -2
- package/examples/jsm/postprocessing/SMAAPass.js +5 -2
- package/examples/jsm/postprocessing/SSAARenderPass.js +5 -13
- package/examples/jsm/postprocessing/SSAOPass.js +4 -2
- package/examples/jsm/postprocessing/SSRPass.js +3 -1
- package/examples/jsm/postprocessing/SavePass.js +5 -2
- package/examples/jsm/postprocessing/ShaderPass.js +1 -0
- package/examples/jsm/postprocessing/TAARenderPass.js +17 -4
- package/examples/jsm/postprocessing/TexturePass.js +2 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +13 -13
- package/examples/jsm/renderers/{webgpu/WebGPUAnimation.js → common/Animation.js} +2 -2
- package/examples/jsm/renderers/common/Attributes.js +75 -0
- package/examples/jsm/renderers/common/Backend.js +162 -0
- package/examples/jsm/renderers/common/Background.js +134 -0
- package/examples/jsm/renderers/common/Binding.js +11 -0
- package/examples/jsm/renderers/common/Bindings.js +169 -0
- package/examples/jsm/renderers/common/Buffer.js +38 -0
- package/examples/jsm/renderers/{webgpu/WebGPUBufferUtils.js → common/BufferUtils.js} +2 -2
- package/examples/jsm/renderers/{webgpu/WebGPUWeakMap.js → common/ChainMap.js} +11 -5
- package/examples/jsm/renderers/common/ComputePipeline.js +17 -0
- package/examples/jsm/renderers/common/Constants.js +14 -0
- package/examples/jsm/renderers/common/CubeRenderTarget.js +65 -0
- package/examples/jsm/renderers/common/DataMap.js +54 -0
- package/examples/jsm/renderers/{webgpu/WebGPUGeometries.js → common/Geometries.js} +38 -37
- package/examples/jsm/renderers/{webgpu/WebGPUInfo.js → common/Info.js} +2 -3
- package/examples/jsm/renderers/common/Pipeline.js +13 -0
- package/examples/jsm/renderers/common/Pipelines.js +321 -0
- package/examples/jsm/renderers/common/ProgrammableStage.js +18 -0
- package/examples/jsm/renderers/common/RenderContext.js +37 -0
- package/examples/jsm/renderers/common/RenderContexts.js +38 -0
- package/examples/jsm/renderers/{webgpu/WebGPURenderLists.js → common/RenderList.js} +2 -39
- package/examples/jsm/renderers/common/RenderLists.js +38 -0
- package/examples/jsm/renderers/common/RenderObject.js +113 -0
- package/examples/jsm/renderers/common/RenderObjects.js +92 -0
- package/examples/jsm/renderers/common/RenderPipeline.js +16 -0
- package/examples/jsm/renderers/{webgpu/WebGPURenderTarget.js → common/RenderTarget.js} +2 -2
- package/examples/jsm/renderers/common/Renderer.js +864 -0
- package/examples/jsm/renderers/common/SampledTexture.js +80 -0
- package/examples/jsm/renderers/common/Sampler.js +18 -0
- package/examples/jsm/renderers/common/StorageBuffer.js +17 -0
- package/examples/jsm/renderers/common/Textures.js +206 -0
- package/examples/jsm/renderers/{webgpu/WebGPUUniform.js → common/Uniform.js} +13 -9
- package/examples/jsm/renderers/common/UniformBuffer.js +15 -0
- package/examples/jsm/renderers/{webgpu/WebGPUUniformsGroup.js → common/UniformsGroup.js} +13 -13
- package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodes.js → common/nodes/NodeRender.js} +3 -3
- package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeSampledTexture.js → common/nodes/NodeSampledTexture.js} +4 -4
- package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeSampler.js → common/nodes/NodeSampler.js} +3 -3
- package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeUniform.js → common/nodes/NodeUniform.js} +1 -1
- package/examples/jsm/renderers/common/nodes/Nodes.js +319 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +340 -0
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +23 -19
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +847 -0
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +15 -1131
- package/examples/jsm/renderers/webgpu/nodes/{WebGPUNodeBuilder.js → WGSLNodeBuilder.js} +75 -45
- package/examples/jsm/{nodes/parsers → renderers/webgpu/nodes}/WGSLNodeFunction.js +2 -2
- package/examples/jsm/{nodes/parsers → renderers/webgpu/nodes}/WGSLNodeParser.js +1 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +255 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +145 -0
- package/examples/jsm/renderers/webgpu/{constants.js → utils/WebGPUConstants.js} +6 -7
- package/examples/jsm/renderers/webgpu/{WebGPURenderPipeline.js → utils/WebGPUPipelineUtils.js} +154 -247
- package/examples/jsm/renderers/webgpu/{WebGPUTextureUtils.js → utils/WebGPUTextureMipmapUtils.js} +3 -25
- package/examples/jsm/renderers/webgpu/{WebGPUTextures.js → utils/WebGPUTextureUtils.js} +392 -505
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +92 -0
- package/examples/jsm/shaders/BleachBypassShader.js +2 -0
- package/examples/jsm/shaders/BlendShader.js +1 -2
- package/examples/jsm/shaders/BokehShader2.js +3 -0
- package/examples/jsm/shaders/ColorifyShader.js +2 -0
- package/examples/jsm/shaders/ConvolutionShader.js +2 -0
- package/examples/jsm/shaders/CopyShader.js +4 -2
- package/examples/jsm/shaders/DotScreenShader.js +2 -0
- package/examples/jsm/shaders/ExposureShader.js +44 -0
- package/examples/jsm/shaders/FilmShader.js +2 -0
- package/examples/jsm/shaders/GammaCorrectionShader.js +2 -0
- package/examples/jsm/shaders/HorizontalBlurShader.js +2 -0
- package/examples/jsm/shaders/OutputShader.js +61 -0
- package/examples/jsm/shaders/RGBShiftShader.js +2 -0
- package/examples/jsm/shaders/SepiaShader.js +2 -0
- package/examples/jsm/shaders/ToonShader.js +13 -5
- package/examples/jsm/shaders/VerticalBlurShader.js +2 -0
- package/examples/jsm/shaders/VignetteShader.js +2 -0
- package/examples/jsm/shaders/WaterRefractionShader.js +5 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +17 -1
- package/examples/jsm/utils/TextureUtils.js +86 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +34 -13
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +1 -0
- package/examples/jsm/webxr/XRPlanes.js +100 -0
- package/package.json +3 -1
- package/src/Three.Legacy.js +0 -228
- package/src/audio/PositionalAudio.js +8 -0
- package/src/cameras/Camera.js +5 -0
- package/src/cameras/CubeCamera.js +76 -13
- package/src/cameras/OrthographicCamera.js +1 -1
- package/src/cameras/PerspectiveCamera.js +1 -1
- package/src/constants.js +13 -1
- package/src/core/BufferAttribute.js +3 -25
- package/src/core/BufferGeometry.js +1 -8
- package/src/core/Object3D.js +1 -1
- package/src/extras/core/Curve.js +1 -1
- package/src/loaders/CubeTextureLoader.js +2 -0
- package/src/loaders/Loader.js +2 -0
- package/src/loaders/MaterialLoader.js +5 -0
- package/src/loaders/ObjectLoader.js +1 -0
- package/src/materials/Material.js +13 -1
- package/src/materials/MeshPhysicalMaterial.js +32 -6
- package/src/math/Color.js +16 -11
- package/src/math/Frustum.js +16 -2
- package/src/math/MathUtils.js +16 -0
- package/src/math/Matrix3.js +26 -6
- package/src/math/Matrix4.js +74 -19
- package/src/objects/InstancedMesh.js +3 -0
- package/src/objects/Mesh.js +14 -10
- package/src/objects/Skeleton.js +1 -3
- package/src/objects/SkinnedMesh.js +36 -8
- package/src/renderers/WebGLRenderer.js +126 -21
- package/src/renderers/shaders/ShaderChunk/alphahash_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/alphahash_pars_fragment.glsl.js +68 -0
- package/src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +26 -3
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +26 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -2
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +10 -2
- package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/{output_fragment.glsl.js → opaque_fragment.glsl.js} +1 -2
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +10 -5
- package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +6 -1
- package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +7 -1
- package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +6 -1
- package/src/renderers/shaders/ShaderChunk.js +10 -6
- package/src/renderers/shaders/ShaderLib/background.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/cube.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/equirect.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +12 -2
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/points.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +4 -2
- package/src/renderers/shaders/ShaderLib.js +4 -1
- package/src/renderers/shaders/UniformsLib.js +2 -0
- package/src/renderers/webgl/WebGLBindingStates.js +13 -5
- package/src/renderers/webgl/WebGLGeometries.js +12 -0
- package/src/renderers/webgl/WebGLInfo.js +0 -1
- package/src/renderers/webgl/WebGLMaterials.js +18 -0
- package/src/renderers/webgl/WebGLObjects.js +23 -3
- package/src/renderers/webgl/WebGLProgram.js +43 -5
- package/src/renderers/webgl/WebGLPrograms.js +19 -7
- package/src/renderers/webgl/WebGLTextures.js +19 -1
- package/src/renderers/webvr/WebVRManager.js +12 -0
- package/src/renderers/webxr/WebXRManager.js +39 -99
- package/src/scenes/Scene.js +0 -14
- package/src/textures/DepthTexture.js +22 -0
- package/src/textures/FramebufferTexture.js +1 -3
- package/src/textures/Source.js +4 -0
- package/src/textures/Texture.js +1 -1
- package/examples/jsm/exporters/ColladaExporter.js +0 -725
- package/examples/jsm/geometries/LightningStrike.js +0 -1017
- package/examples/jsm/loaders/PRWMLoader.js +0 -299
- package/examples/jsm/nodes/core/InstanceIndexNode.js +0 -26
- package/examples/jsm/objects/LightningStorm.js +0 -245
- package/examples/jsm/postprocessing/AdaptiveToneMappingPass.js +0 -361
- package/examples/jsm/renderers/webgpu/WebGPUAttributes.js +0 -197
- package/examples/jsm/renderers/webgpu/WebGPUBackground.js +0 -190
- package/examples/jsm/renderers/webgpu/WebGPUBinding.js +0 -22
- package/examples/jsm/renderers/webgpu/WebGPUBindings.js +0 -270
- package/examples/jsm/renderers/webgpu/WebGPUBuffer.js +0 -43
- package/examples/jsm/renderers/webgpu/WebGPUComputePipelines.js +0 -78
- package/examples/jsm/renderers/webgpu/WebGPUProgrammableStage.js +0 -22
- package/examples/jsm/renderers/webgpu/WebGPUProperties.js +0 -44
- package/examples/jsm/renderers/webgpu/WebGPURenderObject.js +0 -40
- package/examples/jsm/renderers/webgpu/WebGPURenderObjects.js +0 -50
- package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +0 -274
- package/examples/jsm/renderers/webgpu/WebGPURenderStates.js +0 -54
- package/examples/jsm/renderers/webgpu/WebGPUSampledTexture.js +0 -75
- package/examples/jsm/renderers/webgpu/WebGPUSampler.js +0 -29
- package/examples/jsm/renderers/webgpu/WebGPUStorageBuffer.js +0 -20
- package/examples/jsm/renderers/webgpu/WebGPUTextureRenderer.js +0 -38
- package/examples/jsm/renderers/webgpu/WebGPUUniformBuffer.js +0 -18
- package/examples/jsm/renderers/webgpu/WebGPUUtils.js +0 -88
- package/examples/jsm/shaders/ToneMapShader.js +0 -73
- /package/src/renderers/shaders/ShaderChunk/{encodings_fragment.glsl.js → colorspace_fragment.glsl.js} +0 -0
- /package/src/renderers/shaders/ShaderChunk/{encodings_pars_fragment.glsl.js → colorspace_pars_fragment.glsl.js} +0 -0
package/build/three.js
CHANGED
|
@@ -10,7 +10,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
10
10
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
|
|
11
11
|
})(this, (function (exports) { 'use strict';
|
|
12
12
|
|
|
13
|
-
const REVISION = '
|
|
13
|
+
const REVISION = '154';
|
|
14
14
|
|
|
15
15
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
16
16
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -185,6 +185,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
185
185
|
const GreaterEqualStencilFunc = 518;
|
|
186
186
|
const AlwaysStencilFunc = 519;
|
|
187
187
|
|
|
188
|
+
const NeverCompare = 512;
|
|
189
|
+
const LessCompare = 513;
|
|
190
|
+
const EqualCompare = 514;
|
|
191
|
+
const LessEqualCompare = 515;
|
|
192
|
+
const GreaterCompare = 516;
|
|
193
|
+
const NotEqualCompare = 517;
|
|
194
|
+
const GreaterEqualCompare = 518;
|
|
195
|
+
const AlwaysCompare = 519;
|
|
196
|
+
|
|
188
197
|
const StaticDrawUsage = 35044;
|
|
189
198
|
const DynamicDrawUsage = 35048;
|
|
190
199
|
const StreamDrawUsage = 35040;
|
|
@@ -200,6 +209,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
200
209
|
|
|
201
210
|
const _SRGBAFormat = 1035; // fallback for WebGL 1
|
|
202
211
|
|
|
212
|
+
const WebGLCoordinateSystem = 2000;
|
|
213
|
+
const WebGPUCoordinateSystem = 2001;
|
|
214
|
+
|
|
203
215
|
/**
|
|
204
216
|
* https://github.com/mrdoob/eventdispatcher.js/
|
|
205
217
|
*/
|
|
@@ -522,6 +534,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
522
534
|
|
|
523
535
|
return value;
|
|
524
536
|
|
|
537
|
+
case Uint32Array:
|
|
538
|
+
|
|
539
|
+
return value / 4294967295.0;
|
|
540
|
+
|
|
525
541
|
case Uint16Array:
|
|
526
542
|
|
|
527
543
|
return value / 65535.0;
|
|
@@ -530,6 +546,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
530
546
|
|
|
531
547
|
return value / 255.0;
|
|
532
548
|
|
|
549
|
+
case Int32Array:
|
|
550
|
+
|
|
551
|
+
return Math.max( value / 2147483647.0, - 1.0 );
|
|
552
|
+
|
|
533
553
|
case Int16Array:
|
|
534
554
|
|
|
535
555
|
return Math.max( value / 32767.0, - 1.0 );
|
|
@@ -554,6 +574,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
554
574
|
|
|
555
575
|
return value;
|
|
556
576
|
|
|
577
|
+
case Uint32Array:
|
|
578
|
+
|
|
579
|
+
return Math.round( value * 4294967295.0 );
|
|
580
|
+
|
|
557
581
|
case Uint16Array:
|
|
558
582
|
|
|
559
583
|
return Math.round( value * 65535.0 );
|
|
@@ -562,6 +586,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
562
586
|
|
|
563
587
|
return Math.round( value * 255.0 );
|
|
564
588
|
|
|
589
|
+
case Int32Array:
|
|
590
|
+
|
|
591
|
+
return Math.round( value * 2147483647.0 );
|
|
592
|
+
|
|
565
593
|
case Int16Array:
|
|
566
594
|
|
|
567
595
|
return Math.round( value * 32767.0 );
|
|
@@ -1084,7 +1112,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1084
1112
|
|
|
1085
1113
|
class Matrix3 {
|
|
1086
1114
|
|
|
1087
|
-
constructor() {
|
|
1115
|
+
constructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
|
|
1088
1116
|
|
|
1089
1117
|
Matrix3.prototype.isMatrix3 = true;
|
|
1090
1118
|
|
|
@@ -1096,6 +1124,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1096
1124
|
|
|
1097
1125
|
];
|
|
1098
1126
|
|
|
1127
|
+
if ( n11 !== undefined ) {
|
|
1128
|
+
|
|
1129
|
+
this.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );
|
|
1130
|
+
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1099
1133
|
}
|
|
1100
1134
|
|
|
1101
1135
|
set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
|
|
@@ -1345,13 +1379,27 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1345
1379
|
|
|
1346
1380
|
makeTranslation( x, y ) {
|
|
1347
1381
|
|
|
1348
|
-
|
|
1382
|
+
if ( x.isVector2 ) {
|
|
1349
1383
|
|
|
1350
|
-
|
|
1351
|
-
0, 1, y,
|
|
1352
|
-
0, 0, 1
|
|
1384
|
+
this.set(
|
|
1353
1385
|
|
|
1354
|
-
|
|
1386
|
+
1, 0, x.x,
|
|
1387
|
+
0, 1, x.y,
|
|
1388
|
+
0, 0, 1
|
|
1389
|
+
|
|
1390
|
+
);
|
|
1391
|
+
|
|
1392
|
+
} else {
|
|
1393
|
+
|
|
1394
|
+
this.set(
|
|
1395
|
+
|
|
1396
|
+
1, 0, x,
|
|
1397
|
+
0, 1, y,
|
|
1398
|
+
0, 0, 1
|
|
1399
|
+
|
|
1400
|
+
);
|
|
1401
|
+
|
|
1402
|
+
}
|
|
1355
1403
|
|
|
1356
1404
|
return this;
|
|
1357
1405
|
|
|
@@ -1755,12 +1803,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
1755
1803
|
|
|
1756
1804
|
}
|
|
1757
1805
|
|
|
1806
|
+
let sourceId = 0;
|
|
1807
|
+
|
|
1758
1808
|
class Source {
|
|
1759
1809
|
|
|
1760
1810
|
constructor( data = null ) {
|
|
1761
1811
|
|
|
1762
1812
|
this.isSource = true;
|
|
1763
1813
|
|
|
1814
|
+
Object.defineProperty( this, 'id', { value: sourceId ++ } );
|
|
1815
|
+
|
|
1764
1816
|
this.uuid = generateUUID();
|
|
1765
1817
|
|
|
1766
1818
|
this.data = data;
|
|
@@ -2024,7 +2076,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
2024
2076
|
const output = {
|
|
2025
2077
|
|
|
2026
2078
|
metadata: {
|
|
2027
|
-
version: 4.
|
|
2079
|
+
version: 4.6,
|
|
2028
2080
|
type: 'Texture',
|
|
2029
2081
|
generator: 'Texture.toJSON'
|
|
2030
2082
|
},
|
|
@@ -5765,7 +5817,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
5765
5817
|
|
|
5766
5818
|
class Matrix4 {
|
|
5767
5819
|
|
|
5768
|
-
constructor() {
|
|
5820
|
+
constructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
|
|
5769
5821
|
|
|
5770
5822
|
Matrix4.prototype.isMatrix4 = true;
|
|
5771
5823
|
|
|
@@ -5778,6 +5830,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
5778
5830
|
|
|
5779
5831
|
];
|
|
5780
5832
|
|
|
5833
|
+
if ( n11 !== undefined ) {
|
|
5834
|
+
|
|
5835
|
+
this.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );
|
|
5836
|
+
|
|
5837
|
+
}
|
|
5838
|
+
|
|
5781
5839
|
}
|
|
5782
5840
|
|
|
5783
5841
|
set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
|
|
@@ -6317,14 +6375,29 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
6317
6375
|
|
|
6318
6376
|
makeTranslation( x, y, z ) {
|
|
6319
6377
|
|
|
6320
|
-
|
|
6378
|
+
if ( x.isVector3 ) {
|
|
6321
6379
|
|
|
6322
|
-
|
|
6323
|
-
0, 1, 0, y,
|
|
6324
|
-
0, 0, 1, z,
|
|
6325
|
-
0, 0, 0, 1
|
|
6380
|
+
this.set(
|
|
6326
6381
|
|
|
6327
|
-
|
|
6382
|
+
1, 0, 0, x.x,
|
|
6383
|
+
0, 1, 0, x.y,
|
|
6384
|
+
0, 0, 1, x.z,
|
|
6385
|
+
0, 0, 0, 1
|
|
6386
|
+
|
|
6387
|
+
);
|
|
6388
|
+
|
|
6389
|
+
} else {
|
|
6390
|
+
|
|
6391
|
+
this.set(
|
|
6392
|
+
|
|
6393
|
+
1, 0, 0, x,
|
|
6394
|
+
0, 1, 0, y,
|
|
6395
|
+
0, 0, 1, z,
|
|
6396
|
+
0, 0, 0, 1
|
|
6397
|
+
|
|
6398
|
+
);
|
|
6399
|
+
|
|
6400
|
+
}
|
|
6328
6401
|
|
|
6329
6402
|
return this;
|
|
6330
6403
|
|
|
@@ -6515,7 +6588,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
6515
6588
|
|
|
6516
6589
|
}
|
|
6517
6590
|
|
|
6518
|
-
makePerspective( left, right, top, bottom, near, far ) {
|
|
6591
|
+
makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
6519
6592
|
|
|
6520
6593
|
const te = this.elements;
|
|
6521
6594
|
const x = 2 * near / ( right - left );
|
|
@@ -6523,19 +6596,35 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
6523
6596
|
|
|
6524
6597
|
const a = ( right + left ) / ( right - left );
|
|
6525
6598
|
const b = ( top + bottom ) / ( top - bottom );
|
|
6526
|
-
const c = - ( far + near ) / ( far - near );
|
|
6527
|
-
const d = - 2 * far * near / ( far - near );
|
|
6528
6599
|
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6600
|
+
let c, d;
|
|
6601
|
+
|
|
6602
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
6603
|
+
|
|
6604
|
+
c = - ( far + near ) / ( far - near );
|
|
6605
|
+
d = ( - 2 * far * near ) / ( far - near );
|
|
6606
|
+
|
|
6607
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
6608
|
+
|
|
6609
|
+
c = - far / ( far - near );
|
|
6610
|
+
d = ( - far * near ) / ( far - near );
|
|
6611
|
+
|
|
6612
|
+
} else {
|
|
6613
|
+
|
|
6614
|
+
throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
|
|
6615
|
+
|
|
6616
|
+
}
|
|
6617
|
+
|
|
6618
|
+
te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0;
|
|
6619
|
+
te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0;
|
|
6620
|
+
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
|
|
6532
6621
|
te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0;
|
|
6533
6622
|
|
|
6534
6623
|
return this;
|
|
6535
6624
|
|
|
6536
6625
|
}
|
|
6537
6626
|
|
|
6538
|
-
makeOrthographic( left, right, top, bottom, near, far ) {
|
|
6627
|
+
makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
6539
6628
|
|
|
6540
6629
|
const te = this.elements;
|
|
6541
6630
|
const w = 1.0 / ( right - left );
|
|
@@ -6544,12 +6633,29 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
6544
6633
|
|
|
6545
6634
|
const x = ( right + left ) * w;
|
|
6546
6635
|
const y = ( top + bottom ) * h;
|
|
6547
|
-
const z = ( far + near ) * p;
|
|
6548
6636
|
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6637
|
+
let z, zInv;
|
|
6638
|
+
|
|
6639
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
6640
|
+
|
|
6641
|
+
z = ( far + near ) * p;
|
|
6642
|
+
zInv = - 2 * p;
|
|
6643
|
+
|
|
6644
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
6645
|
+
|
|
6646
|
+
z = near * p;
|
|
6647
|
+
zInv = - 1 * p;
|
|
6648
|
+
|
|
6649
|
+
} else {
|
|
6650
|
+
|
|
6651
|
+
throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
|
|
6652
|
+
|
|
6653
|
+
}
|
|
6654
|
+
|
|
6655
|
+
te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
|
|
6656
|
+
te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
|
|
6657
|
+
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z;
|
|
6658
|
+
te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
|
|
6553
6659
|
|
|
6554
6660
|
return this;
|
|
6555
6661
|
|
|
@@ -7674,7 +7780,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
7674
7780
|
};
|
|
7675
7781
|
|
|
7676
7782
|
output.metadata = {
|
|
7677
|
-
version: 4.
|
|
7783
|
+
version: 4.6,
|
|
7678
7784
|
type: 'Object',
|
|
7679
7785
|
generator: 'Object3D.toJSON'
|
|
7680
7786
|
};
|
|
@@ -8300,6 +8406,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8300
8406
|
|
|
8301
8407
|
this.opacity = 1;
|
|
8302
8408
|
this.transparent = false;
|
|
8409
|
+
this.alphaHash = false;
|
|
8303
8410
|
|
|
8304
8411
|
this.blendSrc = SrcAlphaFactor;
|
|
8305
8412
|
this.blendDst = OneMinusSrcAlphaFactor;
|
|
@@ -8440,7 +8547,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8440
8547
|
|
|
8441
8548
|
const data = {
|
|
8442
8549
|
metadata: {
|
|
8443
|
-
version: 4.
|
|
8550
|
+
version: 4.6,
|
|
8444
8551
|
type: 'Material',
|
|
8445
8552
|
generator: 'Material.toJSON'
|
|
8446
8553
|
}
|
|
@@ -8505,6 +8612,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8505
8612
|
|
|
8506
8613
|
}
|
|
8507
8614
|
|
|
8615
|
+
if ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;
|
|
8616
|
+
if ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;
|
|
8617
|
+
|
|
8618
|
+
if ( this.anisotropyMap && this.anisotropyMap.isTexture ) {
|
|
8619
|
+
|
|
8620
|
+
data.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;
|
|
8621
|
+
|
|
8622
|
+
}
|
|
8623
|
+
|
|
8508
8624
|
if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
|
|
8509
8625
|
if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
|
|
8510
8626
|
if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
|
|
@@ -8619,6 +8735,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8619
8735
|
if ( this.dithering === true ) data.dithering = true;
|
|
8620
8736
|
|
|
8621
8737
|
if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
|
|
8738
|
+
if ( this.alphaHash === true ) data.alphaHash = this.alphaHash;
|
|
8622
8739
|
if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;
|
|
8623
8740
|
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
|
|
8624
8741
|
if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass;
|
|
@@ -8740,6 +8857,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8740
8857
|
this.dithering = source.dithering;
|
|
8741
8858
|
|
|
8742
8859
|
this.alphaTest = source.alphaTest;
|
|
8860
|
+
this.alphaHash = source.alphaHash;
|
|
8743
8861
|
this.alphaToCoverage = source.alphaToCoverage;
|
|
8744
8862
|
this.premultipliedAlpha = source.premultipliedAlpha;
|
|
8745
8863
|
this.forceSinglePass = source.forceSinglePass;
|
|
@@ -8817,30 +8935,35 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
8817
8935
|
this.g = 1;
|
|
8818
8936
|
this.b = 1;
|
|
8819
8937
|
|
|
8938
|
+
return this.set( r, g, b );
|
|
8939
|
+
|
|
8940
|
+
}
|
|
8941
|
+
|
|
8942
|
+
set( r, g, b ) {
|
|
8943
|
+
|
|
8820
8944
|
if ( g === undefined && b === undefined ) {
|
|
8821
8945
|
|
|
8822
8946
|
// r is THREE.Color, hex or string
|
|
8823
|
-
return this.set( r );
|
|
8824
8947
|
|
|
8825
|
-
|
|
8948
|
+
const value = r;
|
|
8826
8949
|
|
|
8827
|
-
|
|
8950
|
+
if ( value && value.isColor ) {
|
|
8828
8951
|
|
|
8829
|
-
|
|
8952
|
+
this.copy( value );
|
|
8830
8953
|
|
|
8831
|
-
|
|
8954
|
+
} else if ( typeof value === 'number' ) {
|
|
8832
8955
|
|
|
8833
|
-
|
|
8956
|
+
this.setHex( value );
|
|
8834
8957
|
|
|
8835
|
-
|
|
8958
|
+
} else if ( typeof value === 'string' ) {
|
|
8836
8959
|
|
|
8837
|
-
|
|
8960
|
+
this.setStyle( value );
|
|
8838
8961
|
|
|
8839
|
-
|
|
8962
|
+
}
|
|
8840
8963
|
|
|
8841
|
-
} else
|
|
8964
|
+
} else {
|
|
8842
8965
|
|
|
8843
|
-
this.
|
|
8966
|
+
this.setRGB( r, g, b );
|
|
8844
8967
|
|
|
8845
8968
|
}
|
|
8846
8969
|
|
|
@@ -9654,6 +9777,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
9654
9777
|
|
|
9655
9778
|
this.usage = StaticDrawUsage;
|
|
9656
9779
|
this.updateRange = { offset: 0, count: - 1 };
|
|
9780
|
+
this.gpuType = FloatType;
|
|
9657
9781
|
|
|
9658
9782
|
this.version = 0;
|
|
9659
9783
|
|
|
@@ -9684,6 +9808,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
9684
9808
|
this.normalized = source.normalized;
|
|
9685
9809
|
|
|
9686
9810
|
this.usage = source.usage;
|
|
9811
|
+
this.gpuType = source.gpuType;
|
|
9687
9812
|
|
|
9688
9813
|
return this;
|
|
9689
9814
|
|
|
@@ -9970,30 +10095,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
9970
10095
|
|
|
9971
10096
|
}
|
|
9972
10097
|
|
|
9973
|
-
copyColorsArray() { // @deprecated, r144
|
|
9974
|
-
|
|
9975
|
-
console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
|
|
9976
|
-
|
|
9977
|
-
}
|
|
9978
|
-
|
|
9979
|
-
copyVector2sArray() { // @deprecated, r144
|
|
9980
|
-
|
|
9981
|
-
console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
|
|
9982
|
-
|
|
9983
|
-
}
|
|
9984
|
-
|
|
9985
|
-
copyVector3sArray() { // @deprecated, r144
|
|
9986
|
-
|
|
9987
|
-
console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
|
|
9988
|
-
|
|
9989
|
-
}
|
|
9990
|
-
|
|
9991
|
-
copyVector4sArray() { // @deprecated, r144
|
|
9992
|
-
|
|
9993
|
-
console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
|
|
9994
|
-
|
|
9995
|
-
}
|
|
9996
|
-
|
|
9997
10098
|
}
|
|
9998
10099
|
|
|
9999
10100
|
//
|
|
@@ -10957,13 +11058,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
10957
11058
|
|
|
10958
11059
|
}
|
|
10959
11060
|
|
|
10960
|
-
merge() { // @deprecated, r144
|
|
10961
|
-
|
|
10962
|
-
console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' );
|
|
10963
|
-
return this;
|
|
10964
|
-
|
|
10965
|
-
}
|
|
10966
|
-
|
|
10967
11061
|
normalizeNormals() {
|
|
10968
11062
|
|
|
10969
11063
|
const normals = this.attributes.normal;
|
|
@@ -11086,7 +11180,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11086
11180
|
|
|
11087
11181
|
const data = {
|
|
11088
11182
|
metadata: {
|
|
11089
|
-
version: 4.
|
|
11183
|
+
version: 4.6,
|
|
11090
11184
|
type: 'BufferGeometry',
|
|
11091
11185
|
generator: 'BufferGeometry.toJSON'
|
|
11092
11186
|
}
|
|
@@ -11314,9 +11408,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11314
11408
|
|
|
11315
11409
|
}
|
|
11316
11410
|
|
|
11317
|
-
const _inverseMatrix$
|
|
11318
|
-
const _ray$
|
|
11319
|
-
const _sphere$
|
|
11411
|
+
const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();
|
|
11412
|
+
const _ray$3 = /*@__PURE__*/ new Ray();
|
|
11413
|
+
const _sphere$5 = /*@__PURE__*/ new Sphere();
|
|
11320
11414
|
const _sphereHitAt = /*@__PURE__*/ new Vector3();
|
|
11321
11415
|
|
|
11322
11416
|
const _vA$1 = /*@__PURE__*/ new Vector3();
|
|
@@ -11460,41 +11554,45 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11460
11554
|
|
|
11461
11555
|
if ( material === undefined ) return;
|
|
11462
11556
|
|
|
11463
|
-
//
|
|
11557
|
+
// test with bounding sphere in world space
|
|
11464
11558
|
|
|
11465
11559
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
11466
11560
|
|
|
11467
|
-
_sphere$
|
|
11468
|
-
_sphere$
|
|
11561
|
+
_sphere$5.copy( geometry.boundingSphere );
|
|
11562
|
+
_sphere$5.applyMatrix4( matrixWorld );
|
|
11563
|
+
|
|
11564
|
+
// check distance from ray origin to bounding sphere
|
|
11469
11565
|
|
|
11470
|
-
_ray$
|
|
11566
|
+
_ray$3.copy( raycaster.ray ).recast( raycaster.near );
|
|
11471
11567
|
|
|
11472
|
-
if ( _sphere$
|
|
11568
|
+
if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) {
|
|
11473
11569
|
|
|
11474
|
-
if ( _ray$
|
|
11570
|
+
if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
|
|
11475
11571
|
|
|
11476
|
-
if ( _ray$
|
|
11572
|
+
if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
|
|
11477
11573
|
|
|
11478
11574
|
}
|
|
11479
11575
|
|
|
11480
|
-
//
|
|
11576
|
+
// convert ray to local space of mesh
|
|
11481
11577
|
|
|
11482
|
-
_inverseMatrix$
|
|
11483
|
-
_ray$
|
|
11578
|
+
_inverseMatrix$3.copy( matrixWorld ).invert();
|
|
11579
|
+
_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );
|
|
11484
11580
|
|
|
11485
|
-
//
|
|
11581
|
+
// test with bounding box in local space
|
|
11486
11582
|
|
|
11487
11583
|
if ( geometry.boundingBox !== null ) {
|
|
11488
11584
|
|
|
11489
|
-
if ( _ray$
|
|
11585
|
+
if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;
|
|
11490
11586
|
|
|
11491
11587
|
}
|
|
11492
11588
|
|
|
11493
|
-
|
|
11589
|
+
// test for intersections with geometry
|
|
11590
|
+
|
|
11591
|
+
this._computeIntersections( raycaster, intersects, _ray$3 );
|
|
11494
11592
|
|
|
11495
11593
|
}
|
|
11496
11594
|
|
|
11497
|
-
_computeIntersections( raycaster, intersects ) {
|
|
11595
|
+
_computeIntersections( raycaster, intersects, rayLocalSpace ) {
|
|
11498
11596
|
|
|
11499
11597
|
let intersection;
|
|
11500
11598
|
|
|
@@ -11529,7 +11627,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11529
11627
|
const b = index.getX( j + 1 );
|
|
11530
11628
|
const c = index.getX( j + 2 );
|
|
11531
11629
|
|
|
11532
|
-
intersection = checkGeometryIntersection( this, groupMaterial, raycaster,
|
|
11630
|
+
intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11533
11631
|
|
|
11534
11632
|
if ( intersection ) {
|
|
11535
11633
|
|
|
@@ -11554,7 +11652,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11554
11652
|
const b = index.getX( i + 1 );
|
|
11555
11653
|
const c = index.getX( i + 2 );
|
|
11556
11654
|
|
|
11557
|
-
intersection = checkGeometryIntersection( this, material, raycaster,
|
|
11655
|
+
intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11558
11656
|
|
|
11559
11657
|
if ( intersection ) {
|
|
11560
11658
|
|
|
@@ -11587,7 +11685,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11587
11685
|
const b = j + 1;
|
|
11588
11686
|
const c = j + 2;
|
|
11589
11687
|
|
|
11590
|
-
intersection = checkGeometryIntersection( this, groupMaterial, raycaster,
|
|
11688
|
+
intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11591
11689
|
|
|
11592
11690
|
if ( intersection ) {
|
|
11593
11691
|
|
|
@@ -11612,7 +11710,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11612
11710
|
const b = i + 1;
|
|
11613
11711
|
const c = i + 2;
|
|
11614
11712
|
|
|
11615
|
-
intersection = checkGeometryIntersection( this, material, raycaster,
|
|
11713
|
+
intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11616
11714
|
|
|
11617
11715
|
if ( intersection ) {
|
|
11618
11716
|
|
|
@@ -11689,7 +11787,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
11689
11787
|
_uvC$1.fromBufferAttribute( uv1, c );
|
|
11690
11788
|
|
|
11691
11789
|
intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
|
|
11692
|
-
intersection.uv2 = intersection.uv1; //
|
|
11790
|
+
intersection.uv2 = intersection.uv1; // @deprecated, r152
|
|
11693
11791
|
|
|
11694
11792
|
}
|
|
11695
11793
|
|
|
@@ -12202,6 +12300,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12202
12300
|
this.projectionMatrix = new Matrix4();
|
|
12203
12301
|
this.projectionMatrixInverse = new Matrix4();
|
|
12204
12302
|
|
|
12303
|
+
this.coordinateSystem = WebGLCoordinateSystem;
|
|
12304
|
+
|
|
12205
12305
|
}
|
|
12206
12306
|
|
|
12207
12307
|
copy( source, recursive ) {
|
|
@@ -12213,6 +12313,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12213
12313
|
this.projectionMatrix.copy( source.projectionMatrix );
|
|
12214
12314
|
this.projectionMatrixInverse.copy( source.projectionMatrixInverse );
|
|
12215
12315
|
|
|
12316
|
+
this.coordinateSystem = source.coordinateSystem;
|
|
12317
|
+
|
|
12216
12318
|
return this;
|
|
12217
12319
|
|
|
12218
12320
|
}
|
|
@@ -12450,7 +12552,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12450
12552
|
const skew = this.filmOffset;
|
|
12451
12553
|
if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
|
|
12452
12554
|
|
|
12453
|
-
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
|
|
12555
|
+
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
|
|
12454
12556
|
|
|
12455
12557
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
12456
12558
|
|
|
@@ -12492,51 +12594,114 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12492
12594
|
this.type = 'CubeCamera';
|
|
12493
12595
|
|
|
12494
12596
|
this.renderTarget = renderTarget;
|
|
12597
|
+
this.coordinateSystem = null;
|
|
12495
12598
|
|
|
12496
12599
|
const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
|
|
12497
12600
|
cameraPX.layers = this.layers;
|
|
12498
|
-
cameraPX.up.set( 0, 1, 0 );
|
|
12499
|
-
cameraPX.lookAt( 1, 0, 0 );
|
|
12500
12601
|
this.add( cameraPX );
|
|
12501
12602
|
|
|
12502
12603
|
const cameraNX = new PerspectiveCamera( fov, aspect, near, far );
|
|
12503
12604
|
cameraNX.layers = this.layers;
|
|
12504
|
-
cameraNX.up.set( 0, 1, 0 );
|
|
12505
|
-
cameraNX.lookAt( - 1, 0, 0 );
|
|
12506
12605
|
this.add( cameraNX );
|
|
12507
12606
|
|
|
12508
12607
|
const cameraPY = new PerspectiveCamera( fov, aspect, near, far );
|
|
12509
12608
|
cameraPY.layers = this.layers;
|
|
12510
|
-
cameraPY.up.set( 0, 0, - 1 );
|
|
12511
|
-
cameraPY.lookAt( 0, 1, 0 );
|
|
12512
12609
|
this.add( cameraPY );
|
|
12513
12610
|
|
|
12514
12611
|
const cameraNY = new PerspectiveCamera( fov, aspect, near, far );
|
|
12515
12612
|
cameraNY.layers = this.layers;
|
|
12516
|
-
cameraNY.up.set( 0, 0, 1 );
|
|
12517
|
-
cameraNY.lookAt( 0, - 1, 0 );
|
|
12518
12613
|
this.add( cameraNY );
|
|
12519
12614
|
|
|
12520
12615
|
const cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
|
|
12521
12616
|
cameraPZ.layers = this.layers;
|
|
12522
|
-
cameraPZ.up.set( 0, 1, 0 );
|
|
12523
|
-
cameraPZ.lookAt( 0, 0, 1 );
|
|
12524
12617
|
this.add( cameraPZ );
|
|
12525
12618
|
|
|
12526
12619
|
const cameraNZ = new PerspectiveCamera( fov, aspect, near, far );
|
|
12527
12620
|
cameraNZ.layers = this.layers;
|
|
12528
|
-
cameraNZ.up.set( 0, 1, 0 );
|
|
12529
|
-
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12530
12621
|
this.add( cameraNZ );
|
|
12531
12622
|
|
|
12532
12623
|
}
|
|
12533
12624
|
|
|
12625
|
+
updateCoordinateSystem() {
|
|
12626
|
+
|
|
12627
|
+
const coordinateSystem = this.coordinateSystem;
|
|
12628
|
+
|
|
12629
|
+
const cameras = this.children.concat();
|
|
12630
|
+
|
|
12631
|
+
const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;
|
|
12632
|
+
|
|
12633
|
+
for ( const camera of cameras ) this.remove( camera );
|
|
12634
|
+
|
|
12635
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
12636
|
+
|
|
12637
|
+
cameraPX.up.set( 0, 1, 0 );
|
|
12638
|
+
cameraPX.lookAt( 1, 0, 0 );
|
|
12639
|
+
|
|
12640
|
+
cameraNX.up.set( 0, 1, 0 );
|
|
12641
|
+
cameraNX.lookAt( - 1, 0, 0 );
|
|
12642
|
+
|
|
12643
|
+
cameraPY.up.set( 0, 0, - 1 );
|
|
12644
|
+
cameraPY.lookAt( 0, 1, 0 );
|
|
12645
|
+
|
|
12646
|
+
cameraNY.up.set( 0, 0, 1 );
|
|
12647
|
+
cameraNY.lookAt( 0, - 1, 0 );
|
|
12648
|
+
|
|
12649
|
+
cameraPZ.up.set( 0, 1, 0 );
|
|
12650
|
+
cameraPZ.lookAt( 0, 0, 1 );
|
|
12651
|
+
|
|
12652
|
+
cameraNZ.up.set( 0, 1, 0 );
|
|
12653
|
+
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12654
|
+
|
|
12655
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
12656
|
+
|
|
12657
|
+
cameraPX.up.set( 0, - 1, 0 );
|
|
12658
|
+
cameraPX.lookAt( - 1, 0, 0 );
|
|
12659
|
+
|
|
12660
|
+
cameraNX.up.set( 0, - 1, 0 );
|
|
12661
|
+
cameraNX.lookAt( 1, 0, 0 );
|
|
12662
|
+
|
|
12663
|
+
cameraPY.up.set( 0, 0, 1 );
|
|
12664
|
+
cameraPY.lookAt( 0, 1, 0 );
|
|
12665
|
+
|
|
12666
|
+
cameraNY.up.set( 0, 0, - 1 );
|
|
12667
|
+
cameraNY.lookAt( 0, - 1, 0 );
|
|
12668
|
+
|
|
12669
|
+
cameraPZ.up.set( 0, - 1, 0 );
|
|
12670
|
+
cameraPZ.lookAt( 0, 0, 1 );
|
|
12671
|
+
|
|
12672
|
+
cameraNZ.up.set( 0, - 1, 0 );
|
|
12673
|
+
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12674
|
+
|
|
12675
|
+
} else {
|
|
12676
|
+
|
|
12677
|
+
throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );
|
|
12678
|
+
|
|
12679
|
+
}
|
|
12680
|
+
|
|
12681
|
+
for ( const camera of cameras ) {
|
|
12682
|
+
|
|
12683
|
+
this.add( camera );
|
|
12684
|
+
|
|
12685
|
+
camera.updateMatrixWorld();
|
|
12686
|
+
|
|
12687
|
+
}
|
|
12688
|
+
|
|
12689
|
+
}
|
|
12690
|
+
|
|
12534
12691
|
update( renderer, scene ) {
|
|
12535
12692
|
|
|
12536
12693
|
if ( this.parent === null ) this.updateMatrixWorld();
|
|
12537
12694
|
|
|
12538
12695
|
const renderTarget = this.renderTarget;
|
|
12539
12696
|
|
|
12697
|
+
if ( this.coordinateSystem !== renderer.coordinateSystem ) {
|
|
12698
|
+
|
|
12699
|
+
this.coordinateSystem = renderer.coordinateSystem;
|
|
12700
|
+
|
|
12701
|
+
this.updateCoordinateSystem();
|
|
12702
|
+
|
|
12703
|
+
}
|
|
12704
|
+
|
|
12540
12705
|
const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;
|
|
12541
12706
|
|
|
12542
12707
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
@@ -12956,7 +13121,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12956
13121
|
|
|
12957
13122
|
}
|
|
12958
13123
|
|
|
12959
|
-
const _sphere$
|
|
13124
|
+
const _sphere$4 = /*@__PURE__*/ new Sphere();
|
|
12960
13125
|
const _vector$6 = /*@__PURE__*/ new Vector3();
|
|
12961
13126
|
|
|
12962
13127
|
class Frustum {
|
|
@@ -12996,7 +13161,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
12996
13161
|
|
|
12997
13162
|
}
|
|
12998
13163
|
|
|
12999
|
-
setFromProjectionMatrix( m ) {
|
|
13164
|
+
setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {
|
|
13000
13165
|
|
|
13001
13166
|
const planes = this.planes;
|
|
13002
13167
|
const me = m.elements;
|
|
@@ -13010,7 +13175,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13010
13175
|
planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();
|
|
13011
13176
|
planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();
|
|
13012
13177
|
planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();
|
|
13013
|
-
|
|
13178
|
+
|
|
13179
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
13180
|
+
|
|
13181
|
+
planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();
|
|
13182
|
+
|
|
13183
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
13184
|
+
|
|
13185
|
+
planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();
|
|
13186
|
+
|
|
13187
|
+
} else {
|
|
13188
|
+
|
|
13189
|
+
throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
|
|
13190
|
+
|
|
13191
|
+
}
|
|
13014
13192
|
|
|
13015
13193
|
return this;
|
|
13016
13194
|
|
|
@@ -13022,7 +13200,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13022
13200
|
|
|
13023
13201
|
if ( object.boundingSphere === null ) object.computeBoundingSphere();
|
|
13024
13202
|
|
|
13025
|
-
_sphere$
|
|
13203
|
+
_sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
13026
13204
|
|
|
13027
13205
|
} else {
|
|
13028
13206
|
|
|
@@ -13030,21 +13208,21 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13030
13208
|
|
|
13031
13209
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
13032
13210
|
|
|
13033
|
-
_sphere$
|
|
13211
|
+
_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
13034
13212
|
|
|
13035
13213
|
}
|
|
13036
13214
|
|
|
13037
|
-
return this.intersectsSphere( _sphere$
|
|
13215
|
+
return this.intersectsSphere( _sphere$4 );
|
|
13038
13216
|
|
|
13039
13217
|
}
|
|
13040
13218
|
|
|
13041
13219
|
intersectsSprite( sprite ) {
|
|
13042
13220
|
|
|
13043
|
-
_sphere$
|
|
13044
|
-
_sphere$
|
|
13045
|
-
_sphere$
|
|
13221
|
+
_sphere$4.center.set( 0, 0, 0 );
|
|
13222
|
+
_sphere$4.radius = 0.7071067811865476;
|
|
13223
|
+
_sphere$4.applyMatrix4( sprite.matrixWorld );
|
|
13046
13224
|
|
|
13047
|
-
return this.intersectsSphere( _sphere$
|
|
13225
|
+
return this.intersectsSphere( _sphere$4 );
|
|
13048
13226
|
|
|
13049
13227
|
}
|
|
13050
13228
|
|
|
@@ -13461,6 +13639,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13461
13639
|
|
|
13462
13640
|
}
|
|
13463
13641
|
|
|
13642
|
+
var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
|
|
13643
|
+
|
|
13644
|
+
var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif";
|
|
13645
|
+
|
|
13464
13646
|
var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";
|
|
13465
13647
|
|
|
13466
13648
|
var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";
|
|
@@ -13473,7 +13655,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13473
13655
|
|
|
13474
13656
|
var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";
|
|
13475
13657
|
|
|
13476
|
-
var begin_vertex = "vec3 transformed = vec3( position )
|
|
13658
|
+
var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif";
|
|
13477
13659
|
|
|
13478
13660
|
var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
|
|
13479
13661
|
|
|
@@ -13499,7 +13681,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13499
13681
|
|
|
13500
13682
|
var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif";
|
|
13501
13683
|
|
|
13502
|
-
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";
|
|
13684
|
+
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";
|
|
13503
13685
|
|
|
13504
13686
|
var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";
|
|
13505
13687
|
|
|
@@ -13513,9 +13695,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13513
13695
|
|
|
13514
13696
|
var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";
|
|
13515
13697
|
|
|
13516
|
-
var
|
|
13698
|
+
var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
|
|
13517
13699
|
|
|
13518
|
-
var
|
|
13700
|
+
var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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}";
|
|
13519
13701
|
|
|
13520
13702
|
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";
|
|
13521
13703
|
|
|
@@ -13547,7 +13729,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13547
13729
|
|
|
13548
13730
|
var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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";
|
|
13549
13731
|
|
|
13550
|
-
var envmap_physical_pars_fragment = "#
|
|
13732
|
+
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";
|
|
13551
13733
|
|
|
13552
13734
|
var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
|
|
13553
13735
|
|
|
@@ -13557,13 +13739,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13557
13739
|
|
|
13558
13740
|
var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";
|
|
13559
13741
|
|
|
13560
|
-
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif";
|
|
13742
|
+
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n#endif";
|
|
13561
13743
|
|
|
13562
|
-
var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
|
|
13744
|
+
var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
|
|
13563
13745
|
|
|
13564
13746
|
var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
|
|
13565
13747
|
|
|
13566
|
-
var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
|
|
13748
|
+
var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
|
|
13567
13749
|
|
|
13568
13750
|
var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";
|
|
13569
13751
|
|
|
@@ -13595,7 +13777,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13595
13777
|
|
|
13596
13778
|
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";
|
|
13597
13779
|
|
|
13598
|
-
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#
|
|
13780
|
+
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#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\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#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
|
|
13599
13781
|
|
|
13600
13782
|
var normal_fragment_maps = "#ifdef 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";
|
|
13601
13783
|
|
|
@@ -13605,7 +13787,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13605
13787
|
|
|
13606
13788
|
var normal_vertex = "#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif";
|
|
13607
13789
|
|
|
13608
|
-
var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";
|
|
13790
|
+
var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";
|
|
13609
13791
|
|
|
13610
13792
|
var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";
|
|
13611
13793
|
|
|
@@ -13615,7 +13797,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13615
13797
|
|
|
13616
13798
|
var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";
|
|
13617
13799
|
|
|
13618
|
-
var
|
|
13800
|
+
var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
|
|
13619
13801
|
|
|
13620
13802
|
var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}";
|
|
13621
13803
|
|
|
@@ -13653,59 +13835,59 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13653
13835
|
|
|
13654
13836
|
var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
|
|
13655
13837
|
|
|
13656
|
-
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 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
|
|
13838
|
+
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}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
|
|
13657
13839
|
|
|
13658
|
-
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
|
|
13840
|
+
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";
|
|
13659
13841
|
|
|
13660
|
-
var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3
|
|
13842
|
+
var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif";
|
|
13661
13843
|
|
|
13662
|
-
var uv_pars_fragment = "#
|
|
13844
|
+
var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
|
|
13663
13845
|
|
|
13664
|
-
var uv_pars_vertex = "#
|
|
13846
|
+
var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
|
|
13665
13847
|
|
|
13666
|
-
var uv_vertex = "#
|
|
13848
|
+
var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";
|
|
13667
13849
|
|
|
13668
13850
|
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
|
|
13669
13851
|
|
|
13670
13852
|
const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
|
|
13671
13853
|
|
|
13672
|
-
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <
|
|
13854
|
+
const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
|
|
13673
13855
|
|
|
13674
13856
|
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}";
|
|
13675
13857
|
|
|
13676
|
-
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 <
|
|
13858
|
+
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}";
|
|
13677
13859
|
|
|
13678
13860
|
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}";
|
|
13679
13861
|
|
|
13680
|
-
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 <
|
|
13862
|
+
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}";
|
|
13681
13863
|
|
|
13682
13864
|
const vertex$e = "#include <common>\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 <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}";
|
|
13683
13865
|
|
|
13684
|
-
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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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 <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}";
|
|
13866
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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}";
|
|
13685
13867
|
|
|
13686
13868
|
const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\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 <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}";
|
|
13687
13869
|
|
|
13688
|
-
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 <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
|
|
13870
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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}";
|
|
13689
13871
|
|
|
13690
13872
|
const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";
|
|
13691
13873
|
|
|
13692
|
-
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 <
|
|
13874
|
+
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}";
|
|
13693
13875
|
|
|
13694
13876
|
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}";
|
|
13695
13877
|
|
|
13696
|
-
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\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13878
|
+
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\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13697
13879
|
|
|
13698
13880
|
const vertex$a = "#include <common>\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#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}";
|
|
13699
13881
|
|
|
13700
|
-
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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <
|
|
13882
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13701
13883
|
|
|
13702
13884
|
const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\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 <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}";
|
|
13703
13885
|
|
|
13704
|
-
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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <
|
|
13886
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13705
13887
|
|
|
13706
13888
|
const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\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 <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}";
|
|
13707
13889
|
|
|
13708
|
-
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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <
|
|
13890
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13709
13891
|
|
|
13710
13892
|
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 <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 <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}";
|
|
13711
13893
|
|
|
@@ -13713,29 +13895,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13713
13895
|
|
|
13714
13896
|
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\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 <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}";
|
|
13715
13897
|
|
|
13716
|
-
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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <
|
|
13898
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13717
13899
|
|
|
13718
13900
|
const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\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 <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}";
|
|
13719
13901
|
|
|
13720
|
-
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\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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <
|
|
13902
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * 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}";
|
|
13721
13903
|
|
|
13722
13904
|
const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\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 <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}";
|
|
13723
13905
|
|
|
13724
|
-
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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <
|
|
13906
|
+
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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13725
13907
|
|
|
13726
13908
|
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}";
|
|
13727
13909
|
|
|
13728
|
-
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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13910
|
+
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\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
|
|
13729
13911
|
|
|
13730
13912
|
const vertex$2 = "#include <common>\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 <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}";
|
|
13731
13913
|
|
|
13732
|
-
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 <
|
|
13914
|
+
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}";
|
|
13733
13915
|
|
|
13734
13916
|
const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
|
|
13735
13917
|
|
|
13736
|
-
const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <
|
|
13918
|
+
const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_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}";
|
|
13737
13919
|
|
|
13738
13920
|
const ShaderChunk = {
|
|
13921
|
+
alphahash_fragment: alphahash_fragment,
|
|
13922
|
+
alphahash_pars_fragment: alphahash_pars_fragment,
|
|
13739
13923
|
alphamap_fragment: alphamap_fragment,
|
|
13740
13924
|
alphamap_pars_fragment: alphamap_pars_fragment,
|
|
13741
13925
|
alphatest_fragment: alphatest_fragment,
|
|
@@ -13762,8 +13946,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13762
13946
|
displacementmap_vertex: displacementmap_vertex,
|
|
13763
13947
|
emissivemap_fragment: emissivemap_fragment,
|
|
13764
13948
|
emissivemap_pars_fragment: emissivemap_pars_fragment,
|
|
13765
|
-
|
|
13766
|
-
|
|
13949
|
+
colorspace_fragment: colorspace_fragment,
|
|
13950
|
+
colorspace_pars_fragment: colorspace_pars_fragment,
|
|
13767
13951
|
envmap_fragment: envmap_fragment,
|
|
13768
13952
|
envmap_common_pars_fragment: envmap_common_pars_fragment,
|
|
13769
13953
|
envmap_pars_fragment: envmap_pars_fragment,
|
|
@@ -13813,7 +13997,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
13813
13997
|
clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,
|
|
13814
13998
|
clearcoat_pars_fragment: clearcoat_pars_fragment,
|
|
13815
13999
|
iridescence_pars_fragment: iridescence_pars_fragment,
|
|
13816
|
-
|
|
14000
|
+
opaque_fragment: opaque_fragment,
|
|
13817
14001
|
packing: packing,
|
|
13818
14002
|
premultiplied_alpha_fragment: premultiplied_alpha_fragment,
|
|
13819
14003
|
project_vertex: project_vertex,
|
|
@@ -14079,6 +14263,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
14079
14263
|
scale: { value: 1.0 },
|
|
14080
14264
|
map: { value: null },
|
|
14081
14265
|
alphaMap: { value: null },
|
|
14266
|
+
alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14082
14267
|
alphaTest: { value: 0 },
|
|
14083
14268
|
uvTransform: { value: /*@__PURE__*/ new Matrix3() }
|
|
14084
14269
|
|
|
@@ -14093,6 +14278,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
14093
14278
|
map: { value: null },
|
|
14094
14279
|
mapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14095
14280
|
alphaMap: { value: null },
|
|
14281
|
+
alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14096
14282
|
alphaTest: { value: 0 }
|
|
14097
14283
|
|
|
14098
14284
|
}
|
|
@@ -14436,7 +14622,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
14436
14622
|
specularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14437
14623
|
specularIntensity: { value: 1 },
|
|
14438
14624
|
specularIntensityMap: { value: null },
|
|
14439
|
-
specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() }
|
|
14625
|
+
specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14626
|
+
anisotropyVector: { value: /*@__PURE__*/ new Vector2() },
|
|
14627
|
+
anisotropyMap: { value: null },
|
|
14628
|
+
anisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14440
14629
|
}
|
|
14441
14630
|
] ),
|
|
14442
14631
|
|
|
@@ -14998,9 +15187,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
14998
15187
|
|
|
14999
15188
|
}
|
|
15000
15189
|
|
|
15001
|
-
function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
|
|
15190
|
+
function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
|
|
15002
15191
|
|
|
15003
|
-
if (
|
|
15192
|
+
if ( integer === true ) {
|
|
15004
15193
|
|
|
15005
15194
|
gl.vertexAttribIPointer( index, size, type, stride, offset );
|
|
15006
15195
|
|
|
@@ -15058,6 +15247,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
15058
15247
|
const type = attribute.type;
|
|
15059
15248
|
const bytesPerElement = attribute.bytesPerElement;
|
|
15060
15249
|
|
|
15250
|
+
// check for integer attributes (WebGL 2 only)
|
|
15251
|
+
|
|
15252
|
+
const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
|
|
15253
|
+
|
|
15061
15254
|
if ( geometryAttribute.isInterleavedBufferAttribute ) {
|
|
15062
15255
|
|
|
15063
15256
|
const data = geometryAttribute.data;
|
|
@@ -15098,7 +15291,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
15098
15291
|
type,
|
|
15099
15292
|
normalized,
|
|
15100
15293
|
stride * bytesPerElement,
|
|
15101
|
-
( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
|
|
15294
|
+
( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
|
|
15295
|
+
integer
|
|
15102
15296
|
);
|
|
15103
15297
|
|
|
15104
15298
|
}
|
|
@@ -15139,7 +15333,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
15139
15333
|
type,
|
|
15140
15334
|
normalized,
|
|
15141
15335
|
size * bytesPerElement,
|
|
15142
|
-
( size / programAttribute.locationSize ) * i * bytesPerElement
|
|
15336
|
+
( size / programAttribute.locationSize ) * i * bytesPerElement,
|
|
15337
|
+
integer
|
|
15143
15338
|
);
|
|
15144
15339
|
|
|
15145
15340
|
}
|
|
@@ -15847,7 +16042,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
15847
16042
|
|
|
15848
16043
|
}
|
|
15849
16044
|
|
|
15850
|
-
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far );
|
|
16045
|
+
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
|
|
15851
16046
|
|
|
15852
16047
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
15853
16048
|
|
|
@@ -16988,6 +17183,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
16988
17183
|
|
|
16989
17184
|
}
|
|
16990
17185
|
|
|
17186
|
+
for ( const name in geometry.morphAttributes ) {
|
|
17187
|
+
|
|
17188
|
+
const array = geometry.morphAttributes[ name ];
|
|
17189
|
+
|
|
17190
|
+
for ( let i = 0, l = array.length; i < l; i ++ ) {
|
|
17191
|
+
|
|
17192
|
+
attributes.remove( array[ i ] );
|
|
17193
|
+
|
|
17194
|
+
}
|
|
17195
|
+
|
|
17196
|
+
}
|
|
17197
|
+
|
|
16991
17198
|
geometry.removeEventListener( 'dispose', onGeometryDispose );
|
|
16992
17199
|
|
|
16993
17200
|
delete geometries[ geometry.id ];
|
|
@@ -17277,7 +17484,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
17277
17484
|
|
|
17278
17485
|
function reset() {
|
|
17279
17486
|
|
|
17280
|
-
render.frame ++;
|
|
17281
17487
|
render.calls = 0;
|
|
17282
17488
|
render.triangles = 0;
|
|
17283
17489
|
render.points = 0;
|
|
@@ -17618,11 +17824,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
17618
17824
|
|
|
17619
17825
|
}
|
|
17620
17826
|
|
|
17621
|
-
|
|
17827
|
+
if ( updateMap.get( object ) !== frame ) {
|
|
17828
|
+
|
|
17829
|
+
attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
|
|
17830
|
+
|
|
17831
|
+
if ( object.instanceColor !== null ) {
|
|
17832
|
+
|
|
17833
|
+
attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
|
|
17834
|
+
|
|
17835
|
+
}
|
|
17836
|
+
|
|
17837
|
+
updateMap.set( object, frame );
|
|
17838
|
+
|
|
17839
|
+
}
|
|
17840
|
+
|
|
17841
|
+
}
|
|
17842
|
+
|
|
17843
|
+
if ( object.isSkinnedMesh ) {
|
|
17622
17844
|
|
|
17623
|
-
|
|
17845
|
+
const skeleton = object.skeleton;
|
|
17624
17846
|
|
|
17625
|
-
|
|
17847
|
+
if ( updateMap.get( skeleton ) !== frame ) {
|
|
17848
|
+
|
|
17849
|
+
skeleton.update();
|
|
17850
|
+
|
|
17851
|
+
updateMap.set( skeleton, frame );
|
|
17626
17852
|
|
|
17627
17853
|
}
|
|
17628
17854
|
|
|
@@ -17702,6 +17928,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
17702
17928
|
*
|
|
17703
17929
|
*/
|
|
17704
17930
|
|
|
17931
|
+
|
|
17705
17932
|
const emptyTexture = /*@__PURE__*/ new Texture();
|
|
17706
17933
|
const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
|
|
17707
17934
|
const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
|
|
@@ -19018,13 +19245,30 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19018
19245
|
|
|
19019
19246
|
}
|
|
19020
19247
|
|
|
19248
|
+
const shaderChunkMap = new Map( [
|
|
19249
|
+
[ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154
|
|
19250
|
+
[ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154
|
|
19251
|
+
[ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154
|
|
19252
|
+
] );
|
|
19253
|
+
|
|
19021
19254
|
function includeReplacer( match, include ) {
|
|
19022
19255
|
|
|
19023
|
-
|
|
19256
|
+
let string = ShaderChunk[ include ];
|
|
19024
19257
|
|
|
19025
19258
|
if ( string === undefined ) {
|
|
19026
19259
|
|
|
19027
|
-
|
|
19260
|
+
const newInclude = shaderChunkMap.get( include );
|
|
19261
|
+
|
|
19262
|
+
if ( newInclude !== undefined ) {
|
|
19263
|
+
|
|
19264
|
+
string = ShaderChunk[ newInclude ];
|
|
19265
|
+
console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
|
|
19266
|
+
|
|
19267
|
+
} else {
|
|
19268
|
+
|
|
19269
|
+
throw new Error( 'Can not resolve #include <' + include + '>' );
|
|
19270
|
+
|
|
19271
|
+
}
|
|
19028
19272
|
|
|
19029
19273
|
}
|
|
19030
19274
|
|
|
@@ -19225,6 +19469,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19225
19469
|
|
|
19226
19470
|
prefixVertex = [
|
|
19227
19471
|
|
|
19472
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19473
|
+
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19474
|
+
|
|
19228
19475
|
customDefines
|
|
19229
19476
|
|
|
19230
19477
|
].filter( filterEmptyLine ).join( '\n' );
|
|
@@ -19238,6 +19485,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19238
19485
|
prefixFragment = [
|
|
19239
19486
|
|
|
19240
19487
|
customExtensions,
|
|
19488
|
+
|
|
19489
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19490
|
+
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19491
|
+
|
|
19241
19492
|
customDefines
|
|
19242
19493
|
|
|
19243
19494
|
].filter( filterEmptyLine ).join( '\n' );
|
|
@@ -19254,6 +19505,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19254
19505
|
|
|
19255
19506
|
generatePrecision( parameters ),
|
|
19256
19507
|
|
|
19508
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19257
19509
|
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19258
19510
|
|
|
19259
19511
|
customDefines,
|
|
@@ -19276,6 +19528,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19276
19528
|
parameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',
|
|
19277
19529
|
parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
|
|
19278
19530
|
|
|
19531
|
+
parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
|
|
19532
|
+
|
|
19279
19533
|
parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
|
|
19280
19534
|
parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
|
|
19281
19535
|
parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',
|
|
@@ -19290,6 +19544,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19290
19544
|
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
|
|
19291
19545
|
parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
|
|
19292
19546
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19547
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19293
19548
|
|
|
19294
19549
|
parameters.transmission ? '#define USE_TRANSMISSION' : '',
|
|
19295
19550
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
@@ -19312,6 +19567,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19312
19567
|
parameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',
|
|
19313
19568
|
parameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',
|
|
19314
19569
|
|
|
19570
|
+
parameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',
|
|
19571
|
+
|
|
19315
19572
|
parameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',
|
|
19316
19573
|
parameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',
|
|
19317
19574
|
parameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',
|
|
@@ -19331,7 +19588,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19331
19588
|
|
|
19332
19589
|
//
|
|
19333
19590
|
|
|
19334
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19591
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19335
19592
|
parameters.vertexColors ? '#define USE_COLOR' : '',
|
|
19336
19593
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19337
19594
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19358,6 +19615,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19358
19615
|
|
|
19359
19616
|
parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
|
|
19360
19617
|
|
|
19618
|
+
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19619
|
+
|
|
19361
19620
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19362
19621
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19363
19622
|
|
|
@@ -19461,6 +19720,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19461
19720
|
|
|
19462
19721
|
generatePrecision( parameters ),
|
|
19463
19722
|
|
|
19723
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19464
19724
|
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19465
19725
|
|
|
19466
19726
|
customDefines,
|
|
@@ -19485,6 +19745,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19485
19745
|
parameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',
|
|
19486
19746
|
parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
|
|
19487
19747
|
|
|
19748
|
+
parameters.anisotropy ? '#define USE_ANISOTROPY' : '',
|
|
19749
|
+
parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
|
|
19750
|
+
|
|
19488
19751
|
parameters.clearcoat ? '#define USE_CLEARCOAT' : '',
|
|
19489
19752
|
parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
|
|
19490
19753
|
parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
|
|
@@ -19503,6 +19766,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19503
19766
|
|
|
19504
19767
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19505
19768
|
parameters.alphaTest ? '#define USE_ALPHATEST' : '',
|
|
19769
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19506
19770
|
|
|
19507
19771
|
parameters.sheen ? '#define USE_SHEEN' : '',
|
|
19508
19772
|
parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',
|
|
@@ -19512,7 +19776,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19512
19776
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
19513
19777
|
parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
|
|
19514
19778
|
|
|
19515
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19779
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19516
19780
|
parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
|
|
19517
19781
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19518
19782
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19549,7 +19813,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19549
19813
|
parameters.dithering ? '#define DITHERING' : '',
|
|
19550
19814
|
parameters.opaque ? '#define OPAQUE' : '',
|
|
19551
19815
|
|
|
19552
|
-
ShaderChunk[ '
|
|
19816
|
+
ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
|
|
19553
19817
|
getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
|
|
19554
19818
|
|
|
19555
19819
|
parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
|
|
@@ -19756,6 +20020,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19756
20020
|
|
|
19757
20021
|
//
|
|
19758
20022
|
|
|
20023
|
+
this.type = parameters.shaderType;
|
|
19759
20024
|
this.name = parameters.shaderName;
|
|
19760
20025
|
this.id = programIdCount ++;
|
|
19761
20026
|
this.cacheKey = cacheKey;
|
|
@@ -19923,11 +20188,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
19923
20188
|
|
|
19924
20189
|
function getChannel( value ) {
|
|
19925
20190
|
|
|
19926
|
-
if ( value ===
|
|
19927
|
-
if ( value === 2 ) return 'uv2';
|
|
19928
|
-
if ( value === 3 ) return 'uv3';
|
|
20191
|
+
if ( value === 0 ) return 'uv';
|
|
19929
20192
|
|
|
19930
|
-
return
|
|
20193
|
+
return `uv${ value }`;
|
|
19931
20194
|
|
|
19932
20195
|
}
|
|
19933
20196
|
|
|
@@ -20009,11 +20272,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20009
20272
|
const HAS_METALNESSMAP = !! material.metalnessMap;
|
|
20010
20273
|
const HAS_ROUGHNESSMAP = !! material.roughnessMap;
|
|
20011
20274
|
|
|
20275
|
+
const HAS_ANISOTROPY = material.anisotropy > 0;
|
|
20012
20276
|
const HAS_CLEARCOAT = material.clearcoat > 0;
|
|
20013
20277
|
const HAS_IRIDESCENCE = material.iridescence > 0;
|
|
20014
20278
|
const HAS_SHEEN = material.sheen > 0;
|
|
20015
20279
|
const HAS_TRANSMISSION = material.transmission > 0;
|
|
20016
20280
|
|
|
20281
|
+
const HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;
|
|
20282
|
+
|
|
20017
20283
|
const HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;
|
|
20018
20284
|
const HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;
|
|
20019
20285
|
const HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;
|
|
@@ -20037,6 +20303,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20037
20303
|
|
|
20038
20304
|
const HAS_ALPHATEST = material.alphaTest > 0;
|
|
20039
20305
|
|
|
20306
|
+
const HAS_ALPHAHASH = !! material.alphaHash;
|
|
20307
|
+
|
|
20040
20308
|
const HAS_EXTENSIONS = !! material.extensions;
|
|
20041
20309
|
|
|
20042
20310
|
const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1;
|
|
@@ -20048,7 +20316,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20048
20316
|
isWebGL2: IS_WEBGL2,
|
|
20049
20317
|
|
|
20050
20318
|
shaderID: shaderID,
|
|
20051
|
-
|
|
20319
|
+
shaderType: material.type,
|
|
20320
|
+
shaderName: material.name,
|
|
20052
20321
|
|
|
20053
20322
|
vertexShader: vertexShader,
|
|
20054
20323
|
fragmentShader: fragmentShader,
|
|
@@ -20086,6 +20355,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20086
20355
|
metalnessMap: HAS_METALNESSMAP,
|
|
20087
20356
|
roughnessMap: HAS_ROUGHNESSMAP,
|
|
20088
20357
|
|
|
20358
|
+
anisotropy: HAS_ANISOTROPY,
|
|
20359
|
+
anisotropyMap: HAS_ANISOTROPYMAP,
|
|
20360
|
+
|
|
20089
20361
|
clearcoat: HAS_CLEARCOAT,
|
|
20090
20362
|
clearcoatMap: HAS_CLEARCOATMAP,
|
|
20091
20363
|
clearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,
|
|
@@ -20113,6 +20385,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20113
20385
|
|
|
20114
20386
|
alphaMap: HAS_ALPHAMAP,
|
|
20115
20387
|
alphaTest: HAS_ALPHATEST,
|
|
20388
|
+
alphaHash: HAS_ALPHAHASH,
|
|
20116
20389
|
|
|
20117
20390
|
combine: material.combine,
|
|
20118
20391
|
|
|
@@ -20129,6 +20402,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20129
20402
|
metalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),
|
|
20130
20403
|
roughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),
|
|
20131
20404
|
|
|
20405
|
+
anisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),
|
|
20406
|
+
|
|
20132
20407
|
clearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),
|
|
20133
20408
|
clearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),
|
|
20134
20409
|
clearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),
|
|
@@ -20150,7 +20425,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20150
20425
|
|
|
20151
20426
|
//
|
|
20152
20427
|
|
|
20153
|
-
vertexTangents:
|
|
20428
|
+
vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),
|
|
20154
20429
|
vertexColors: material.vertexColors,
|
|
20155
20430
|
vertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,
|
|
20156
20431
|
vertexUv1s: HAS_ATTRIBUTE_UV1,
|
|
@@ -20282,6 +20557,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20282
20557
|
array.push( parameters.emissiveMapUv );
|
|
20283
20558
|
array.push( parameters.metalnessMapUv );
|
|
20284
20559
|
array.push( parameters.roughnessMapUv );
|
|
20560
|
+
array.push( parameters.anisotropyMapUv );
|
|
20285
20561
|
array.push( parameters.clearcoatMapUv );
|
|
20286
20562
|
array.push( parameters.clearcoatNormalMapUv );
|
|
20287
20563
|
array.push( parameters.clearcoatRoughnessMapUv );
|
|
@@ -20355,6 +20631,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
20355
20631
|
_programLayers.enable( 15 );
|
|
20356
20632
|
if ( parameters.vertexTangents )
|
|
20357
20633
|
_programLayers.enable( 16 );
|
|
20634
|
+
if ( parameters.anisotropy )
|
|
20635
|
+
_programLayers.enable( 17 );
|
|
20358
20636
|
|
|
20359
20637
|
array.push( _programLayers.mask );
|
|
20360
20638
|
_programLayers.disableAll();
|
|
@@ -23735,6 +24013,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
23735
24013
|
[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
|
|
23736
24014
|
};
|
|
23737
24015
|
|
|
24016
|
+
const compareToGL = {
|
|
24017
|
+
[ NeverCompare ]: _gl.NEVER,
|
|
24018
|
+
[ AlwaysCompare ]: _gl.ALWAYS,
|
|
24019
|
+
[ LessCompare ]: _gl.LESS,
|
|
24020
|
+
[ LessEqualCompare ]: _gl.LEQUAL,
|
|
24021
|
+
[ EqualCompare ]: _gl.EQUAL,
|
|
24022
|
+
[ GreaterEqualCompare ]: _gl.GEQUAL,
|
|
24023
|
+
[ GreaterCompare ]: _gl.GREATER,
|
|
24024
|
+
[ NotEqualCompare ]: _gl.NOTEQUAL
|
|
24025
|
+
};
|
|
24026
|
+
|
|
23738
24027
|
function setTextureParameters( textureType, texture, supportsMips ) {
|
|
23739
24028
|
|
|
23740
24029
|
if ( supportsMips ) {
|
|
@@ -23779,6 +24068,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
23779
24068
|
|
|
23780
24069
|
}
|
|
23781
24070
|
|
|
24071
|
+
if ( texture.compareFunction ) {
|
|
24072
|
+
|
|
24073
|
+
_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
|
|
24074
|
+
_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
|
|
24075
|
+
|
|
24076
|
+
}
|
|
24077
|
+
|
|
23782
24078
|
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
|
|
23783
24079
|
|
|
23784
24080
|
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|
|
@@ -25512,6 +25808,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25512
25808
|
* @author mrdoob / http://mrdoob.com/
|
|
25513
25809
|
*/
|
|
25514
25810
|
|
|
25811
|
+
|
|
25515
25812
|
var cameraLPos = new Vector3();
|
|
25516
25813
|
var cameraRPos = new Vector3();
|
|
25517
25814
|
|
|
@@ -25574,6 +25871,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25574
25871
|
* @author mrdoob / http://mrdoob.com/
|
|
25575
25872
|
*/
|
|
25576
25873
|
|
|
25874
|
+
|
|
25577
25875
|
function WebVRManager( renderer ) {
|
|
25578
25876
|
|
|
25579
25877
|
var renderWidth, renderHeight;
|
|
@@ -25985,6 +26283,18 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
25985
26283
|
|
|
25986
26284
|
};
|
|
25987
26285
|
|
|
26286
|
+
// Dummy getEnvironmentBlendMode to have the same API as WebXR
|
|
26287
|
+
|
|
26288
|
+
this.getEnvironmentBlendMode = function () {
|
|
26289
|
+
|
|
26290
|
+
if ( scope.isPresenting ) {
|
|
26291
|
+
|
|
26292
|
+
return 'opaque';
|
|
26293
|
+
|
|
26294
|
+
}
|
|
26295
|
+
|
|
26296
|
+
};
|
|
26297
|
+
|
|
25988
26298
|
//
|
|
25989
26299
|
|
|
25990
26300
|
this.getStandingMatrix = function () {
|
|
@@ -26405,8 +26715,30 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
26405
26715
|
this.flipY = false;
|
|
26406
26716
|
this.generateMipmaps = false;
|
|
26407
26717
|
|
|
26718
|
+
this.compareFunction = null;
|
|
26719
|
+
|
|
26720
|
+
}
|
|
26721
|
+
|
|
26722
|
+
|
|
26723
|
+
copy( source ) {
|
|
26724
|
+
|
|
26725
|
+
super.copy( source );
|
|
26726
|
+
|
|
26727
|
+
this.compareFunction = source.compareFunction;
|
|
26728
|
+
|
|
26729
|
+
return this;
|
|
26730
|
+
|
|
26408
26731
|
}
|
|
26409
26732
|
|
|
26733
|
+
toJSON( meta ) {
|
|
26734
|
+
|
|
26735
|
+
const data = super.toJSON( meta );
|
|
26736
|
+
|
|
26737
|
+
if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;
|
|
26738
|
+
|
|
26739
|
+
return data;
|
|
26740
|
+
|
|
26741
|
+
}
|
|
26410
26742
|
|
|
26411
26743
|
}
|
|
26412
26744
|
|
|
@@ -26443,9 +26775,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
26443
26775
|
const controllers = [];
|
|
26444
26776
|
const controllerInputSources = [];
|
|
26445
26777
|
|
|
26446
|
-
const planes = new Set();
|
|
26447
|
-
const planesLastChangedTimes = new Map();
|
|
26448
|
-
|
|
26449
26778
|
//
|
|
26450
26779
|
|
|
26451
26780
|
const cameraL = new PerspectiveCamera();
|
|
@@ -26458,9 +26787,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
26458
26787
|
|
|
26459
26788
|
const cameras = [ cameraL, cameraR ];
|
|
26460
26789
|
|
|
26461
|
-
const
|
|
26462
|
-
|
|
26463
|
-
|
|
26790
|
+
const cameraXR = new ArrayCamera();
|
|
26791
|
+
cameraXR.layers.enable( 1 );
|
|
26792
|
+
cameraXR.layers.enable( 2 );
|
|
26464
26793
|
|
|
26465
26794
|
let _currentDepthNear = null;
|
|
26466
26795
|
let _currentDepthFar = null;
|
|
@@ -26945,28 +27274,28 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
26945
27274
|
|
|
26946
27275
|
if ( session === null ) return;
|
|
26947
27276
|
|
|
26948
|
-
|
|
26949
|
-
|
|
27277
|
+
cameraXR.near = cameraR.near = cameraL.near = camera.near;
|
|
27278
|
+
cameraXR.far = cameraR.far = cameraL.far = camera.far;
|
|
26950
27279
|
|
|
26951
|
-
if ( _currentDepthNear !==
|
|
27280
|
+
if ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {
|
|
26952
27281
|
|
|
26953
27282
|
// Note that the new renderState won't apply until the next frame. See #18320
|
|
26954
27283
|
|
|
26955
27284
|
session.updateRenderState( {
|
|
26956
|
-
depthNear:
|
|
26957
|
-
depthFar:
|
|
27285
|
+
depthNear: cameraXR.near,
|
|
27286
|
+
depthFar: cameraXR.far
|
|
26958
27287
|
} );
|
|
26959
27288
|
|
|
26960
|
-
_currentDepthNear =
|
|
26961
|
-
_currentDepthFar =
|
|
27289
|
+
_currentDepthNear = cameraXR.near;
|
|
27290
|
+
_currentDepthFar = cameraXR.far;
|
|
26962
27291
|
|
|
26963
27292
|
}
|
|
26964
27293
|
|
|
26965
|
-
const cameras =
|
|
27294
|
+
const cameras = cameraXR.cameras;
|
|
26966
27295
|
var object = poseTarget || camera;
|
|
26967
27296
|
const parent = object.parent;
|
|
26968
27297
|
|
|
26969
|
-
updateCamera(
|
|
27298
|
+
updateCamera( cameraXR, parent );
|
|
26970
27299
|
|
|
26971
27300
|
for ( let i = 0; i < cameras.length; i ++ ) {
|
|
26972
27301
|
|
|
@@ -26978,39 +27307,41 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
26978
27307
|
|
|
26979
27308
|
if ( cameras.length === 2 ) {
|
|
26980
27309
|
|
|
26981
|
-
setProjectionFromUnion(
|
|
27310
|
+
setProjectionFromUnion( cameraXR, cameraL, cameraR );
|
|
26982
27311
|
|
|
26983
27312
|
} else {
|
|
26984
27313
|
|
|
26985
27314
|
// assume single camera setup (AR)
|
|
26986
27315
|
|
|
26987
|
-
|
|
27316
|
+
cameraXR.projectionMatrix.copy( cameraL.projectionMatrix );
|
|
26988
27317
|
|
|
26989
27318
|
}
|
|
26990
27319
|
|
|
26991
|
-
|
|
26992
|
-
updateUserCamera( camera, cameraVR, object );
|
|
27320
|
+
updateUserCamera( camera, cameraXR, object );
|
|
26993
27321
|
|
|
26994
27322
|
};
|
|
26995
27323
|
|
|
26996
|
-
function updateUserCamera( camera,
|
|
27324
|
+
function updateUserCamera( camera, cameraXR, object ) {
|
|
26997
27325
|
|
|
26998
|
-
|
|
27326
|
+
cameraXR.matrixWorld.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
|
|
26999
27327
|
|
|
27000
|
-
|
|
27001
|
-
object.matrix.copy( cameraVR.matrix );
|
|
27002
|
-
object.matrix.decompose( object.position, object.quaternion, object.scale );
|
|
27328
|
+
if ( object.parent === null ) {
|
|
27003
27329
|
|
|
27004
|
-
|
|
27330
|
+
object.matrix.copy( cameraXR.matrixWorld );
|
|
27005
27331
|
|
|
27006
|
-
|
|
27332
|
+
} else {
|
|
27007
27333
|
|
|
27008
|
-
|
|
27334
|
+
object.matrix.copy( object.parent.matrixWorld );
|
|
27335
|
+
object.matrix.invert();
|
|
27336
|
+
object.matrix.multiply( cameraXR.matrixWorld );
|
|
27009
27337
|
|
|
27010
27338
|
}
|
|
27011
27339
|
|
|
27012
|
-
|
|
27013
|
-
|
|
27340
|
+
object.matrix.decompose( object.position, object.quaternion, object.scale );
|
|
27341
|
+
object.updateMatrixWorld( true );
|
|
27342
|
+
|
|
27343
|
+
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
27344
|
+
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
27014
27345
|
|
|
27015
27346
|
if ( camera.isPerspectiveCamera ) {
|
|
27016
27347
|
|
|
@@ -27023,7 +27354,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27023
27354
|
|
|
27024
27355
|
this.getCamera = function () {
|
|
27025
27356
|
|
|
27026
|
-
return
|
|
27357
|
+
return cameraXR;
|
|
27027
27358
|
|
|
27028
27359
|
};
|
|
27029
27360
|
|
|
@@ -27060,12 +27391,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27060
27391
|
|
|
27061
27392
|
};
|
|
27062
27393
|
|
|
27063
|
-
this.getPlanes = function () {
|
|
27064
|
-
|
|
27065
|
-
return planes;
|
|
27066
|
-
|
|
27067
|
-
};
|
|
27068
|
-
|
|
27069
27394
|
// Animation Loop
|
|
27070
27395
|
|
|
27071
27396
|
let onAnimationFrameCallback = null;
|
|
@@ -27086,14 +27411,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27086
27411
|
|
|
27087
27412
|
}
|
|
27088
27413
|
|
|
27089
|
-
let
|
|
27414
|
+
let cameraXRNeedsUpdate = false;
|
|
27090
27415
|
|
|
27091
|
-
// check if it's necessary to rebuild
|
|
27416
|
+
// check if it's necessary to rebuild cameraXR's camera list
|
|
27092
27417
|
|
|
27093
|
-
if ( views.length !==
|
|
27418
|
+
if ( views.length !== cameraXR.cameras.length ) {
|
|
27094
27419
|
|
|
27095
|
-
|
|
27096
|
-
|
|
27420
|
+
cameraXR.cameras.length = 0;
|
|
27421
|
+
cameraXRNeedsUpdate = true;
|
|
27097
27422
|
|
|
27098
27423
|
}
|
|
27099
27424
|
|
|
@@ -27145,14 +27470,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27145
27470
|
|
|
27146
27471
|
if ( i === 0 ) {
|
|
27147
27472
|
|
|
27148
|
-
|
|
27149
|
-
|
|
27473
|
+
cameraXR.matrix.copy( camera.matrix );
|
|
27474
|
+
cameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
|
|
27150
27475
|
|
|
27151
27476
|
}
|
|
27152
27477
|
|
|
27153
|
-
if (
|
|
27478
|
+
if ( cameraXRNeedsUpdate === true ) {
|
|
27154
27479
|
|
|
27155
|
-
|
|
27480
|
+
cameraXR.cameras.push( camera );
|
|
27156
27481
|
|
|
27157
27482
|
}
|
|
27158
27483
|
|
|
@@ -27179,60 +27504,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27179
27504
|
|
|
27180
27505
|
if ( frame.detectedPlanes ) {
|
|
27181
27506
|
|
|
27182
|
-
scope.dispatchEvent( { type: 'planesdetected', data: frame
|
|
27183
|
-
|
|
27184
|
-
let planesToRemove = null;
|
|
27185
|
-
|
|
27186
|
-
for ( const plane of planes ) {
|
|
27187
|
-
|
|
27188
|
-
if ( ! frame.detectedPlanes.has( plane ) ) {
|
|
27189
|
-
|
|
27190
|
-
if ( planesToRemove === null ) {
|
|
27191
|
-
|
|
27192
|
-
planesToRemove = [];
|
|
27193
|
-
|
|
27194
|
-
}
|
|
27195
|
-
|
|
27196
|
-
planesToRemove.push( plane );
|
|
27197
|
-
|
|
27198
|
-
}
|
|
27199
|
-
|
|
27200
|
-
}
|
|
27201
|
-
|
|
27202
|
-
if ( planesToRemove !== null ) {
|
|
27203
|
-
|
|
27204
|
-
for ( const plane of planesToRemove ) {
|
|
27205
|
-
|
|
27206
|
-
planes.delete( plane );
|
|
27207
|
-
planesLastChangedTimes.delete( plane );
|
|
27208
|
-
scope.dispatchEvent( { type: 'planeremoved', data: plane } );
|
|
27209
|
-
|
|
27210
|
-
}
|
|
27211
|
-
|
|
27212
|
-
}
|
|
27213
|
-
|
|
27214
|
-
for ( const plane of frame.detectedPlanes ) {
|
|
27215
|
-
|
|
27216
|
-
if ( ! planes.has( plane ) ) {
|
|
27217
|
-
|
|
27218
|
-
planes.add( plane );
|
|
27219
|
-
planesLastChangedTimes.set( plane, frame.lastChangedTime );
|
|
27220
|
-
scope.dispatchEvent( { type: 'planeadded', data: plane } );
|
|
27221
|
-
|
|
27222
|
-
} else {
|
|
27223
|
-
|
|
27224
|
-
const lastKnownTime = planesLastChangedTimes.get( plane );
|
|
27225
|
-
|
|
27226
|
-
if ( plane.lastChangedTime > lastKnownTime ) {
|
|
27227
|
-
|
|
27228
|
-
planesLastChangedTimes.set( plane, plane.lastChangedTime );
|
|
27229
|
-
scope.dispatchEvent( { type: 'planechanged', data: plane } );
|
|
27230
|
-
|
|
27231
|
-
}
|
|
27232
|
-
|
|
27233
|
-
}
|
|
27234
|
-
|
|
27235
|
-
}
|
|
27507
|
+
scope.dispatchEvent( { type: 'planesdetected', data: frame } );
|
|
27236
27508
|
|
|
27237
27509
|
}
|
|
27238
27510
|
|
|
@@ -27544,6 +27816,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27544
27816
|
|
|
27545
27817
|
uniforms.alphaMap.value = material.alphaMap;
|
|
27546
27818
|
|
|
27819
|
+
refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
|
|
27820
|
+
|
|
27547
27821
|
}
|
|
27548
27822
|
|
|
27549
27823
|
if ( material.alphaTest > 0 ) {
|
|
@@ -27572,6 +27846,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27572
27846
|
|
|
27573
27847
|
uniforms.alphaMap.value = material.alphaMap;
|
|
27574
27848
|
|
|
27849
|
+
refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
|
|
27850
|
+
|
|
27575
27851
|
}
|
|
27576
27852
|
|
|
27577
27853
|
if ( material.alphaTest > 0 ) {
|
|
@@ -27753,6 +28029,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
27753
28029
|
|
|
27754
28030
|
}
|
|
27755
28031
|
|
|
28032
|
+
if ( material.anisotropy > 0 ) {
|
|
28033
|
+
|
|
28034
|
+
uniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );
|
|
28035
|
+
|
|
28036
|
+
if ( material.anisotropyMap ) {
|
|
28037
|
+
|
|
28038
|
+
uniforms.anisotropyMap.value = material.anisotropyMap;
|
|
28039
|
+
|
|
28040
|
+
refreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );
|
|
28041
|
+
|
|
28042
|
+
}
|
|
28043
|
+
|
|
28044
|
+
}
|
|
28045
|
+
|
|
27756
28046
|
uniforms.specularIntensity.value = material.specularIntensity;
|
|
27757
28047
|
uniforms.specularColor.value.copy( material.specularColor );
|
|
27758
28048
|
|
|
@@ -28251,6 +28541,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28251
28541
|
|
|
28252
28542
|
}
|
|
28253
28543
|
|
|
28544
|
+
const uintClearColor = new Uint32Array( 4 );
|
|
28545
|
+
const intClearColor = new Int32Array( 4 );
|
|
28546
|
+
|
|
28254
28547
|
let currentRenderList = null;
|
|
28255
28548
|
let currentRenderState = null;
|
|
28256
28549
|
|
|
@@ -28327,6 +28620,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28327
28620
|
const _currentScissor = new Vector4();
|
|
28328
28621
|
let _currentScissorTest = null;
|
|
28329
28622
|
|
|
28623
|
+
const _currentClearColor = new Color( 0x000000 );
|
|
28624
|
+
let _currentClearAlpha = 0;
|
|
28625
|
+
|
|
28330
28626
|
//
|
|
28331
28627
|
|
|
28332
28628
|
let _width = canvas.width;
|
|
@@ -28357,6 +28653,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28357
28653
|
|
|
28358
28654
|
const _projScreenMatrix = new Matrix4();
|
|
28359
28655
|
|
|
28656
|
+
const _vector2 = new Vector2();
|
|
28360
28657
|
const _vector3 = new Vector3();
|
|
28361
28658
|
|
|
28362
28659
|
const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
|
|
@@ -28434,6 +28731,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28434
28731
|
|
|
28435
28732
|
}
|
|
28436
28733
|
|
|
28734
|
+
if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
28735
|
+
|
|
28736
|
+
console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
|
|
28737
|
+
|
|
28738
|
+
}
|
|
28739
|
+
|
|
28437
28740
|
// Some experimental-webgl implementations do not have getShaderPrecisionFormat
|
|
28438
28741
|
|
|
28439
28742
|
if ( _gl.getShaderPrecisionFormat === undefined ) {
|
|
@@ -28715,7 +29018,63 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
28715
29018
|
|
|
28716
29019
|
let bits = 0;
|
|
28717
29020
|
|
|
28718
|
-
if ( color )
|
|
29021
|
+
if ( color ) {
|
|
29022
|
+
|
|
29023
|
+
// check if we're trying to clear an integer target
|
|
29024
|
+
let isIntegerFormat = false;
|
|
29025
|
+
if ( _currentRenderTarget !== null ) {
|
|
29026
|
+
|
|
29027
|
+
const targetFormat = _currentRenderTarget.texture.format;
|
|
29028
|
+
isIntegerFormat = targetFormat === RGBAIntegerFormat ||
|
|
29029
|
+
targetFormat === RGIntegerFormat ||
|
|
29030
|
+
targetFormat === RedIntegerFormat;
|
|
29031
|
+
|
|
29032
|
+
}
|
|
29033
|
+
|
|
29034
|
+
// use the appropriate clear functions to clear the target if it's a signed
|
|
29035
|
+
// or unsigned integer target
|
|
29036
|
+
if ( isIntegerFormat ) {
|
|
29037
|
+
|
|
29038
|
+
const targetType = _currentRenderTarget.texture.type;
|
|
29039
|
+
const isUnsignedType = targetType === UnsignedByteType ||
|
|
29040
|
+
targetType === UnsignedIntType ||
|
|
29041
|
+
targetType === UnsignedShortType ||
|
|
29042
|
+
targetType === UnsignedInt248Type ||
|
|
29043
|
+
targetType === UnsignedShort4444Type ||
|
|
29044
|
+
targetType === UnsignedShort5551Type;
|
|
29045
|
+
|
|
29046
|
+
const clearColor = background.getClearColor();
|
|
29047
|
+
const a = background.getClearAlpha();
|
|
29048
|
+
const r = clearColor.r;
|
|
29049
|
+
const g = clearColor.g;
|
|
29050
|
+
const b = clearColor.b;
|
|
29051
|
+
|
|
29052
|
+
if ( isUnsignedType ) {
|
|
29053
|
+
|
|
29054
|
+
uintClearColor[ 0 ] = r;
|
|
29055
|
+
uintClearColor[ 1 ] = g;
|
|
29056
|
+
uintClearColor[ 2 ] = b;
|
|
29057
|
+
uintClearColor[ 3 ] = a;
|
|
29058
|
+
_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );
|
|
29059
|
+
|
|
29060
|
+
} else {
|
|
29061
|
+
|
|
29062
|
+
intClearColor[ 0 ] = r;
|
|
29063
|
+
intClearColor[ 1 ] = g;
|
|
29064
|
+
intClearColor[ 2 ] = b;
|
|
29065
|
+
intClearColor[ 3 ] = a;
|
|
29066
|
+
_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );
|
|
29067
|
+
|
|
29068
|
+
}
|
|
29069
|
+
|
|
29070
|
+
} else {
|
|
29071
|
+
|
|
29072
|
+
bits |= _gl.COLOR_BUFFER_BIT;
|
|
29073
|
+
|
|
29074
|
+
}
|
|
29075
|
+
|
|
29076
|
+
}
|
|
29077
|
+
|
|
28719
29078
|
if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
|
|
28720
29079
|
if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
|
|
28721
29080
|
|
|
@@ -29174,6 +29533,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29174
29533
|
|
|
29175
29534
|
//
|
|
29176
29535
|
|
|
29536
|
+
this.info.render.frame ++;
|
|
29537
|
+
|
|
29177
29538
|
if ( _clippingEnabled === true ) clipping.beginShadows();
|
|
29178
29539
|
|
|
29179
29540
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
@@ -29186,6 +29547,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29186
29547
|
|
|
29187
29548
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
29188
29549
|
|
|
29550
|
+
|
|
29189
29551
|
//
|
|
29190
29552
|
|
|
29191
29553
|
background.render( currentRenderList, scene );
|
|
@@ -29319,28 +29681,24 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29319
29681
|
|
|
29320
29682
|
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
|
|
29321
29683
|
|
|
29322
|
-
|
|
29323
|
-
|
|
29324
|
-
// update skeleton only once in a frame
|
|
29325
|
-
|
|
29326
|
-
if ( object.skeleton.frame !== info.render.frame ) {
|
|
29684
|
+
const geometry = objects.update( object );
|
|
29685
|
+
const material = object.material;
|
|
29327
29686
|
|
|
29328
|
-
|
|
29329
|
-
object.skeleton.frame = info.render.frame;
|
|
29687
|
+
if ( sortObjects ) {
|
|
29330
29688
|
|
|
29331
|
-
|
|
29689
|
+
if ( object.boundingSphere !== undefined ) {
|
|
29332
29690
|
|
|
29333
|
-
|
|
29691
|
+
if ( object.boundingSphere === null ) object.computeBoundingSphere();
|
|
29692
|
+
_vector3.copy( object.boundingSphere.center );
|
|
29334
29693
|
|
|
29335
|
-
|
|
29336
|
-
const material = object.material;
|
|
29694
|
+
} else {
|
|
29337
29695
|
|
|
29338
|
-
|
|
29696
|
+
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
29697
|
+
_vector3.copy( geometry.boundingSphere.center );
|
|
29339
29698
|
|
|
29340
|
-
|
|
29699
|
+
}
|
|
29341
29700
|
|
|
29342
29701
|
_vector3
|
|
29343
|
-
.copy( geometry.boundingSphere.center )
|
|
29344
29702
|
.applyMatrix4( object.matrixWorld )
|
|
29345
29703
|
.applyMatrix4( _projScreenMatrix );
|
|
29346
29704
|
|
|
@@ -29415,15 +29773,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29415
29773
|
|
|
29416
29774
|
function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
|
|
29417
29775
|
|
|
29418
|
-
|
|
29776
|
+
const isWebGL2 = capabilities.isWebGL2;
|
|
29419
29777
|
|
|
29420
|
-
|
|
29778
|
+
if ( _transmissionRenderTarget === null ) {
|
|
29421
29779
|
|
|
29422
|
-
_transmissionRenderTarget = new WebGLRenderTarget(
|
|
29780
|
+
_transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
|
|
29423
29781
|
generateMipmaps: true,
|
|
29424
29782
|
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
|
|
29425
29783
|
minFilter: LinearMipmapLinearFilter,
|
|
29426
|
-
samples: ( isWebGL2
|
|
29784
|
+
samples: ( isWebGL2 ) ? 4 : 0
|
|
29427
29785
|
} );
|
|
29428
29786
|
|
|
29429
29787
|
// debug
|
|
@@ -29438,10 +29796,27 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29438
29796
|
|
|
29439
29797
|
}
|
|
29440
29798
|
|
|
29799
|
+
_this.getDrawingBufferSize( _vector2 );
|
|
29800
|
+
|
|
29801
|
+
if ( isWebGL2 ) {
|
|
29802
|
+
|
|
29803
|
+
_transmissionRenderTarget.setSize( _vector2.x, _vector2.y );
|
|
29804
|
+
|
|
29805
|
+
} else {
|
|
29806
|
+
|
|
29807
|
+
_transmissionRenderTarget.setSize( floorPowerOfTwo( _vector2.x ), floorPowerOfTwo( _vector2.y ) );
|
|
29808
|
+
|
|
29809
|
+
}
|
|
29810
|
+
|
|
29441
29811
|
//
|
|
29442
29812
|
|
|
29443
29813
|
const currentRenderTarget = _this.getRenderTarget();
|
|
29444
29814
|
_this.setRenderTarget( _transmissionRenderTarget );
|
|
29815
|
+
|
|
29816
|
+
_this.getClearColor( _currentClearColor );
|
|
29817
|
+
_currentClearAlpha = _this.getClearAlpha();
|
|
29818
|
+
if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
|
|
29819
|
+
|
|
29445
29820
|
_this.clear();
|
|
29446
29821
|
|
|
29447
29822
|
// Turn off the features which can affect the frag color for opaque objects pass.
|
|
@@ -29492,6 +29867,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29492
29867
|
|
|
29493
29868
|
_this.setRenderTarget( currentRenderTarget );
|
|
29494
29869
|
|
|
29870
|
+
_this.setClearColor( _currentClearColor, _currentClearAlpha );
|
|
29871
|
+
|
|
29495
29872
|
_this.toneMapping = currentToneMapping;
|
|
29496
29873
|
|
|
29497
29874
|
}
|
|
@@ -29695,7 +30072,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
29695
30072
|
const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );
|
|
29696
30073
|
const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
|
|
29697
30074
|
const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
|
|
29698
|
-
const vertexTangents = !!
|
|
30075
|
+
const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );
|
|
29699
30076
|
const morphTargets = !! geometry.morphAttributes.position;
|
|
29700
30077
|
const morphNormals = !! geometry.morphAttributes.normal;
|
|
29701
30078
|
const morphColors = !! geometry.morphAttributes.color;
|
|
@@ -30495,6 +30872,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
30495
30872
|
|
|
30496
30873
|
}
|
|
30497
30874
|
|
|
30875
|
+
get coordinateSystem() {
|
|
30876
|
+
|
|
30877
|
+
return WebGLCoordinateSystem;
|
|
30878
|
+
|
|
30879
|
+
}
|
|
30880
|
+
|
|
30498
30881
|
get physicallyCorrectLights() { // @deprecated, r150
|
|
30499
30882
|
|
|
30500
30883
|
console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
@@ -30652,20 +31035,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
30652
31035
|
|
|
30653
31036
|
}
|
|
30654
31037
|
|
|
30655
|
-
get autoUpdate() { // @deprecated, r144
|
|
30656
|
-
|
|
30657
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
30658
|
-
return this.matrixWorldAutoUpdate;
|
|
30659
|
-
|
|
30660
|
-
}
|
|
30661
|
-
|
|
30662
|
-
set autoUpdate( value ) { // @deprecated, r144
|
|
30663
|
-
|
|
30664
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
30665
|
-
this.matrixWorldAutoUpdate = value;
|
|
30666
|
-
|
|
30667
|
-
}
|
|
30668
|
-
|
|
30669
31038
|
}
|
|
30670
31039
|
|
|
30671
31040
|
class InterleavedBuffer {
|
|
@@ -31572,7 +31941,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
31572
31941
|
const _matrix4 = /*@__PURE__*/ new Matrix4();
|
|
31573
31942
|
const _vertex = /*@__PURE__*/ new Vector3();
|
|
31574
31943
|
|
|
31575
|
-
|
|
31944
|
+
const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
31945
|
+
const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
31946
|
+
const _ray$2 = /*@__PURE__*/ new Ray();
|
|
31576
31947
|
|
|
31577
31948
|
class SkinnedMesh extends Mesh {
|
|
31578
31949
|
|
|
@@ -31651,22 +32022,47 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
31651
32022
|
|
|
31652
32023
|
this.skeleton = source.skeleton;
|
|
31653
32024
|
|
|
32025
|
+
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
32026
|
+
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
32027
|
+
|
|
31654
32028
|
return this;
|
|
31655
32029
|
|
|
31656
32030
|
}
|
|
31657
32031
|
|
|
31658
|
-
|
|
32032
|
+
raycast( raycaster, intersects ) {
|
|
31659
32033
|
|
|
31660
|
-
|
|
32034
|
+
const material = this.material;
|
|
32035
|
+
const matrixWorld = this.matrixWorld;
|
|
32036
|
+
|
|
32037
|
+
if ( material === undefined ) return;
|
|
32038
|
+
|
|
32039
|
+
// test with bounding sphere in world space
|
|
32040
|
+
|
|
32041
|
+
if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
32042
|
+
|
|
32043
|
+
_sphere$3.copy( this.boundingSphere );
|
|
32044
|
+
_sphere$3.applyMatrix4( matrixWorld );
|
|
32045
|
+
|
|
32046
|
+
if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
|
|
32047
|
+
|
|
32048
|
+
// convert ray to local space of skinned mesh
|
|
31661
32049
|
|
|
31662
|
-
|
|
31663
|
-
|
|
32050
|
+
_inverseMatrix$2.copy( matrixWorld ).invert();
|
|
32051
|
+
_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
|
|
32052
|
+
|
|
32053
|
+
// test with bounding box in local space
|
|
32054
|
+
|
|
32055
|
+
if ( this.boundingBox !== null ) {
|
|
31664
32056
|
|
|
31665
|
-
|
|
32057
|
+
if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;
|
|
31666
32058
|
|
|
31667
|
-
|
|
32059
|
+
}
|
|
32060
|
+
|
|
32061
|
+
// test for intersections with geometry
|
|
31668
32062
|
|
|
31669
|
-
|
|
32063
|
+
this._computeIntersections( raycaster, intersects, _ray$2 );
|
|
32064
|
+
|
|
32065
|
+
}
|
|
31670
32066
|
|
|
31671
32067
|
getVertexPosition( index, target ) {
|
|
31672
32068
|
|
|
@@ -31841,8 +32237,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
31841
32237
|
this.boneTexture = null;
|
|
31842
32238
|
this.boneTextureSize = 0;
|
|
31843
32239
|
|
|
31844
|
-
this.frame = - 1;
|
|
31845
|
-
|
|
31846
32240
|
this.init();
|
|
31847
32241
|
|
|
31848
32242
|
}
|
|
@@ -32067,7 +32461,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
32067
32461
|
|
|
32068
32462
|
const data = {
|
|
32069
32463
|
metadata: {
|
|
32070
|
-
version: 4.
|
|
32464
|
+
version: 4.6,
|
|
32071
32465
|
type: 'Skeleton',
|
|
32072
32466
|
generator: 'Skeleton.toJSON'
|
|
32073
32467
|
},
|
|
@@ -32238,6 +32632,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
32238
32632
|
|
|
32239
32633
|
this.count = source.count;
|
|
32240
32634
|
|
|
32635
|
+
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
32636
|
+
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
32637
|
+
|
|
32241
32638
|
return this;
|
|
32242
32639
|
|
|
32243
32640
|
}
|
|
@@ -32913,14 +33310,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
32913
33310
|
|
|
32914
33311
|
class FramebufferTexture extends Texture {
|
|
32915
33312
|
|
|
32916
|
-
constructor( width, height
|
|
33313
|
+
constructor( width, height ) {
|
|
32917
33314
|
|
|
32918
33315
|
super( { width, height } );
|
|
32919
33316
|
|
|
32920
33317
|
this.isFramebufferTexture = true;
|
|
32921
33318
|
|
|
32922
|
-
this.format = format;
|
|
32923
|
-
|
|
32924
33319
|
this.magFilter = NearestFilter;
|
|
32925
33320
|
this.minFilter = NearestFilter;
|
|
32926
33321
|
|
|
@@ -33371,7 +33766,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
33371
33766
|
|
|
33372
33767
|
const data = {
|
|
33373
33768
|
metadata: {
|
|
33374
|
-
version: 4.
|
|
33769
|
+
version: 4.6,
|
|
33375
33770
|
type: 'Curve',
|
|
33376
33771
|
generator: 'Curve.toJSON'
|
|
33377
33772
|
}
|
|
@@ -37013,6 +37408,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
37013
37408
|
* }
|
|
37014
37409
|
*/
|
|
37015
37410
|
|
|
37411
|
+
|
|
37016
37412
|
class ExtrudeGeometry extends BufferGeometry {
|
|
37017
37413
|
|
|
37018
37414
|
constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
|
|
@@ -39159,6 +39555,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
39159
39555
|
|
|
39160
39556
|
this.type = 'MeshPhysicalMaterial';
|
|
39161
39557
|
|
|
39558
|
+
this.anisotropyRotation = 0;
|
|
39559
|
+
this.anisotropyMap = null;
|
|
39560
|
+
|
|
39162
39561
|
this.clearcoatMap = null;
|
|
39163
39562
|
this.clearcoatRoughness = 0.0;
|
|
39164
39563
|
this.clearcoatRoughnessMap = null;
|
|
@@ -39202,30 +39601,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
39202
39601
|
this.specularColor = new Color( 1, 1, 1 );
|
|
39203
39602
|
this.specularColorMap = null;
|
|
39204
39603
|
|
|
39205
|
-
this.
|
|
39604
|
+
this._anisotropy = 0;
|
|
39206
39605
|
this._clearcoat = 0;
|
|
39207
39606
|
this._iridescence = 0;
|
|
39607
|
+
this._sheen = 0.0;
|
|
39208
39608
|
this._transmission = 0;
|
|
39209
39609
|
|
|
39210
39610
|
this.setValues( parameters );
|
|
39211
39611
|
|
|
39212
39612
|
}
|
|
39213
39613
|
|
|
39214
|
-
get
|
|
39614
|
+
get anisotropy() {
|
|
39215
39615
|
|
|
39216
|
-
return this.
|
|
39616
|
+
return this._anisotropy;
|
|
39217
39617
|
|
|
39218
39618
|
}
|
|
39219
39619
|
|
|
39220
|
-
set
|
|
39620
|
+
set anisotropy( value ) {
|
|
39221
39621
|
|
|
39222
|
-
if ( this.
|
|
39622
|
+
if ( this._anisotropy > 0 !== value > 0 ) {
|
|
39223
39623
|
|
|
39224
39624
|
this.version ++;
|
|
39225
39625
|
|
|
39226
39626
|
}
|
|
39227
39627
|
|
|
39228
|
-
this.
|
|
39628
|
+
this._anisotropy = value;
|
|
39229
39629
|
|
|
39230
39630
|
}
|
|
39231
39631
|
|
|
@@ -39265,6 +39665,24 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
39265
39665
|
|
|
39266
39666
|
}
|
|
39267
39667
|
|
|
39668
|
+
get sheen() {
|
|
39669
|
+
|
|
39670
|
+
return this._sheen;
|
|
39671
|
+
|
|
39672
|
+
}
|
|
39673
|
+
|
|
39674
|
+
set sheen( value ) {
|
|
39675
|
+
|
|
39676
|
+
if ( this._sheen > 0 !== value > 0 ) {
|
|
39677
|
+
|
|
39678
|
+
this.version ++;
|
|
39679
|
+
|
|
39680
|
+
}
|
|
39681
|
+
|
|
39682
|
+
this._sheen = value;
|
|
39683
|
+
|
|
39684
|
+
}
|
|
39685
|
+
|
|
39268
39686
|
get transmission() {
|
|
39269
39687
|
|
|
39270
39688
|
return this._transmission;
|
|
@@ -39294,6 +39712,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
39294
39712
|
|
|
39295
39713
|
};
|
|
39296
39714
|
|
|
39715
|
+
this.anisotropy = source.anisotropy;
|
|
39716
|
+
this.anisotropyRotation = source.anisotropyRotation;
|
|
39717
|
+
this.anisotropyMap = source.anisotropyMap;
|
|
39718
|
+
|
|
39297
39719
|
this.clearcoat = source.clearcoat;
|
|
39298
39720
|
this.clearcoatMap = source.clearcoatMap;
|
|
39299
39721
|
this.clearcoatRoughness = source.clearcoatRoughness;
|
|
@@ -41873,6 +42295,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
41873
42295
|
|
|
41874
42296
|
}
|
|
41875
42297
|
|
|
42298
|
+
Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT';
|
|
42299
|
+
|
|
41876
42300
|
const loading = {};
|
|
41877
42301
|
|
|
41878
42302
|
class HttpError extends Error {
|
|
@@ -42435,6 +42859,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
42435
42859
|
load( urls, onLoad, onProgress, onError ) {
|
|
42436
42860
|
|
|
42437
42861
|
const texture = new CubeTexture();
|
|
42862
|
+
texture.colorSpace = SRGBColorSpace;
|
|
42438
42863
|
|
|
42439
42864
|
const loader = new ImageLoader( this.manager );
|
|
42440
42865
|
loader.setCrossOrigin( this.crossOrigin );
|
|
@@ -43578,6 +44003,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
43578
44003
|
if ( json.thickness !== undefined ) material.thickness = json.thickness;
|
|
43579
44004
|
if ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;
|
|
43580
44005
|
if ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );
|
|
44006
|
+
if ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;
|
|
44007
|
+
if ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;
|
|
43581
44008
|
if ( json.fog !== undefined ) material.fog = json.fog;
|
|
43582
44009
|
if ( json.flatShading !== undefined ) material.flatShading = json.flatShading;
|
|
43583
44010
|
if ( json.blending !== undefined ) material.blending = json.blending;
|
|
@@ -43587,6 +44014,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
43587
44014
|
if ( json.opacity !== undefined ) material.opacity = json.opacity;
|
|
43588
44015
|
if ( json.transparent !== undefined ) material.transparent = json.transparent;
|
|
43589
44016
|
if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;
|
|
44017
|
+
if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;
|
|
43590
44018
|
if ( json.depthTest !== undefined ) material.depthTest = json.depthTest;
|
|
43591
44019
|
if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;
|
|
43592
44020
|
if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;
|
|
@@ -43781,6 +44209,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
43781
44209
|
if ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );
|
|
43782
44210
|
if ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );
|
|
43783
44211
|
|
|
44212
|
+
if ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );
|
|
44213
|
+
|
|
43784
44214
|
if ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );
|
|
43785
44215
|
if ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );
|
|
43786
44216
|
|
|
@@ -44768,6 +45198,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
44768
45198
|
if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
|
|
44769
45199
|
if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
|
|
44770
45200
|
if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
|
|
45201
|
+
if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
|
|
44771
45202
|
|
|
44772
45203
|
if ( data.userData !== undefined ) texture.userData = data.userData;
|
|
44773
45204
|
|
|
@@ -46119,6 +46550,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
46119
46550
|
|
|
46120
46551
|
}
|
|
46121
46552
|
|
|
46553
|
+
connect() {
|
|
46554
|
+
|
|
46555
|
+
super.connect();
|
|
46556
|
+
|
|
46557
|
+
this.panner.connect( this.gain );
|
|
46558
|
+
|
|
46559
|
+
}
|
|
46560
|
+
|
|
46122
46561
|
disconnect() {
|
|
46123
46562
|
|
|
46124
46563
|
super.disconnect();
|
|
@@ -49464,6 +49903,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
49464
49903
|
* The azimuthal angle (theta) is measured from the positive z-axis.
|
|
49465
49904
|
*/
|
|
49466
49905
|
|
|
49906
|
+
|
|
49467
49907
|
class Spherical {
|
|
49468
49908
|
|
|
49469
49909
|
constructor( radius = 1, phi = 0, theta = 0 ) {
|
|
@@ -51414,216 +51854,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51414
51854
|
|
|
51415
51855
|
}
|
|
51416
51856
|
|
|
51417
|
-
class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144
|
|
51418
|
-
|
|
51419
|
-
constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {
|
|
51420
|
-
|
|
51421
|
-
console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' );
|
|
51422
|
-
super( width, height, depth, widthSegments, heightSegments, depthSegments );
|
|
51423
|
-
|
|
51424
|
-
|
|
51425
|
-
}
|
|
51426
|
-
|
|
51427
|
-
}
|
|
51428
|
-
|
|
51429
|
-
class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144
|
|
51430
|
-
|
|
51431
|
-
constructor( radius, length, capSegments, radialSegments ) {
|
|
51432
|
-
|
|
51433
|
-
console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' );
|
|
51434
|
-
super( radius, length, capSegments, radialSegments );
|
|
51435
|
-
|
|
51436
|
-
}
|
|
51437
|
-
|
|
51438
|
-
}
|
|
51439
|
-
|
|
51440
|
-
class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144
|
|
51441
|
-
|
|
51442
|
-
constructor( radius, segments, thetaStart, thetaLength ) {
|
|
51443
|
-
|
|
51444
|
-
console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' );
|
|
51445
|
-
super( radius, segments, thetaStart, thetaLength );
|
|
51446
|
-
|
|
51447
|
-
}
|
|
51448
|
-
|
|
51449
|
-
}
|
|
51450
|
-
|
|
51451
|
-
class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144
|
|
51452
|
-
|
|
51453
|
-
constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
51454
|
-
|
|
51455
|
-
console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' );
|
|
51456
|
-
super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
51457
|
-
|
|
51458
|
-
}
|
|
51459
|
-
|
|
51460
|
-
}
|
|
51461
|
-
|
|
51462
|
-
class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144
|
|
51463
|
-
|
|
51464
|
-
constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
51465
|
-
|
|
51466
|
-
console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' );
|
|
51467
|
-
super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
51468
|
-
|
|
51469
|
-
}
|
|
51470
|
-
|
|
51471
|
-
}
|
|
51472
|
-
|
|
51473
|
-
class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144
|
|
51474
|
-
|
|
51475
|
-
constructor( radius, detail ) {
|
|
51476
|
-
|
|
51477
|
-
console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' );
|
|
51478
|
-
super( radius, detail );
|
|
51479
|
-
|
|
51480
|
-
}
|
|
51481
|
-
|
|
51482
|
-
}
|
|
51483
|
-
|
|
51484
|
-
class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144
|
|
51485
|
-
|
|
51486
|
-
constructor( shapes, options ) {
|
|
51487
|
-
|
|
51488
|
-
console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' );
|
|
51489
|
-
super( shapes, options );
|
|
51490
|
-
|
|
51491
|
-
}
|
|
51492
|
-
|
|
51493
|
-
}
|
|
51494
|
-
|
|
51495
|
-
class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144
|
|
51496
|
-
|
|
51497
|
-
constructor( radius, detail ) {
|
|
51498
|
-
|
|
51499
|
-
console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' );
|
|
51500
|
-
super( radius, detail );
|
|
51501
|
-
|
|
51502
|
-
}
|
|
51503
|
-
|
|
51504
|
-
}
|
|
51505
|
-
|
|
51506
|
-
class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144
|
|
51507
|
-
|
|
51508
|
-
constructor( points, segments, phiStart, phiLength ) {
|
|
51509
|
-
|
|
51510
|
-
console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' );
|
|
51511
|
-
super( points, segments, phiStart, phiLength );
|
|
51512
|
-
|
|
51513
|
-
}
|
|
51514
|
-
|
|
51515
|
-
}
|
|
51516
|
-
|
|
51517
|
-
class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144
|
|
51518
|
-
|
|
51519
|
-
constructor( radius, detail ) {
|
|
51520
|
-
|
|
51521
|
-
console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' );
|
|
51522
|
-
super( radius, detail );
|
|
51523
|
-
|
|
51524
|
-
}
|
|
51525
|
-
|
|
51526
|
-
}
|
|
51527
|
-
|
|
51528
|
-
class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144
|
|
51529
|
-
|
|
51530
|
-
constructor( width, height, widthSegments, heightSegments ) {
|
|
51531
|
-
|
|
51532
|
-
console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' );
|
|
51533
|
-
super( width, height, widthSegments, heightSegments );
|
|
51534
|
-
|
|
51535
|
-
}
|
|
51536
|
-
|
|
51537
|
-
}
|
|
51538
|
-
|
|
51539
|
-
class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144
|
|
51540
|
-
|
|
51541
|
-
constructor( vertices, indices, radius, detail ) {
|
|
51542
|
-
|
|
51543
|
-
console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' );
|
|
51544
|
-
super( vertices, indices, radius, detail );
|
|
51545
|
-
|
|
51546
|
-
}
|
|
51547
|
-
|
|
51548
|
-
}
|
|
51549
|
-
|
|
51550
|
-
class RingBufferGeometry extends RingGeometry { // @deprecated, r144
|
|
51551
|
-
|
|
51552
|
-
constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {
|
|
51553
|
-
|
|
51554
|
-
console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' );
|
|
51555
|
-
super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength );
|
|
51556
|
-
|
|
51557
|
-
}
|
|
51558
|
-
|
|
51559
|
-
}
|
|
51560
|
-
|
|
51561
|
-
class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144
|
|
51562
|
-
|
|
51563
|
-
constructor( shapes, curveSegments ) {
|
|
51564
|
-
|
|
51565
|
-
console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' );
|
|
51566
|
-
super( shapes, curveSegments );
|
|
51567
|
-
|
|
51568
|
-
}
|
|
51569
|
-
|
|
51570
|
-
}
|
|
51571
|
-
|
|
51572
|
-
class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144
|
|
51573
|
-
|
|
51574
|
-
constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {
|
|
51575
|
-
|
|
51576
|
-
console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' );
|
|
51577
|
-
super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
|
|
51578
|
-
|
|
51579
|
-
}
|
|
51580
|
-
|
|
51581
|
-
}
|
|
51582
|
-
|
|
51583
|
-
class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144
|
|
51584
|
-
|
|
51585
|
-
constructor( radius, detail ) {
|
|
51586
|
-
|
|
51587
|
-
console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' );
|
|
51588
|
-
super( radius, detail );
|
|
51589
|
-
|
|
51590
|
-
}
|
|
51591
|
-
|
|
51592
|
-
}
|
|
51593
|
-
|
|
51594
|
-
class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144
|
|
51595
|
-
|
|
51596
|
-
constructor( radius, tube, radialSegments, tubularSegments, arc ) {
|
|
51597
|
-
|
|
51598
|
-
console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' );
|
|
51599
|
-
super( radius, tube, radialSegments, tubularSegments, arc );
|
|
51600
|
-
|
|
51601
|
-
}
|
|
51602
|
-
|
|
51603
|
-
}
|
|
51604
|
-
|
|
51605
|
-
class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144
|
|
51606
|
-
|
|
51607
|
-
constructor( radius, tube, tubularSegments, radialSegments, p, q ) {
|
|
51608
|
-
|
|
51609
|
-
console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' );
|
|
51610
|
-
super( radius, tube, tubularSegments, radialSegments, p, q );
|
|
51611
|
-
|
|
51612
|
-
}
|
|
51613
|
-
|
|
51614
|
-
}
|
|
51615
|
-
|
|
51616
|
-
class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144
|
|
51617
|
-
|
|
51618
|
-
constructor( path, tubularSegments, radius, radialSegments, closed ) {
|
|
51619
|
-
|
|
51620
|
-
console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' );
|
|
51621
|
-
super( path, tubularSegments, radius, radialSegments, closed );
|
|
51622
|
-
|
|
51623
|
-
}
|
|
51624
|
-
|
|
51625
|
-
}
|
|
51626
|
-
|
|
51627
51857
|
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
51628
51858
|
|
|
51629
51859
|
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
@@ -51652,6 +51882,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51652
51882
|
exports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;
|
|
51653
51883
|
exports.AdditiveBlending = AdditiveBlending;
|
|
51654
51884
|
exports.AlphaFormat = AlphaFormat;
|
|
51885
|
+
exports.AlwaysCompare = AlwaysCompare;
|
|
51655
51886
|
exports.AlwaysDepth = AlwaysDepth;
|
|
51656
51887
|
exports.AlwaysStencilFunc = AlwaysStencilFunc;
|
|
51657
51888
|
exports.AmbientLight = AmbientLight;
|
|
@@ -51679,7 +51910,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51679
51910
|
exports.Box2 = Box2;
|
|
51680
51911
|
exports.Box3 = Box3;
|
|
51681
51912
|
exports.Box3Helper = Box3Helper;
|
|
51682
|
-
exports.BoxBufferGeometry = BoxBufferGeometry;
|
|
51683
51913
|
exports.BoxGeometry = BoxGeometry;
|
|
51684
51914
|
exports.BoxHelper = BoxHelper;
|
|
51685
51915
|
exports.BufferAttribute = BufferAttribute;
|
|
@@ -51690,11 +51920,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51690
51920
|
exports.Camera = Camera;
|
|
51691
51921
|
exports.CameraHelper = CameraHelper;
|
|
51692
51922
|
exports.CanvasTexture = CanvasTexture;
|
|
51693
|
-
exports.CapsuleBufferGeometry = CapsuleBufferGeometry;
|
|
51694
51923
|
exports.CapsuleGeometry = CapsuleGeometry;
|
|
51695
51924
|
exports.CatmullRomCurve3 = CatmullRomCurve3;
|
|
51696
51925
|
exports.CineonToneMapping = CineonToneMapping;
|
|
51697
|
-
exports.CircleBufferGeometry = CircleBufferGeometry;
|
|
51698
51926
|
exports.CircleGeometry = CircleGeometry;
|
|
51699
51927
|
exports.ClampToEdgeWrapping = ClampToEdgeWrapping;
|
|
51700
51928
|
exports.Clock = Clock;
|
|
@@ -51704,7 +51932,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51704
51932
|
exports.CompressedArrayTexture = CompressedArrayTexture;
|
|
51705
51933
|
exports.CompressedTexture = CompressedTexture;
|
|
51706
51934
|
exports.CompressedTextureLoader = CompressedTextureLoader;
|
|
51707
|
-
exports.ConeBufferGeometry = ConeBufferGeometry;
|
|
51708
51935
|
exports.ConeGeometry = ConeGeometry;
|
|
51709
51936
|
exports.CubeCamera = CubeCamera;
|
|
51710
51937
|
exports.CubeReflectionMapping = CubeReflectionMapping;
|
|
@@ -51723,7 +51950,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51723
51950
|
exports.CurvePath = CurvePath;
|
|
51724
51951
|
exports.CustomBlending = CustomBlending;
|
|
51725
51952
|
exports.CustomToneMapping = CustomToneMapping;
|
|
51726
|
-
exports.CylinderBufferGeometry = CylinderBufferGeometry;
|
|
51727
51953
|
exports.CylinderGeometry = CylinderGeometry;
|
|
51728
51954
|
exports.Cylindrical = Cylindrical;
|
|
51729
51955
|
exports.Data3DTexture = Data3DTexture;
|
|
@@ -51741,7 +51967,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51741
51967
|
exports.DirectionalLightHelper = DirectionalLightHelper;
|
|
51742
51968
|
exports.DiscreteInterpolant = DiscreteInterpolant;
|
|
51743
51969
|
exports.DisplayP3ColorSpace = DisplayP3ColorSpace;
|
|
51744
|
-
exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry;
|
|
51745
51970
|
exports.DodecahedronGeometry = DodecahedronGeometry;
|
|
51746
51971
|
exports.DoubleSide = DoubleSide;
|
|
51747
51972
|
exports.DstAlphaFactor = DstAlphaFactor;
|
|
@@ -51751,13 +51976,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51751
51976
|
exports.DynamicReadUsage = DynamicReadUsage;
|
|
51752
51977
|
exports.EdgesGeometry = EdgesGeometry;
|
|
51753
51978
|
exports.EllipseCurve = EllipseCurve;
|
|
51979
|
+
exports.EqualCompare = EqualCompare;
|
|
51754
51980
|
exports.EqualDepth = EqualDepth;
|
|
51755
51981
|
exports.EqualStencilFunc = EqualStencilFunc;
|
|
51756
51982
|
exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;
|
|
51757
51983
|
exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;
|
|
51758
51984
|
exports.Euler = Euler;
|
|
51759
51985
|
exports.EventDispatcher = EventDispatcher;
|
|
51760
|
-
exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry;
|
|
51761
51986
|
exports.ExtrudeGeometry = ExtrudeGeometry;
|
|
51762
51987
|
exports.FileLoader = FileLoader;
|
|
51763
51988
|
exports.Float16BufferAttribute = Float16BufferAttribute;
|
|
@@ -51772,7 +51997,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51772
51997
|
exports.GLBufferAttribute = GLBufferAttribute;
|
|
51773
51998
|
exports.GLSL1 = GLSL1;
|
|
51774
51999
|
exports.GLSL3 = GLSL3;
|
|
52000
|
+
exports.GreaterCompare = GreaterCompare;
|
|
51775
52001
|
exports.GreaterDepth = GreaterDepth;
|
|
52002
|
+
exports.GreaterEqualCompare = GreaterEqualCompare;
|
|
51776
52003
|
exports.GreaterEqualDepth = GreaterEqualDepth;
|
|
51777
52004
|
exports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;
|
|
51778
52005
|
exports.GreaterStencilFunc = GreaterStencilFunc;
|
|
@@ -51782,7 +52009,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51782
52009
|
exports.HemisphereLight = HemisphereLight;
|
|
51783
52010
|
exports.HemisphereLightHelper = HemisphereLightHelper;
|
|
51784
52011
|
exports.HemisphereLightProbe = HemisphereLightProbe;
|
|
51785
|
-
exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry;
|
|
51786
52012
|
exports.IcosahedronGeometry = IcosahedronGeometry;
|
|
51787
52013
|
exports.ImageBitmapLoader = ImageBitmapLoader;
|
|
51788
52014
|
exports.ImageLoader = ImageLoader;
|
|
@@ -51807,10 +52033,11 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51807
52033
|
exports.KeepStencilOp = KeepStencilOp;
|
|
51808
52034
|
exports.KeyframeTrack = KeyframeTrack;
|
|
51809
52035
|
exports.LOD = LOD;
|
|
51810
|
-
exports.LatheBufferGeometry = LatheBufferGeometry;
|
|
51811
52036
|
exports.LatheGeometry = LatheGeometry;
|
|
51812
52037
|
exports.Layers = Layers;
|
|
52038
|
+
exports.LessCompare = LessCompare;
|
|
51813
52039
|
exports.LessDepth = LessDepth;
|
|
52040
|
+
exports.LessEqualCompare = LessEqualCompare;
|
|
51814
52041
|
exports.LessEqualDepth = LessEqualDepth;
|
|
51815
52042
|
exports.LessEqualStencilFunc = LessEqualStencilFunc;
|
|
51816
52043
|
exports.LessStencilFunc = LessStencilFunc;
|
|
@@ -51869,6 +52096,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51869
52096
|
exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;
|
|
51870
52097
|
exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;
|
|
51871
52098
|
exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
|
|
52099
|
+
exports.NeverCompare = NeverCompare;
|
|
51872
52100
|
exports.NeverDepth = NeverDepth;
|
|
51873
52101
|
exports.NeverStencilFunc = NeverStencilFunc;
|
|
51874
52102
|
exports.NoBlending = NoBlending;
|
|
@@ -51876,13 +52104,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51876
52104
|
exports.NoToneMapping = NoToneMapping;
|
|
51877
52105
|
exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
|
|
51878
52106
|
exports.NormalBlending = NormalBlending;
|
|
52107
|
+
exports.NotEqualCompare = NotEqualCompare;
|
|
51879
52108
|
exports.NotEqualDepth = NotEqualDepth;
|
|
51880
52109
|
exports.NotEqualStencilFunc = NotEqualStencilFunc;
|
|
51881
52110
|
exports.NumberKeyframeTrack = NumberKeyframeTrack;
|
|
51882
52111
|
exports.Object3D = Object3D;
|
|
51883
52112
|
exports.ObjectLoader = ObjectLoader;
|
|
51884
52113
|
exports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;
|
|
51885
|
-
exports.OctahedronBufferGeometry = OctahedronBufferGeometry;
|
|
51886
52114
|
exports.OctahedronGeometry = OctahedronGeometry;
|
|
51887
52115
|
exports.OneFactor = OneFactor;
|
|
51888
52116
|
exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;
|
|
@@ -51896,7 +52124,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51896
52124
|
exports.Path = Path;
|
|
51897
52125
|
exports.PerspectiveCamera = PerspectiveCamera;
|
|
51898
52126
|
exports.Plane = Plane;
|
|
51899
|
-
exports.PlaneBufferGeometry = PlaneBufferGeometry;
|
|
51900
52127
|
exports.PlaneGeometry = PlaneGeometry;
|
|
51901
52128
|
exports.PlaneHelper = PlaneHelper;
|
|
51902
52129
|
exports.PointLight = PointLight;
|
|
@@ -51904,7 +52131,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51904
52131
|
exports.Points = Points;
|
|
51905
52132
|
exports.PointsMaterial = PointsMaterial;
|
|
51906
52133
|
exports.PolarGridHelper = PolarGridHelper;
|
|
51907
|
-
exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry;
|
|
51908
52134
|
exports.PolyhedronGeometry = PolyhedronGeometry;
|
|
51909
52135
|
exports.PositionalAudio = PositionalAudio;
|
|
51910
52136
|
exports.PropertyBinding = PropertyBinding;
|
|
@@ -51958,7 +52184,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51958
52184
|
exports.RepeatWrapping = RepeatWrapping;
|
|
51959
52185
|
exports.ReplaceStencilOp = ReplaceStencilOp;
|
|
51960
52186
|
exports.ReverseSubtractEquation = ReverseSubtractEquation;
|
|
51961
|
-
exports.RingBufferGeometry = RingBufferGeometry;
|
|
51962
52187
|
exports.RingGeometry = RingGeometry;
|
|
51963
52188
|
exports.SIGNED_RED_GREEN_RGTC2_Format = SIGNED_RED_GREEN_RGTC2_Format;
|
|
51964
52189
|
exports.SIGNED_RED_RGTC1_Format = SIGNED_RED_RGTC1_Format;
|
|
@@ -51969,7 +52194,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51969
52194
|
exports.ShaderMaterial = ShaderMaterial;
|
|
51970
52195
|
exports.ShadowMaterial = ShadowMaterial;
|
|
51971
52196
|
exports.Shape = Shape;
|
|
51972
|
-
exports.ShapeBufferGeometry = ShapeBufferGeometry;
|
|
51973
52197
|
exports.ShapeGeometry = ShapeGeometry;
|
|
51974
52198
|
exports.ShapePath = ShapePath;
|
|
51975
52199
|
exports.ShapeUtils = ShapeUtils;
|
|
@@ -51979,7 +52203,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
51979
52203
|
exports.SkinnedMesh = SkinnedMesh;
|
|
51980
52204
|
exports.Source = Source;
|
|
51981
52205
|
exports.Sphere = Sphere;
|
|
51982
|
-
exports.SphereBufferGeometry = SphereBufferGeometry;
|
|
51983
52206
|
exports.SphereGeometry = SphereGeometry;
|
|
51984
52207
|
exports.Spherical = Spherical;
|
|
51985
52208
|
exports.SphericalHarmonics3 = SphericalHarmonics3;
|
|
@@ -52003,19 +52226,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
52003
52226
|
exports.SubtractiveBlending = SubtractiveBlending;
|
|
52004
52227
|
exports.TOUCH = TOUCH;
|
|
52005
52228
|
exports.TangentSpaceNormalMap = TangentSpaceNormalMap;
|
|
52006
|
-
exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry;
|
|
52007
52229
|
exports.TetrahedronGeometry = TetrahedronGeometry;
|
|
52008
52230
|
exports.Texture = Texture;
|
|
52009
52231
|
exports.TextureLoader = TextureLoader;
|
|
52010
|
-
exports.TorusBufferGeometry = TorusBufferGeometry;
|
|
52011
52232
|
exports.TorusGeometry = TorusGeometry;
|
|
52012
|
-
exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry;
|
|
52013
52233
|
exports.TorusKnotGeometry = TorusKnotGeometry;
|
|
52014
52234
|
exports.Triangle = Triangle;
|
|
52015
52235
|
exports.TriangleFanDrawMode = TriangleFanDrawMode;
|
|
52016
52236
|
exports.TriangleStripDrawMode = TriangleStripDrawMode;
|
|
52017
52237
|
exports.TrianglesDrawMode = TrianglesDrawMode;
|
|
52018
|
-
exports.TubeBufferGeometry = TubeBufferGeometry;
|
|
52019
52238
|
exports.TubeGeometry = TubeGeometry;
|
|
52020
52239
|
exports.TwoPassDoubleSide = TwoPassDoubleSide;
|
|
52021
52240
|
exports.UVMapping = UVMapping;
|
|
@@ -52042,11 +52261,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
52042
52261
|
exports.WebGL1Renderer = WebGL1Renderer;
|
|
52043
52262
|
exports.WebGL3DRenderTarget = WebGL3DRenderTarget;
|
|
52044
52263
|
exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget;
|
|
52264
|
+
exports.WebGLCoordinateSystem = WebGLCoordinateSystem;
|
|
52045
52265
|
exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
|
|
52046
52266
|
exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
|
|
52047
52267
|
exports.WebGLRenderTarget = WebGLRenderTarget;
|
|
52048
52268
|
exports.WebGLRenderer = WebGLRenderer;
|
|
52049
52269
|
exports.WebGLUtils = WebGLUtils;
|
|
52270
|
+
exports.WebGPUCoordinateSystem = WebGPUCoordinateSystem;
|
|
52050
52271
|
exports.WireframeGeometry = WireframeGeometry;
|
|
52051
52272
|
exports.WrapAroundEnding = WrapAroundEnding;
|
|
52052
52273
|
exports.ZeroCurvatureEnding = ZeroCurvatureEnding;
|