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.module.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2010-2023 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
const REVISION = '
|
|
6
|
+
const REVISION = '154';
|
|
7
7
|
|
|
8
8
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
9
9
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -178,6 +178,15 @@ const NotEqualStencilFunc = 517;
|
|
|
178
178
|
const GreaterEqualStencilFunc = 518;
|
|
179
179
|
const AlwaysStencilFunc = 519;
|
|
180
180
|
|
|
181
|
+
const NeverCompare = 512;
|
|
182
|
+
const LessCompare = 513;
|
|
183
|
+
const EqualCompare = 514;
|
|
184
|
+
const LessEqualCompare = 515;
|
|
185
|
+
const GreaterCompare = 516;
|
|
186
|
+
const NotEqualCompare = 517;
|
|
187
|
+
const GreaterEqualCompare = 518;
|
|
188
|
+
const AlwaysCompare = 519;
|
|
189
|
+
|
|
181
190
|
const StaticDrawUsage = 35044;
|
|
182
191
|
const DynamicDrawUsage = 35048;
|
|
183
192
|
const StreamDrawUsage = 35040;
|
|
@@ -193,6 +202,9 @@ const GLSL3 = '300 es';
|
|
|
193
202
|
|
|
194
203
|
const _SRGBAFormat = 1035; // fallback for WebGL 1
|
|
195
204
|
|
|
205
|
+
const WebGLCoordinateSystem = 2000;
|
|
206
|
+
const WebGPUCoordinateSystem = 2001;
|
|
207
|
+
|
|
196
208
|
/**
|
|
197
209
|
* https://github.com/mrdoob/eventdispatcher.js/
|
|
198
210
|
*/
|
|
@@ -515,6 +527,10 @@ function denormalize( value, array ) {
|
|
|
515
527
|
|
|
516
528
|
return value;
|
|
517
529
|
|
|
530
|
+
case Uint32Array:
|
|
531
|
+
|
|
532
|
+
return value / 4294967295.0;
|
|
533
|
+
|
|
518
534
|
case Uint16Array:
|
|
519
535
|
|
|
520
536
|
return value / 65535.0;
|
|
@@ -523,6 +539,10 @@ function denormalize( value, array ) {
|
|
|
523
539
|
|
|
524
540
|
return value / 255.0;
|
|
525
541
|
|
|
542
|
+
case Int32Array:
|
|
543
|
+
|
|
544
|
+
return Math.max( value / 2147483647.0, - 1.0 );
|
|
545
|
+
|
|
526
546
|
case Int16Array:
|
|
527
547
|
|
|
528
548
|
return Math.max( value / 32767.0, - 1.0 );
|
|
@@ -547,6 +567,10 @@ function normalize( value, array ) {
|
|
|
547
567
|
|
|
548
568
|
return value;
|
|
549
569
|
|
|
570
|
+
case Uint32Array:
|
|
571
|
+
|
|
572
|
+
return Math.round( value * 4294967295.0 );
|
|
573
|
+
|
|
550
574
|
case Uint16Array:
|
|
551
575
|
|
|
552
576
|
return Math.round( value * 65535.0 );
|
|
@@ -555,6 +579,10 @@ function normalize( value, array ) {
|
|
|
555
579
|
|
|
556
580
|
return Math.round( value * 255.0 );
|
|
557
581
|
|
|
582
|
+
case Int32Array:
|
|
583
|
+
|
|
584
|
+
return Math.round( value * 2147483647.0 );
|
|
585
|
+
|
|
558
586
|
case Int16Array:
|
|
559
587
|
|
|
560
588
|
return Math.round( value * 32767.0 );
|
|
@@ -1077,7 +1105,7 @@ class Vector2 {
|
|
|
1077
1105
|
|
|
1078
1106
|
class Matrix3 {
|
|
1079
1107
|
|
|
1080
|
-
constructor() {
|
|
1108
|
+
constructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
|
|
1081
1109
|
|
|
1082
1110
|
Matrix3.prototype.isMatrix3 = true;
|
|
1083
1111
|
|
|
@@ -1089,6 +1117,12 @@ class Matrix3 {
|
|
|
1089
1117
|
|
|
1090
1118
|
];
|
|
1091
1119
|
|
|
1120
|
+
if ( n11 !== undefined ) {
|
|
1121
|
+
|
|
1122
|
+
this.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );
|
|
1123
|
+
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1092
1126
|
}
|
|
1093
1127
|
|
|
1094
1128
|
set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
|
|
@@ -1338,13 +1372,27 @@ class Matrix3 {
|
|
|
1338
1372
|
|
|
1339
1373
|
makeTranslation( x, y ) {
|
|
1340
1374
|
|
|
1341
|
-
|
|
1375
|
+
if ( x.isVector2 ) {
|
|
1342
1376
|
|
|
1343
|
-
|
|
1344
|
-
0, 1, y,
|
|
1345
|
-
0, 0, 1
|
|
1377
|
+
this.set(
|
|
1346
1378
|
|
|
1347
|
-
|
|
1379
|
+
1, 0, x.x,
|
|
1380
|
+
0, 1, x.y,
|
|
1381
|
+
0, 0, 1
|
|
1382
|
+
|
|
1383
|
+
);
|
|
1384
|
+
|
|
1385
|
+
} else {
|
|
1386
|
+
|
|
1387
|
+
this.set(
|
|
1388
|
+
|
|
1389
|
+
1, 0, x,
|
|
1390
|
+
0, 1, y,
|
|
1391
|
+
0, 0, 1
|
|
1392
|
+
|
|
1393
|
+
);
|
|
1394
|
+
|
|
1395
|
+
}
|
|
1348
1396
|
|
|
1349
1397
|
return this;
|
|
1350
1398
|
|
|
@@ -1748,12 +1796,16 @@ class ImageUtils {
|
|
|
1748
1796
|
|
|
1749
1797
|
}
|
|
1750
1798
|
|
|
1799
|
+
let sourceId = 0;
|
|
1800
|
+
|
|
1751
1801
|
class Source {
|
|
1752
1802
|
|
|
1753
1803
|
constructor( data = null ) {
|
|
1754
1804
|
|
|
1755
1805
|
this.isSource = true;
|
|
1756
1806
|
|
|
1807
|
+
Object.defineProperty( this, 'id', { value: sourceId ++ } );
|
|
1808
|
+
|
|
1757
1809
|
this.uuid = generateUUID();
|
|
1758
1810
|
|
|
1759
1811
|
this.data = data;
|
|
@@ -2017,7 +2069,7 @@ class Texture extends EventDispatcher {
|
|
|
2017
2069
|
const output = {
|
|
2018
2070
|
|
|
2019
2071
|
metadata: {
|
|
2020
|
-
version: 4.
|
|
2072
|
+
version: 4.6,
|
|
2021
2073
|
type: 'Texture',
|
|
2022
2074
|
generator: 'Texture.toJSON'
|
|
2023
2075
|
},
|
|
@@ -5758,7 +5810,7 @@ class Ray {
|
|
|
5758
5810
|
|
|
5759
5811
|
class Matrix4 {
|
|
5760
5812
|
|
|
5761
|
-
constructor() {
|
|
5813
|
+
constructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
|
|
5762
5814
|
|
|
5763
5815
|
Matrix4.prototype.isMatrix4 = true;
|
|
5764
5816
|
|
|
@@ -5771,6 +5823,12 @@ class Matrix4 {
|
|
|
5771
5823
|
|
|
5772
5824
|
];
|
|
5773
5825
|
|
|
5826
|
+
if ( n11 !== undefined ) {
|
|
5827
|
+
|
|
5828
|
+
this.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );
|
|
5829
|
+
|
|
5830
|
+
}
|
|
5831
|
+
|
|
5774
5832
|
}
|
|
5775
5833
|
|
|
5776
5834
|
set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
|
|
@@ -6310,14 +6368,29 @@ class Matrix4 {
|
|
|
6310
6368
|
|
|
6311
6369
|
makeTranslation( x, y, z ) {
|
|
6312
6370
|
|
|
6313
|
-
|
|
6371
|
+
if ( x.isVector3 ) {
|
|
6314
6372
|
|
|
6315
|
-
|
|
6316
|
-
0, 1, 0, y,
|
|
6317
|
-
0, 0, 1, z,
|
|
6318
|
-
0, 0, 0, 1
|
|
6373
|
+
this.set(
|
|
6319
6374
|
|
|
6320
|
-
|
|
6375
|
+
1, 0, 0, x.x,
|
|
6376
|
+
0, 1, 0, x.y,
|
|
6377
|
+
0, 0, 1, x.z,
|
|
6378
|
+
0, 0, 0, 1
|
|
6379
|
+
|
|
6380
|
+
);
|
|
6381
|
+
|
|
6382
|
+
} else {
|
|
6383
|
+
|
|
6384
|
+
this.set(
|
|
6385
|
+
|
|
6386
|
+
1, 0, 0, x,
|
|
6387
|
+
0, 1, 0, y,
|
|
6388
|
+
0, 0, 1, z,
|
|
6389
|
+
0, 0, 0, 1
|
|
6390
|
+
|
|
6391
|
+
);
|
|
6392
|
+
|
|
6393
|
+
}
|
|
6321
6394
|
|
|
6322
6395
|
return this;
|
|
6323
6396
|
|
|
@@ -6508,7 +6581,7 @@ class Matrix4 {
|
|
|
6508
6581
|
|
|
6509
6582
|
}
|
|
6510
6583
|
|
|
6511
|
-
makePerspective( left, right, top, bottom, near, far ) {
|
|
6584
|
+
makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
6512
6585
|
|
|
6513
6586
|
const te = this.elements;
|
|
6514
6587
|
const x = 2 * near / ( right - left );
|
|
@@ -6516,19 +6589,35 @@ class Matrix4 {
|
|
|
6516
6589
|
|
|
6517
6590
|
const a = ( right + left ) / ( right - left );
|
|
6518
6591
|
const b = ( top + bottom ) / ( top - bottom );
|
|
6519
|
-
const c = - ( far + near ) / ( far - near );
|
|
6520
|
-
const d = - 2 * far * near / ( far - near );
|
|
6521
6592
|
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6593
|
+
let c, d;
|
|
6594
|
+
|
|
6595
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
6596
|
+
|
|
6597
|
+
c = - ( far + near ) / ( far - near );
|
|
6598
|
+
d = ( - 2 * far * near ) / ( far - near );
|
|
6599
|
+
|
|
6600
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
6601
|
+
|
|
6602
|
+
c = - far / ( far - near );
|
|
6603
|
+
d = ( - far * near ) / ( far - near );
|
|
6604
|
+
|
|
6605
|
+
} else {
|
|
6606
|
+
|
|
6607
|
+
throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
|
|
6608
|
+
|
|
6609
|
+
}
|
|
6610
|
+
|
|
6611
|
+
te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0;
|
|
6612
|
+
te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0;
|
|
6613
|
+
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
|
|
6525
6614
|
te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0;
|
|
6526
6615
|
|
|
6527
6616
|
return this;
|
|
6528
6617
|
|
|
6529
6618
|
}
|
|
6530
6619
|
|
|
6531
|
-
makeOrthographic( left, right, top, bottom, near, far ) {
|
|
6620
|
+
makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
6532
6621
|
|
|
6533
6622
|
const te = this.elements;
|
|
6534
6623
|
const w = 1.0 / ( right - left );
|
|
@@ -6537,12 +6626,29 @@ class Matrix4 {
|
|
|
6537
6626
|
|
|
6538
6627
|
const x = ( right + left ) * w;
|
|
6539
6628
|
const y = ( top + bottom ) * h;
|
|
6540
|
-
const z = ( far + near ) * p;
|
|
6541
6629
|
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6630
|
+
let z, zInv;
|
|
6631
|
+
|
|
6632
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
6633
|
+
|
|
6634
|
+
z = ( far + near ) * p;
|
|
6635
|
+
zInv = - 2 * p;
|
|
6636
|
+
|
|
6637
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
6638
|
+
|
|
6639
|
+
z = near * p;
|
|
6640
|
+
zInv = - 1 * p;
|
|
6641
|
+
|
|
6642
|
+
} else {
|
|
6643
|
+
|
|
6644
|
+
throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
|
|
6645
|
+
|
|
6646
|
+
}
|
|
6647
|
+
|
|
6648
|
+
te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
|
|
6649
|
+
te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
|
|
6650
|
+
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z;
|
|
6651
|
+
te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
|
|
6546
6652
|
|
|
6547
6653
|
return this;
|
|
6548
6654
|
|
|
@@ -7667,7 +7773,7 @@ class Object3D extends EventDispatcher {
|
|
|
7667
7773
|
};
|
|
7668
7774
|
|
|
7669
7775
|
output.metadata = {
|
|
7670
|
-
version: 4.
|
|
7776
|
+
version: 4.6,
|
|
7671
7777
|
type: 'Object',
|
|
7672
7778
|
generator: 'Object3D.toJSON'
|
|
7673
7779
|
};
|
|
@@ -8293,6 +8399,7 @@ class Material extends EventDispatcher {
|
|
|
8293
8399
|
|
|
8294
8400
|
this.opacity = 1;
|
|
8295
8401
|
this.transparent = false;
|
|
8402
|
+
this.alphaHash = false;
|
|
8296
8403
|
|
|
8297
8404
|
this.blendSrc = SrcAlphaFactor;
|
|
8298
8405
|
this.blendDst = OneMinusSrcAlphaFactor;
|
|
@@ -8433,7 +8540,7 @@ class Material extends EventDispatcher {
|
|
|
8433
8540
|
|
|
8434
8541
|
const data = {
|
|
8435
8542
|
metadata: {
|
|
8436
|
-
version: 4.
|
|
8543
|
+
version: 4.6,
|
|
8437
8544
|
type: 'Material',
|
|
8438
8545
|
generator: 'Material.toJSON'
|
|
8439
8546
|
}
|
|
@@ -8498,6 +8605,15 @@ class Material extends EventDispatcher {
|
|
|
8498
8605
|
|
|
8499
8606
|
}
|
|
8500
8607
|
|
|
8608
|
+
if ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;
|
|
8609
|
+
if ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;
|
|
8610
|
+
|
|
8611
|
+
if ( this.anisotropyMap && this.anisotropyMap.isTexture ) {
|
|
8612
|
+
|
|
8613
|
+
data.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;
|
|
8614
|
+
|
|
8615
|
+
}
|
|
8616
|
+
|
|
8501
8617
|
if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
|
|
8502
8618
|
if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
|
|
8503
8619
|
if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
|
|
@@ -8612,6 +8728,7 @@ class Material extends EventDispatcher {
|
|
|
8612
8728
|
if ( this.dithering === true ) data.dithering = true;
|
|
8613
8729
|
|
|
8614
8730
|
if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
|
|
8731
|
+
if ( this.alphaHash === true ) data.alphaHash = this.alphaHash;
|
|
8615
8732
|
if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;
|
|
8616
8733
|
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
|
|
8617
8734
|
if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass;
|
|
@@ -8733,6 +8850,7 @@ class Material extends EventDispatcher {
|
|
|
8733
8850
|
this.dithering = source.dithering;
|
|
8734
8851
|
|
|
8735
8852
|
this.alphaTest = source.alphaTest;
|
|
8853
|
+
this.alphaHash = source.alphaHash;
|
|
8736
8854
|
this.alphaToCoverage = source.alphaToCoverage;
|
|
8737
8855
|
this.premultipliedAlpha = source.premultipliedAlpha;
|
|
8738
8856
|
this.forceSinglePass = source.forceSinglePass;
|
|
@@ -8810,30 +8928,35 @@ class Color {
|
|
|
8810
8928
|
this.g = 1;
|
|
8811
8929
|
this.b = 1;
|
|
8812
8930
|
|
|
8931
|
+
return this.set( r, g, b );
|
|
8932
|
+
|
|
8933
|
+
}
|
|
8934
|
+
|
|
8935
|
+
set( r, g, b ) {
|
|
8936
|
+
|
|
8813
8937
|
if ( g === undefined && b === undefined ) {
|
|
8814
8938
|
|
|
8815
8939
|
// r is THREE.Color, hex or string
|
|
8816
|
-
return this.set( r );
|
|
8817
8940
|
|
|
8818
|
-
|
|
8941
|
+
const value = r;
|
|
8819
8942
|
|
|
8820
|
-
|
|
8943
|
+
if ( value && value.isColor ) {
|
|
8821
8944
|
|
|
8822
|
-
|
|
8945
|
+
this.copy( value );
|
|
8823
8946
|
|
|
8824
|
-
|
|
8947
|
+
} else if ( typeof value === 'number' ) {
|
|
8825
8948
|
|
|
8826
|
-
|
|
8949
|
+
this.setHex( value );
|
|
8827
8950
|
|
|
8828
|
-
|
|
8951
|
+
} else if ( typeof value === 'string' ) {
|
|
8829
8952
|
|
|
8830
|
-
|
|
8953
|
+
this.setStyle( value );
|
|
8831
8954
|
|
|
8832
|
-
|
|
8955
|
+
}
|
|
8833
8956
|
|
|
8834
|
-
} else
|
|
8957
|
+
} else {
|
|
8835
8958
|
|
|
8836
|
-
this.
|
|
8959
|
+
this.setRGB( r, g, b );
|
|
8837
8960
|
|
|
8838
8961
|
}
|
|
8839
8962
|
|
|
@@ -9647,6 +9770,7 @@ class BufferAttribute {
|
|
|
9647
9770
|
|
|
9648
9771
|
this.usage = StaticDrawUsage;
|
|
9649
9772
|
this.updateRange = { offset: 0, count: - 1 };
|
|
9773
|
+
this.gpuType = FloatType;
|
|
9650
9774
|
|
|
9651
9775
|
this.version = 0;
|
|
9652
9776
|
|
|
@@ -9677,6 +9801,7 @@ class BufferAttribute {
|
|
|
9677
9801
|
this.normalized = source.normalized;
|
|
9678
9802
|
|
|
9679
9803
|
this.usage = source.usage;
|
|
9804
|
+
this.gpuType = source.gpuType;
|
|
9680
9805
|
|
|
9681
9806
|
return this;
|
|
9682
9807
|
|
|
@@ -9963,30 +10088,6 @@ class BufferAttribute {
|
|
|
9963
10088
|
|
|
9964
10089
|
}
|
|
9965
10090
|
|
|
9966
|
-
copyColorsArray() { // @deprecated, r144
|
|
9967
|
-
|
|
9968
|
-
console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
|
|
9969
|
-
|
|
9970
|
-
}
|
|
9971
|
-
|
|
9972
|
-
copyVector2sArray() { // @deprecated, r144
|
|
9973
|
-
|
|
9974
|
-
console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
|
|
9975
|
-
|
|
9976
|
-
}
|
|
9977
|
-
|
|
9978
|
-
copyVector3sArray() { // @deprecated, r144
|
|
9979
|
-
|
|
9980
|
-
console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
|
|
9981
|
-
|
|
9982
|
-
}
|
|
9983
|
-
|
|
9984
|
-
copyVector4sArray() { // @deprecated, r144
|
|
9985
|
-
|
|
9986
|
-
console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
|
|
9987
|
-
|
|
9988
|
-
}
|
|
9989
|
-
|
|
9990
10091
|
}
|
|
9991
10092
|
|
|
9992
10093
|
//
|
|
@@ -10950,13 +11051,6 @@ class BufferGeometry extends EventDispatcher {
|
|
|
10950
11051
|
|
|
10951
11052
|
}
|
|
10952
11053
|
|
|
10953
|
-
merge() { // @deprecated, r144
|
|
10954
|
-
|
|
10955
|
-
console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' );
|
|
10956
|
-
return this;
|
|
10957
|
-
|
|
10958
|
-
}
|
|
10959
|
-
|
|
10960
11054
|
normalizeNormals() {
|
|
10961
11055
|
|
|
10962
11056
|
const normals = this.attributes.normal;
|
|
@@ -11079,7 +11173,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11079
11173
|
|
|
11080
11174
|
const data = {
|
|
11081
11175
|
metadata: {
|
|
11082
|
-
version: 4.
|
|
11176
|
+
version: 4.6,
|
|
11083
11177
|
type: 'BufferGeometry',
|
|
11084
11178
|
generator: 'BufferGeometry.toJSON'
|
|
11085
11179
|
}
|
|
@@ -11307,9 +11401,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
11307
11401
|
|
|
11308
11402
|
}
|
|
11309
11403
|
|
|
11310
|
-
const _inverseMatrix$
|
|
11311
|
-
const _ray$
|
|
11312
|
-
const _sphere$
|
|
11404
|
+
const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();
|
|
11405
|
+
const _ray$3 = /*@__PURE__*/ new Ray();
|
|
11406
|
+
const _sphere$5 = /*@__PURE__*/ new Sphere();
|
|
11313
11407
|
const _sphereHitAt = /*@__PURE__*/ new Vector3();
|
|
11314
11408
|
|
|
11315
11409
|
const _vA$1 = /*@__PURE__*/ new Vector3();
|
|
@@ -11453,41 +11547,45 @@ class Mesh extends Object3D {
|
|
|
11453
11547
|
|
|
11454
11548
|
if ( material === undefined ) return;
|
|
11455
11549
|
|
|
11456
|
-
//
|
|
11550
|
+
// test with bounding sphere in world space
|
|
11457
11551
|
|
|
11458
11552
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
11459
11553
|
|
|
11460
|
-
_sphere$
|
|
11461
|
-
_sphere$
|
|
11554
|
+
_sphere$5.copy( geometry.boundingSphere );
|
|
11555
|
+
_sphere$5.applyMatrix4( matrixWorld );
|
|
11556
|
+
|
|
11557
|
+
// check distance from ray origin to bounding sphere
|
|
11462
11558
|
|
|
11463
|
-
_ray$
|
|
11559
|
+
_ray$3.copy( raycaster.ray ).recast( raycaster.near );
|
|
11464
11560
|
|
|
11465
|
-
if ( _sphere$
|
|
11561
|
+
if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) {
|
|
11466
11562
|
|
|
11467
|
-
if ( _ray$
|
|
11563
|
+
if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
|
|
11468
11564
|
|
|
11469
|
-
if ( _ray$
|
|
11565
|
+
if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
|
|
11470
11566
|
|
|
11471
11567
|
}
|
|
11472
11568
|
|
|
11473
|
-
//
|
|
11569
|
+
// convert ray to local space of mesh
|
|
11474
11570
|
|
|
11475
|
-
_inverseMatrix$
|
|
11476
|
-
_ray$
|
|
11571
|
+
_inverseMatrix$3.copy( matrixWorld ).invert();
|
|
11572
|
+
_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );
|
|
11477
11573
|
|
|
11478
|
-
//
|
|
11574
|
+
// test with bounding box in local space
|
|
11479
11575
|
|
|
11480
11576
|
if ( geometry.boundingBox !== null ) {
|
|
11481
11577
|
|
|
11482
|
-
if ( _ray$
|
|
11578
|
+
if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;
|
|
11483
11579
|
|
|
11484
11580
|
}
|
|
11485
11581
|
|
|
11486
|
-
|
|
11582
|
+
// test for intersections with geometry
|
|
11583
|
+
|
|
11584
|
+
this._computeIntersections( raycaster, intersects, _ray$3 );
|
|
11487
11585
|
|
|
11488
11586
|
}
|
|
11489
11587
|
|
|
11490
|
-
_computeIntersections( raycaster, intersects ) {
|
|
11588
|
+
_computeIntersections( raycaster, intersects, rayLocalSpace ) {
|
|
11491
11589
|
|
|
11492
11590
|
let intersection;
|
|
11493
11591
|
|
|
@@ -11522,7 +11620,7 @@ class Mesh extends Object3D {
|
|
|
11522
11620
|
const b = index.getX( j + 1 );
|
|
11523
11621
|
const c = index.getX( j + 2 );
|
|
11524
11622
|
|
|
11525
|
-
intersection = checkGeometryIntersection( this, groupMaterial, raycaster,
|
|
11623
|
+
intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11526
11624
|
|
|
11527
11625
|
if ( intersection ) {
|
|
11528
11626
|
|
|
@@ -11547,7 +11645,7 @@ class Mesh extends Object3D {
|
|
|
11547
11645
|
const b = index.getX( i + 1 );
|
|
11548
11646
|
const c = index.getX( i + 2 );
|
|
11549
11647
|
|
|
11550
|
-
intersection = checkGeometryIntersection( this, material, raycaster,
|
|
11648
|
+
intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11551
11649
|
|
|
11552
11650
|
if ( intersection ) {
|
|
11553
11651
|
|
|
@@ -11580,7 +11678,7 @@ class Mesh extends Object3D {
|
|
|
11580
11678
|
const b = j + 1;
|
|
11581
11679
|
const c = j + 2;
|
|
11582
11680
|
|
|
11583
|
-
intersection = checkGeometryIntersection( this, groupMaterial, raycaster,
|
|
11681
|
+
intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11584
11682
|
|
|
11585
11683
|
if ( intersection ) {
|
|
11586
11684
|
|
|
@@ -11605,7 +11703,7 @@ class Mesh extends Object3D {
|
|
|
11605
11703
|
const b = i + 1;
|
|
11606
11704
|
const c = i + 2;
|
|
11607
11705
|
|
|
11608
|
-
intersection = checkGeometryIntersection( this, material, raycaster,
|
|
11706
|
+
intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
|
|
11609
11707
|
|
|
11610
11708
|
if ( intersection ) {
|
|
11611
11709
|
|
|
@@ -11682,7 +11780,7 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
|
|
|
11682
11780
|
_uvC$1.fromBufferAttribute( uv1, c );
|
|
11683
11781
|
|
|
11684
11782
|
intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
|
|
11685
|
-
intersection.uv2 = intersection.uv1; //
|
|
11783
|
+
intersection.uv2 = intersection.uv1; // @deprecated, r152
|
|
11686
11784
|
|
|
11687
11785
|
}
|
|
11688
11786
|
|
|
@@ -12195,6 +12293,8 @@ class Camera extends Object3D {
|
|
|
12195
12293
|
this.projectionMatrix = new Matrix4();
|
|
12196
12294
|
this.projectionMatrixInverse = new Matrix4();
|
|
12197
12295
|
|
|
12296
|
+
this.coordinateSystem = WebGLCoordinateSystem;
|
|
12297
|
+
|
|
12198
12298
|
}
|
|
12199
12299
|
|
|
12200
12300
|
copy( source, recursive ) {
|
|
@@ -12206,6 +12306,8 @@ class Camera extends Object3D {
|
|
|
12206
12306
|
this.projectionMatrix.copy( source.projectionMatrix );
|
|
12207
12307
|
this.projectionMatrixInverse.copy( source.projectionMatrixInverse );
|
|
12208
12308
|
|
|
12309
|
+
this.coordinateSystem = source.coordinateSystem;
|
|
12310
|
+
|
|
12209
12311
|
return this;
|
|
12210
12312
|
|
|
12211
12313
|
}
|
|
@@ -12443,7 +12545,7 @@ class PerspectiveCamera extends Camera {
|
|
|
12443
12545
|
const skew = this.filmOffset;
|
|
12444
12546
|
if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
|
|
12445
12547
|
|
|
12446
|
-
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
|
|
12548
|
+
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
|
|
12447
12549
|
|
|
12448
12550
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
12449
12551
|
|
|
@@ -12485,51 +12587,114 @@ class CubeCamera extends Object3D {
|
|
|
12485
12587
|
this.type = 'CubeCamera';
|
|
12486
12588
|
|
|
12487
12589
|
this.renderTarget = renderTarget;
|
|
12590
|
+
this.coordinateSystem = null;
|
|
12488
12591
|
|
|
12489
12592
|
const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
|
|
12490
12593
|
cameraPX.layers = this.layers;
|
|
12491
|
-
cameraPX.up.set( 0, 1, 0 );
|
|
12492
|
-
cameraPX.lookAt( 1, 0, 0 );
|
|
12493
12594
|
this.add( cameraPX );
|
|
12494
12595
|
|
|
12495
12596
|
const cameraNX = new PerspectiveCamera( fov, aspect, near, far );
|
|
12496
12597
|
cameraNX.layers = this.layers;
|
|
12497
|
-
cameraNX.up.set( 0, 1, 0 );
|
|
12498
|
-
cameraNX.lookAt( - 1, 0, 0 );
|
|
12499
12598
|
this.add( cameraNX );
|
|
12500
12599
|
|
|
12501
12600
|
const cameraPY = new PerspectiveCamera( fov, aspect, near, far );
|
|
12502
12601
|
cameraPY.layers = this.layers;
|
|
12503
|
-
cameraPY.up.set( 0, 0, - 1 );
|
|
12504
|
-
cameraPY.lookAt( 0, 1, 0 );
|
|
12505
12602
|
this.add( cameraPY );
|
|
12506
12603
|
|
|
12507
12604
|
const cameraNY = new PerspectiveCamera( fov, aspect, near, far );
|
|
12508
12605
|
cameraNY.layers = this.layers;
|
|
12509
|
-
cameraNY.up.set( 0, 0, 1 );
|
|
12510
|
-
cameraNY.lookAt( 0, - 1, 0 );
|
|
12511
12606
|
this.add( cameraNY );
|
|
12512
12607
|
|
|
12513
12608
|
const cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
|
|
12514
12609
|
cameraPZ.layers = this.layers;
|
|
12515
|
-
cameraPZ.up.set( 0, 1, 0 );
|
|
12516
|
-
cameraPZ.lookAt( 0, 0, 1 );
|
|
12517
12610
|
this.add( cameraPZ );
|
|
12518
12611
|
|
|
12519
12612
|
const cameraNZ = new PerspectiveCamera( fov, aspect, near, far );
|
|
12520
12613
|
cameraNZ.layers = this.layers;
|
|
12521
|
-
cameraNZ.up.set( 0, 1, 0 );
|
|
12522
|
-
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12523
12614
|
this.add( cameraNZ );
|
|
12524
12615
|
|
|
12525
12616
|
}
|
|
12526
12617
|
|
|
12618
|
+
updateCoordinateSystem() {
|
|
12619
|
+
|
|
12620
|
+
const coordinateSystem = this.coordinateSystem;
|
|
12621
|
+
|
|
12622
|
+
const cameras = this.children.concat();
|
|
12623
|
+
|
|
12624
|
+
const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;
|
|
12625
|
+
|
|
12626
|
+
for ( const camera of cameras ) this.remove( camera );
|
|
12627
|
+
|
|
12628
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
12629
|
+
|
|
12630
|
+
cameraPX.up.set( 0, 1, 0 );
|
|
12631
|
+
cameraPX.lookAt( 1, 0, 0 );
|
|
12632
|
+
|
|
12633
|
+
cameraNX.up.set( 0, 1, 0 );
|
|
12634
|
+
cameraNX.lookAt( - 1, 0, 0 );
|
|
12635
|
+
|
|
12636
|
+
cameraPY.up.set( 0, 0, - 1 );
|
|
12637
|
+
cameraPY.lookAt( 0, 1, 0 );
|
|
12638
|
+
|
|
12639
|
+
cameraNY.up.set( 0, 0, 1 );
|
|
12640
|
+
cameraNY.lookAt( 0, - 1, 0 );
|
|
12641
|
+
|
|
12642
|
+
cameraPZ.up.set( 0, 1, 0 );
|
|
12643
|
+
cameraPZ.lookAt( 0, 0, 1 );
|
|
12644
|
+
|
|
12645
|
+
cameraNZ.up.set( 0, 1, 0 );
|
|
12646
|
+
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12647
|
+
|
|
12648
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
12649
|
+
|
|
12650
|
+
cameraPX.up.set( 0, - 1, 0 );
|
|
12651
|
+
cameraPX.lookAt( - 1, 0, 0 );
|
|
12652
|
+
|
|
12653
|
+
cameraNX.up.set( 0, - 1, 0 );
|
|
12654
|
+
cameraNX.lookAt( 1, 0, 0 );
|
|
12655
|
+
|
|
12656
|
+
cameraPY.up.set( 0, 0, 1 );
|
|
12657
|
+
cameraPY.lookAt( 0, 1, 0 );
|
|
12658
|
+
|
|
12659
|
+
cameraNY.up.set( 0, 0, - 1 );
|
|
12660
|
+
cameraNY.lookAt( 0, - 1, 0 );
|
|
12661
|
+
|
|
12662
|
+
cameraPZ.up.set( 0, - 1, 0 );
|
|
12663
|
+
cameraPZ.lookAt( 0, 0, 1 );
|
|
12664
|
+
|
|
12665
|
+
cameraNZ.up.set( 0, - 1, 0 );
|
|
12666
|
+
cameraNZ.lookAt( 0, 0, - 1 );
|
|
12667
|
+
|
|
12668
|
+
} else {
|
|
12669
|
+
|
|
12670
|
+
throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );
|
|
12671
|
+
|
|
12672
|
+
}
|
|
12673
|
+
|
|
12674
|
+
for ( const camera of cameras ) {
|
|
12675
|
+
|
|
12676
|
+
this.add( camera );
|
|
12677
|
+
|
|
12678
|
+
camera.updateMatrixWorld();
|
|
12679
|
+
|
|
12680
|
+
}
|
|
12681
|
+
|
|
12682
|
+
}
|
|
12683
|
+
|
|
12527
12684
|
update( renderer, scene ) {
|
|
12528
12685
|
|
|
12529
12686
|
if ( this.parent === null ) this.updateMatrixWorld();
|
|
12530
12687
|
|
|
12531
12688
|
const renderTarget = this.renderTarget;
|
|
12532
12689
|
|
|
12690
|
+
if ( this.coordinateSystem !== renderer.coordinateSystem ) {
|
|
12691
|
+
|
|
12692
|
+
this.coordinateSystem = renderer.coordinateSystem;
|
|
12693
|
+
|
|
12694
|
+
this.updateCoordinateSystem();
|
|
12695
|
+
|
|
12696
|
+
}
|
|
12697
|
+
|
|
12533
12698
|
const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;
|
|
12534
12699
|
|
|
12535
12700
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
@@ -12949,7 +13114,7 @@ class Plane {
|
|
|
12949
13114
|
|
|
12950
13115
|
}
|
|
12951
13116
|
|
|
12952
|
-
const _sphere$
|
|
13117
|
+
const _sphere$4 = /*@__PURE__*/ new Sphere();
|
|
12953
13118
|
const _vector$6 = /*@__PURE__*/ new Vector3();
|
|
12954
13119
|
|
|
12955
13120
|
class Frustum {
|
|
@@ -12989,7 +13154,7 @@ class Frustum {
|
|
|
12989
13154
|
|
|
12990
13155
|
}
|
|
12991
13156
|
|
|
12992
|
-
setFromProjectionMatrix( m ) {
|
|
13157
|
+
setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {
|
|
12993
13158
|
|
|
12994
13159
|
const planes = this.planes;
|
|
12995
13160
|
const me = m.elements;
|
|
@@ -13003,7 +13168,20 @@ class Frustum {
|
|
|
13003
13168
|
planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();
|
|
13004
13169
|
planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();
|
|
13005
13170
|
planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();
|
|
13006
|
-
|
|
13171
|
+
|
|
13172
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
13173
|
+
|
|
13174
|
+
planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();
|
|
13175
|
+
|
|
13176
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
13177
|
+
|
|
13178
|
+
planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();
|
|
13179
|
+
|
|
13180
|
+
} else {
|
|
13181
|
+
|
|
13182
|
+
throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
|
|
13183
|
+
|
|
13184
|
+
}
|
|
13007
13185
|
|
|
13008
13186
|
return this;
|
|
13009
13187
|
|
|
@@ -13015,7 +13193,7 @@ class Frustum {
|
|
|
13015
13193
|
|
|
13016
13194
|
if ( object.boundingSphere === null ) object.computeBoundingSphere();
|
|
13017
13195
|
|
|
13018
|
-
_sphere$
|
|
13196
|
+
_sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
13019
13197
|
|
|
13020
13198
|
} else {
|
|
13021
13199
|
|
|
@@ -13023,21 +13201,21 @@ class Frustum {
|
|
|
13023
13201
|
|
|
13024
13202
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
13025
13203
|
|
|
13026
|
-
_sphere$
|
|
13204
|
+
_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
13027
13205
|
|
|
13028
13206
|
}
|
|
13029
13207
|
|
|
13030
|
-
return this.intersectsSphere( _sphere$
|
|
13208
|
+
return this.intersectsSphere( _sphere$4 );
|
|
13031
13209
|
|
|
13032
13210
|
}
|
|
13033
13211
|
|
|
13034
13212
|
intersectsSprite( sprite ) {
|
|
13035
13213
|
|
|
13036
|
-
_sphere$
|
|
13037
|
-
_sphere$
|
|
13038
|
-
_sphere$
|
|
13214
|
+
_sphere$4.center.set( 0, 0, 0 );
|
|
13215
|
+
_sphere$4.radius = 0.7071067811865476;
|
|
13216
|
+
_sphere$4.applyMatrix4( sprite.matrixWorld );
|
|
13039
13217
|
|
|
13040
|
-
return this.intersectsSphere( _sphere$
|
|
13218
|
+
return this.intersectsSphere( _sphere$4 );
|
|
13041
13219
|
|
|
13042
13220
|
}
|
|
13043
13221
|
|
|
@@ -13454,6 +13632,10 @@ class PlaneGeometry extends BufferGeometry {
|
|
|
13454
13632
|
|
|
13455
13633
|
}
|
|
13456
13634
|
|
|
13635
|
+
var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
|
|
13636
|
+
|
|
13637
|
+
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";
|
|
13638
|
+
|
|
13457
13639
|
var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";
|
|
13458
13640
|
|
|
13459
13641
|
var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";
|
|
@@ -13466,7 +13648,7 @@ var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D(
|
|
|
13466
13648
|
|
|
13467
13649
|
var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";
|
|
13468
13650
|
|
|
13469
|
-
var begin_vertex = "vec3 transformed = vec3( position )
|
|
13651
|
+
var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif";
|
|
13470
13652
|
|
|
13471
13653
|
var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
|
|
13472
13654
|
|
|
@@ -13492,7 +13674,7 @@ var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\
|
|
|
13492
13674
|
|
|
13493
13675
|
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";
|
|
13494
13676
|
|
|
13495
|
-
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";
|
|
13677
|
+
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";
|
|
13496
13678
|
|
|
13497
13679
|
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";
|
|
13498
13680
|
|
|
@@ -13506,9 +13688,9 @@ var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = textu
|
|
|
13506
13688
|
|
|
13507
13689
|
var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";
|
|
13508
13690
|
|
|
13509
|
-
var
|
|
13691
|
+
var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
|
|
13510
13692
|
|
|
13511
|
-
var
|
|
13693
|
+
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}";
|
|
13512
13694
|
|
|
13513
13695
|
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";
|
|
13514
13696
|
|
|
@@ -13540,7 +13722,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
|
|
|
13540
13722
|
|
|
13541
13723
|
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";
|
|
13542
13724
|
|
|
13543
|
-
var envmap_physical_pars_fragment = "#
|
|
13725
|
+
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";
|
|
13544
13726
|
|
|
13545
13727
|
var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
|
|
13546
13728
|
|
|
@@ -13550,13 +13732,13 @@ var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor
|
|
|
13550
13732
|
|
|
13551
13733
|
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";
|
|
13552
13734
|
|
|
13553
|
-
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";
|
|
13735
|
+
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";
|
|
13554
13736
|
|
|
13555
|
-
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}";
|
|
13737
|
+
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}";
|
|
13556
13738
|
|
|
13557
13739
|
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";
|
|
13558
13740
|
|
|
13559
|
-
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";
|
|
13741
|
+
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";
|
|
13560
13742
|
|
|
13561
13743
|
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";
|
|
13562
13744
|
|
|
@@ -13588,7 +13770,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTar
|
|
|
13588
13770
|
|
|
13589
13771
|
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";
|
|
13590
13772
|
|
|
13591
|
-
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#
|
|
13773
|
+
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;";
|
|
13592
13774
|
|
|
13593
13775
|
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";
|
|
13594
13776
|
|
|
@@ -13598,7 +13780,7 @@ var normal_pars_vertex = "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef
|
|
|
13598
13780
|
|
|
13599
13781
|
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";
|
|
13600
13782
|
|
|
13601
|
-
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";
|
|
13783
|
+
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";
|
|
13602
13784
|
|
|
13603
13785
|
var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";
|
|
13604
13786
|
|
|
@@ -13608,7 +13790,7 @@ var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clea
|
|
|
13608
13790
|
|
|
13609
13791
|
var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";
|
|
13610
13792
|
|
|
13611
|
-
var
|
|
13793
|
+
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 );";
|
|
13612
13794
|
|
|
13613
13795
|
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}";
|
|
13614
13796
|
|
|
@@ -13646,59 +13828,59 @@ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D spe
|
|
|
13646
13828
|
|
|
13647
13829
|
var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
|
|
13648
13830
|
|
|
13649
|
-
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; }";
|
|
13831
|
+
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; }";
|
|
13650
13832
|
|
|
13651
|
-
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
|
|
13833
|
+
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";
|
|
13652
13834
|
|
|
13653
|
-
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
|
|
13835
|
+
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";
|
|
13654
13836
|
|
|
13655
|
-
var uv_pars_fragment = "#
|
|
13837
|
+
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";
|
|
13656
13838
|
|
|
13657
|
-
var uv_pars_vertex = "#
|
|
13839
|
+
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";
|
|
13658
13840
|
|
|
13659
|
-
var uv_vertex = "#
|
|
13841
|
+
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";
|
|
13660
13842
|
|
|
13661
13843
|
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";
|
|
13662
13844
|
|
|
13663
13845
|
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}";
|
|
13664
13846
|
|
|
13665
|
-
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 <
|
|
13847
|
+
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}";
|
|
13666
13848
|
|
|
13667
13849
|
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}";
|
|
13668
13850
|
|
|
13669
|
-
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 <
|
|
13851
|
+
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}";
|
|
13670
13852
|
|
|
13671
13853
|
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}";
|
|
13672
13854
|
|
|
13673
|
-
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 <
|
|
13855
|
+
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}";
|
|
13674
13856
|
|
|
13675
13857
|
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}";
|
|
13676
13858
|
|
|
13677
|
-
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}";
|
|
13859
|
+
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}";
|
|
13678
13860
|
|
|
13679
13861
|
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}";
|
|
13680
13862
|
|
|
13681
|
-
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}";
|
|
13863
|
+
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}";
|
|
13682
13864
|
|
|
13683
13865
|
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}";
|
|
13684
13866
|
|
|
13685
|
-
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 <
|
|
13867
|
+
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}";
|
|
13686
13868
|
|
|
13687
13869
|
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}";
|
|
13688
13870
|
|
|
13689
|
-
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 <
|
|
13871
|
+
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}";
|
|
13690
13872
|
|
|
13691
13873
|
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}";
|
|
13692
13874
|
|
|
13693
|
-
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 <
|
|
13875
|
+
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}";
|
|
13694
13876
|
|
|
13695
13877
|
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}";
|
|
13696
13878
|
|
|
13697
|
-
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 <
|
|
13879
|
+
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}";
|
|
13698
13880
|
|
|
13699
13881
|
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}";
|
|
13700
13882
|
|
|
13701
|
-
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 <
|
|
13883
|
+
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}";
|
|
13702
13884
|
|
|
13703
13885
|
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}";
|
|
13704
13886
|
|
|
@@ -13706,29 +13888,31 @@ const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SH
|
|
|
13706
13888
|
|
|
13707
13889
|
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}";
|
|
13708
13890
|
|
|
13709
|
-
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 <
|
|
13891
|
+
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}";
|
|
13710
13892
|
|
|
13711
13893
|
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}";
|
|
13712
13894
|
|
|
13713
|
-
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 <
|
|
13895
|
+
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}";
|
|
13714
13896
|
|
|
13715
13897
|
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}";
|
|
13716
13898
|
|
|
13717
|
-
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 <
|
|
13899
|
+
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}";
|
|
13718
13900
|
|
|
13719
13901
|
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}";
|
|
13720
13902
|
|
|
13721
|
-
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 <
|
|
13903
|
+
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}";
|
|
13722
13904
|
|
|
13723
13905
|
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}";
|
|
13724
13906
|
|
|
13725
|
-
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 <
|
|
13907
|
+
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}";
|
|
13726
13908
|
|
|
13727
13909
|
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}";
|
|
13728
13910
|
|
|
13729
|
-
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 <
|
|
13911
|
+
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}";
|
|
13730
13912
|
|
|
13731
13913
|
const ShaderChunk = {
|
|
13914
|
+
alphahash_fragment: alphahash_fragment,
|
|
13915
|
+
alphahash_pars_fragment: alphahash_pars_fragment,
|
|
13732
13916
|
alphamap_fragment: alphamap_fragment,
|
|
13733
13917
|
alphamap_pars_fragment: alphamap_pars_fragment,
|
|
13734
13918
|
alphatest_fragment: alphatest_fragment,
|
|
@@ -13755,8 +13939,8 @@ const ShaderChunk = {
|
|
|
13755
13939
|
displacementmap_vertex: displacementmap_vertex,
|
|
13756
13940
|
emissivemap_fragment: emissivemap_fragment,
|
|
13757
13941
|
emissivemap_pars_fragment: emissivemap_pars_fragment,
|
|
13758
|
-
|
|
13759
|
-
|
|
13942
|
+
colorspace_fragment: colorspace_fragment,
|
|
13943
|
+
colorspace_pars_fragment: colorspace_pars_fragment,
|
|
13760
13944
|
envmap_fragment: envmap_fragment,
|
|
13761
13945
|
envmap_common_pars_fragment: envmap_common_pars_fragment,
|
|
13762
13946
|
envmap_pars_fragment: envmap_pars_fragment,
|
|
@@ -13806,7 +13990,7 @@ const ShaderChunk = {
|
|
|
13806
13990
|
clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,
|
|
13807
13991
|
clearcoat_pars_fragment: clearcoat_pars_fragment,
|
|
13808
13992
|
iridescence_pars_fragment: iridescence_pars_fragment,
|
|
13809
|
-
|
|
13993
|
+
opaque_fragment: opaque_fragment,
|
|
13810
13994
|
packing: packing,
|
|
13811
13995
|
premultiplied_alpha_fragment: premultiplied_alpha_fragment,
|
|
13812
13996
|
project_vertex: project_vertex,
|
|
@@ -14072,6 +14256,7 @@ const UniformsLib = {
|
|
|
14072
14256
|
scale: { value: 1.0 },
|
|
14073
14257
|
map: { value: null },
|
|
14074
14258
|
alphaMap: { value: null },
|
|
14259
|
+
alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14075
14260
|
alphaTest: { value: 0 },
|
|
14076
14261
|
uvTransform: { value: /*@__PURE__*/ new Matrix3() }
|
|
14077
14262
|
|
|
@@ -14086,6 +14271,7 @@ const UniformsLib = {
|
|
|
14086
14271
|
map: { value: null },
|
|
14087
14272
|
mapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14088
14273
|
alphaMap: { value: null },
|
|
14274
|
+
alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14089
14275
|
alphaTest: { value: 0 }
|
|
14090
14276
|
|
|
14091
14277
|
}
|
|
@@ -14429,7 +14615,10 @@ ShaderLib.physical = {
|
|
|
14429
14615
|
specularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14430
14616
|
specularIntensity: { value: 1 },
|
|
14431
14617
|
specularIntensityMap: { value: null },
|
|
14432
|
-
specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() }
|
|
14618
|
+
specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14619
|
+
anisotropyVector: { value: /*@__PURE__*/ new Vector2() },
|
|
14620
|
+
anisotropyMap: { value: null },
|
|
14621
|
+
anisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },
|
|
14433
14622
|
}
|
|
14434
14623
|
] ),
|
|
14435
14624
|
|
|
@@ -14991,9 +15180,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
14991
15180
|
|
|
14992
15181
|
}
|
|
14993
15182
|
|
|
14994
|
-
function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
|
|
15183
|
+
function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
|
|
14995
15184
|
|
|
14996
|
-
if (
|
|
15185
|
+
if ( integer === true ) {
|
|
14997
15186
|
|
|
14998
15187
|
gl.vertexAttribIPointer( index, size, type, stride, offset );
|
|
14999
15188
|
|
|
@@ -15051,6 +15240,10 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
15051
15240
|
const type = attribute.type;
|
|
15052
15241
|
const bytesPerElement = attribute.bytesPerElement;
|
|
15053
15242
|
|
|
15243
|
+
// check for integer attributes (WebGL 2 only)
|
|
15244
|
+
|
|
15245
|
+
const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
|
|
15246
|
+
|
|
15054
15247
|
if ( geometryAttribute.isInterleavedBufferAttribute ) {
|
|
15055
15248
|
|
|
15056
15249
|
const data = geometryAttribute.data;
|
|
@@ -15091,7 +15284,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
15091
15284
|
type,
|
|
15092
15285
|
normalized,
|
|
15093
15286
|
stride * bytesPerElement,
|
|
15094
|
-
( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
|
|
15287
|
+
( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
|
|
15288
|
+
integer
|
|
15095
15289
|
);
|
|
15096
15290
|
|
|
15097
15291
|
}
|
|
@@ -15132,7 +15326,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
15132
15326
|
type,
|
|
15133
15327
|
normalized,
|
|
15134
15328
|
size * bytesPerElement,
|
|
15135
|
-
( size / programAttribute.locationSize ) * i * bytesPerElement
|
|
15329
|
+
( size / programAttribute.locationSize ) * i * bytesPerElement,
|
|
15330
|
+
integer
|
|
15136
15331
|
);
|
|
15137
15332
|
|
|
15138
15333
|
}
|
|
@@ -15840,7 +16035,7 @@ class OrthographicCamera extends Camera {
|
|
|
15840
16035
|
|
|
15841
16036
|
}
|
|
15842
16037
|
|
|
15843
|
-
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far );
|
|
16038
|
+
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
|
|
15844
16039
|
|
|
15845
16040
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
15846
16041
|
|
|
@@ -16981,6 +17176,18 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) {
|
|
|
16981
17176
|
|
|
16982
17177
|
}
|
|
16983
17178
|
|
|
17179
|
+
for ( const name in geometry.morphAttributes ) {
|
|
17180
|
+
|
|
17181
|
+
const array = geometry.morphAttributes[ name ];
|
|
17182
|
+
|
|
17183
|
+
for ( let i = 0, l = array.length; i < l; i ++ ) {
|
|
17184
|
+
|
|
17185
|
+
attributes.remove( array[ i ] );
|
|
17186
|
+
|
|
17187
|
+
}
|
|
17188
|
+
|
|
17189
|
+
}
|
|
17190
|
+
|
|
16984
17191
|
geometry.removeEventListener( 'dispose', onGeometryDispose );
|
|
16985
17192
|
|
|
16986
17193
|
delete geometries[ geometry.id ];
|
|
@@ -17270,7 +17477,6 @@ function WebGLInfo( gl ) {
|
|
|
17270
17477
|
|
|
17271
17478
|
function reset() {
|
|
17272
17479
|
|
|
17273
|
-
render.frame ++;
|
|
17274
17480
|
render.calls = 0;
|
|
17275
17481
|
render.triangles = 0;
|
|
17276
17482
|
render.points = 0;
|
|
@@ -17611,11 +17817,31 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
17611
17817
|
|
|
17612
17818
|
}
|
|
17613
17819
|
|
|
17614
|
-
|
|
17820
|
+
if ( updateMap.get( object ) !== frame ) {
|
|
17821
|
+
|
|
17822
|
+
attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
|
|
17823
|
+
|
|
17824
|
+
if ( object.instanceColor !== null ) {
|
|
17825
|
+
|
|
17826
|
+
attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
|
|
17827
|
+
|
|
17828
|
+
}
|
|
17829
|
+
|
|
17830
|
+
updateMap.set( object, frame );
|
|
17831
|
+
|
|
17832
|
+
}
|
|
17833
|
+
|
|
17834
|
+
}
|
|
17835
|
+
|
|
17836
|
+
if ( object.isSkinnedMesh ) {
|
|
17615
17837
|
|
|
17616
|
-
|
|
17838
|
+
const skeleton = object.skeleton;
|
|
17617
17839
|
|
|
17618
|
-
|
|
17840
|
+
if ( updateMap.get( skeleton ) !== frame ) {
|
|
17841
|
+
|
|
17842
|
+
skeleton.update();
|
|
17843
|
+
|
|
17844
|
+
updateMap.set( skeleton, frame );
|
|
17619
17845
|
|
|
17620
17846
|
}
|
|
17621
17847
|
|
|
@@ -17695,6 +17921,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
17695
17921
|
*
|
|
17696
17922
|
*/
|
|
17697
17923
|
|
|
17924
|
+
|
|
17698
17925
|
const emptyTexture = /*@__PURE__*/ new Texture();
|
|
17699
17926
|
const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
|
|
17700
17927
|
const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
|
|
@@ -19011,13 +19238,30 @@ function resolveIncludes( string ) {
|
|
|
19011
19238
|
|
|
19012
19239
|
}
|
|
19013
19240
|
|
|
19241
|
+
const shaderChunkMap = new Map( [
|
|
19242
|
+
[ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154
|
|
19243
|
+
[ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154
|
|
19244
|
+
[ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154
|
|
19245
|
+
] );
|
|
19246
|
+
|
|
19014
19247
|
function includeReplacer( match, include ) {
|
|
19015
19248
|
|
|
19016
|
-
|
|
19249
|
+
let string = ShaderChunk[ include ];
|
|
19017
19250
|
|
|
19018
19251
|
if ( string === undefined ) {
|
|
19019
19252
|
|
|
19020
|
-
|
|
19253
|
+
const newInclude = shaderChunkMap.get( include );
|
|
19254
|
+
|
|
19255
|
+
if ( newInclude !== undefined ) {
|
|
19256
|
+
|
|
19257
|
+
string = ShaderChunk[ newInclude ];
|
|
19258
|
+
console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
|
|
19259
|
+
|
|
19260
|
+
} else {
|
|
19261
|
+
|
|
19262
|
+
throw new Error( 'Can not resolve #include <' + include + '>' );
|
|
19263
|
+
|
|
19264
|
+
}
|
|
19021
19265
|
|
|
19022
19266
|
}
|
|
19023
19267
|
|
|
@@ -19218,6 +19462,9 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19218
19462
|
|
|
19219
19463
|
prefixVertex = [
|
|
19220
19464
|
|
|
19465
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19466
|
+
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19467
|
+
|
|
19221
19468
|
customDefines
|
|
19222
19469
|
|
|
19223
19470
|
].filter( filterEmptyLine ).join( '\n' );
|
|
@@ -19231,6 +19478,10 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19231
19478
|
prefixFragment = [
|
|
19232
19479
|
|
|
19233
19480
|
customExtensions,
|
|
19481
|
+
|
|
19482
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19483
|
+
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19484
|
+
|
|
19234
19485
|
customDefines
|
|
19235
19486
|
|
|
19236
19487
|
].filter( filterEmptyLine ).join( '\n' );
|
|
@@ -19247,6 +19498,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19247
19498
|
|
|
19248
19499
|
generatePrecision( parameters ),
|
|
19249
19500
|
|
|
19501
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19250
19502
|
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19251
19503
|
|
|
19252
19504
|
customDefines,
|
|
@@ -19269,6 +19521,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19269
19521
|
parameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',
|
|
19270
19522
|
parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
|
|
19271
19523
|
|
|
19524
|
+
parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
|
|
19525
|
+
|
|
19272
19526
|
parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
|
|
19273
19527
|
parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
|
|
19274
19528
|
parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',
|
|
@@ -19283,6 +19537,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19283
19537
|
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
|
|
19284
19538
|
parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
|
|
19285
19539
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19540
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19286
19541
|
|
|
19287
19542
|
parameters.transmission ? '#define USE_TRANSMISSION' : '',
|
|
19288
19543
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
@@ -19305,6 +19560,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19305
19560
|
parameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',
|
|
19306
19561
|
parameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',
|
|
19307
19562
|
|
|
19563
|
+
parameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',
|
|
19564
|
+
|
|
19308
19565
|
parameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',
|
|
19309
19566
|
parameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',
|
|
19310
19567
|
parameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',
|
|
@@ -19324,7 +19581,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19324
19581
|
|
|
19325
19582
|
//
|
|
19326
19583
|
|
|
19327
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19584
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19328
19585
|
parameters.vertexColors ? '#define USE_COLOR' : '',
|
|
19329
19586
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19330
19587
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19351,6 +19608,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19351
19608
|
|
|
19352
19609
|
parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
|
|
19353
19610
|
|
|
19611
|
+
parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
|
|
19612
|
+
|
|
19354
19613
|
parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
|
|
19355
19614
|
( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
|
|
19356
19615
|
|
|
@@ -19454,6 +19713,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19454
19713
|
|
|
19455
19714
|
generatePrecision( parameters ),
|
|
19456
19715
|
|
|
19716
|
+
'#define SHADER_TYPE ' + parameters.shaderType,
|
|
19457
19717
|
'#define SHADER_NAME ' + parameters.shaderName,
|
|
19458
19718
|
|
|
19459
19719
|
customDefines,
|
|
@@ -19478,6 +19738,9 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19478
19738
|
parameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',
|
|
19479
19739
|
parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
|
|
19480
19740
|
|
|
19741
|
+
parameters.anisotropy ? '#define USE_ANISOTROPY' : '',
|
|
19742
|
+
parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
|
|
19743
|
+
|
|
19481
19744
|
parameters.clearcoat ? '#define USE_CLEARCOAT' : '',
|
|
19482
19745
|
parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
|
|
19483
19746
|
parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
|
|
@@ -19496,6 +19759,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19496
19759
|
|
|
19497
19760
|
parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
|
|
19498
19761
|
parameters.alphaTest ? '#define USE_ALPHATEST' : '',
|
|
19762
|
+
parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
|
|
19499
19763
|
|
|
19500
19764
|
parameters.sheen ? '#define USE_SHEEN' : '',
|
|
19501
19765
|
parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',
|
|
@@ -19505,7 +19769,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19505
19769
|
parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
|
|
19506
19770
|
parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
|
|
19507
19771
|
|
|
19508
|
-
parameters.vertexTangents ? '#define USE_TANGENT' : '',
|
|
19772
|
+
parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
|
|
19509
19773
|
parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
|
|
19510
19774
|
parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
|
|
19511
19775
|
parameters.vertexUv1s ? '#define USE_UV1' : '',
|
|
@@ -19542,7 +19806,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19542
19806
|
parameters.dithering ? '#define DITHERING' : '',
|
|
19543
19807
|
parameters.opaque ? '#define OPAQUE' : '',
|
|
19544
19808
|
|
|
19545
|
-
ShaderChunk[ '
|
|
19809
|
+
ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
|
|
19546
19810
|
getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
|
|
19547
19811
|
|
|
19548
19812
|
parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
|
|
@@ -19749,6 +20013,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
19749
20013
|
|
|
19750
20014
|
//
|
|
19751
20015
|
|
|
20016
|
+
this.type = parameters.shaderType;
|
|
19752
20017
|
this.name = parameters.shaderName;
|
|
19753
20018
|
this.id = programIdCount ++;
|
|
19754
20019
|
this.cacheKey = cacheKey;
|
|
@@ -19916,11 +20181,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
19916
20181
|
|
|
19917
20182
|
function getChannel( value ) {
|
|
19918
20183
|
|
|
19919
|
-
if ( value ===
|
|
19920
|
-
if ( value === 2 ) return 'uv2';
|
|
19921
|
-
if ( value === 3 ) return 'uv3';
|
|
20184
|
+
if ( value === 0 ) return 'uv';
|
|
19922
20185
|
|
|
19923
|
-
return
|
|
20186
|
+
return `uv${ value }`;
|
|
19924
20187
|
|
|
19925
20188
|
}
|
|
19926
20189
|
|
|
@@ -20002,11 +20265,14 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20002
20265
|
const HAS_METALNESSMAP = !! material.metalnessMap;
|
|
20003
20266
|
const HAS_ROUGHNESSMAP = !! material.roughnessMap;
|
|
20004
20267
|
|
|
20268
|
+
const HAS_ANISOTROPY = material.anisotropy > 0;
|
|
20005
20269
|
const HAS_CLEARCOAT = material.clearcoat > 0;
|
|
20006
20270
|
const HAS_IRIDESCENCE = material.iridescence > 0;
|
|
20007
20271
|
const HAS_SHEEN = material.sheen > 0;
|
|
20008
20272
|
const HAS_TRANSMISSION = material.transmission > 0;
|
|
20009
20273
|
|
|
20274
|
+
const HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;
|
|
20275
|
+
|
|
20010
20276
|
const HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;
|
|
20011
20277
|
const HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;
|
|
20012
20278
|
const HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;
|
|
@@ -20030,6 +20296,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20030
20296
|
|
|
20031
20297
|
const HAS_ALPHATEST = material.alphaTest > 0;
|
|
20032
20298
|
|
|
20299
|
+
const HAS_ALPHAHASH = !! material.alphaHash;
|
|
20300
|
+
|
|
20033
20301
|
const HAS_EXTENSIONS = !! material.extensions;
|
|
20034
20302
|
|
|
20035
20303
|
const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1;
|
|
@@ -20041,7 +20309,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20041
20309
|
isWebGL2: IS_WEBGL2,
|
|
20042
20310
|
|
|
20043
20311
|
shaderID: shaderID,
|
|
20044
|
-
|
|
20312
|
+
shaderType: material.type,
|
|
20313
|
+
shaderName: material.name,
|
|
20045
20314
|
|
|
20046
20315
|
vertexShader: vertexShader,
|
|
20047
20316
|
fragmentShader: fragmentShader,
|
|
@@ -20079,6 +20348,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20079
20348
|
metalnessMap: HAS_METALNESSMAP,
|
|
20080
20349
|
roughnessMap: HAS_ROUGHNESSMAP,
|
|
20081
20350
|
|
|
20351
|
+
anisotropy: HAS_ANISOTROPY,
|
|
20352
|
+
anisotropyMap: HAS_ANISOTROPYMAP,
|
|
20353
|
+
|
|
20082
20354
|
clearcoat: HAS_CLEARCOAT,
|
|
20083
20355
|
clearcoatMap: HAS_CLEARCOATMAP,
|
|
20084
20356
|
clearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,
|
|
@@ -20106,6 +20378,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20106
20378
|
|
|
20107
20379
|
alphaMap: HAS_ALPHAMAP,
|
|
20108
20380
|
alphaTest: HAS_ALPHATEST,
|
|
20381
|
+
alphaHash: HAS_ALPHAHASH,
|
|
20109
20382
|
|
|
20110
20383
|
combine: material.combine,
|
|
20111
20384
|
|
|
@@ -20122,6 +20395,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20122
20395
|
metalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),
|
|
20123
20396
|
roughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),
|
|
20124
20397
|
|
|
20398
|
+
anisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),
|
|
20399
|
+
|
|
20125
20400
|
clearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),
|
|
20126
20401
|
clearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),
|
|
20127
20402
|
clearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),
|
|
@@ -20143,7 +20418,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20143
20418
|
|
|
20144
20419
|
//
|
|
20145
20420
|
|
|
20146
|
-
vertexTangents:
|
|
20421
|
+
vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),
|
|
20147
20422
|
vertexColors: material.vertexColors,
|
|
20148
20423
|
vertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,
|
|
20149
20424
|
vertexUv1s: HAS_ATTRIBUTE_UV1,
|
|
@@ -20275,6 +20550,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20275
20550
|
array.push( parameters.emissiveMapUv );
|
|
20276
20551
|
array.push( parameters.metalnessMapUv );
|
|
20277
20552
|
array.push( parameters.roughnessMapUv );
|
|
20553
|
+
array.push( parameters.anisotropyMapUv );
|
|
20278
20554
|
array.push( parameters.clearcoatMapUv );
|
|
20279
20555
|
array.push( parameters.clearcoatNormalMapUv );
|
|
20280
20556
|
array.push( parameters.clearcoatRoughnessMapUv );
|
|
@@ -20348,6 +20624,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
20348
20624
|
_programLayers.enable( 15 );
|
|
20349
20625
|
if ( parameters.vertexTangents )
|
|
20350
20626
|
_programLayers.enable( 16 );
|
|
20627
|
+
if ( parameters.anisotropy )
|
|
20628
|
+
_programLayers.enable( 17 );
|
|
20351
20629
|
|
|
20352
20630
|
array.push( _programLayers.mask );
|
|
20353
20631
|
_programLayers.disableAll();
|
|
@@ -23728,6 +24006,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
23728
24006
|
[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
|
|
23729
24007
|
};
|
|
23730
24008
|
|
|
24009
|
+
const compareToGL = {
|
|
24010
|
+
[ NeverCompare ]: _gl.NEVER,
|
|
24011
|
+
[ AlwaysCompare ]: _gl.ALWAYS,
|
|
24012
|
+
[ LessCompare ]: _gl.LESS,
|
|
24013
|
+
[ LessEqualCompare ]: _gl.LEQUAL,
|
|
24014
|
+
[ EqualCompare ]: _gl.EQUAL,
|
|
24015
|
+
[ GreaterEqualCompare ]: _gl.GEQUAL,
|
|
24016
|
+
[ GreaterCompare ]: _gl.GREATER,
|
|
24017
|
+
[ NotEqualCompare ]: _gl.NOTEQUAL
|
|
24018
|
+
};
|
|
24019
|
+
|
|
23731
24020
|
function setTextureParameters( textureType, texture, supportsMips ) {
|
|
23732
24021
|
|
|
23733
24022
|
if ( supportsMips ) {
|
|
@@ -23772,6 +24061,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
23772
24061
|
|
|
23773
24062
|
}
|
|
23774
24063
|
|
|
24064
|
+
if ( texture.compareFunction ) {
|
|
24065
|
+
|
|
24066
|
+
_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
|
|
24067
|
+
_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
|
|
24068
|
+
|
|
24069
|
+
}
|
|
24070
|
+
|
|
23775
24071
|
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
|
|
23776
24072
|
|
|
23777
24073
|
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|
|
@@ -25505,6 +25801,7 @@ class ArrayCamera extends PerspectiveCamera {
|
|
|
25505
25801
|
* @author mrdoob / http://mrdoob.com/
|
|
25506
25802
|
*/
|
|
25507
25803
|
|
|
25804
|
+
|
|
25508
25805
|
var cameraLPos = new Vector3();
|
|
25509
25806
|
var cameraRPos = new Vector3();
|
|
25510
25807
|
|
|
@@ -25567,6 +25864,7 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
|
|
|
25567
25864
|
* @author mrdoob / http://mrdoob.com/
|
|
25568
25865
|
*/
|
|
25569
25866
|
|
|
25867
|
+
|
|
25570
25868
|
function WebVRManager( renderer ) {
|
|
25571
25869
|
|
|
25572
25870
|
var renderWidth, renderHeight;
|
|
@@ -25978,6 +26276,18 @@ function WebVRManager( renderer ) {
|
|
|
25978
26276
|
|
|
25979
26277
|
};
|
|
25980
26278
|
|
|
26279
|
+
// Dummy getEnvironmentBlendMode to have the same API as WebXR
|
|
26280
|
+
|
|
26281
|
+
this.getEnvironmentBlendMode = function () {
|
|
26282
|
+
|
|
26283
|
+
if ( scope.isPresenting ) {
|
|
26284
|
+
|
|
26285
|
+
return 'opaque';
|
|
26286
|
+
|
|
26287
|
+
}
|
|
26288
|
+
|
|
26289
|
+
};
|
|
26290
|
+
|
|
25981
26291
|
//
|
|
25982
26292
|
|
|
25983
26293
|
this.getStandingMatrix = function () {
|
|
@@ -26398,8 +26708,30 @@ class DepthTexture extends Texture {
|
|
|
26398
26708
|
this.flipY = false;
|
|
26399
26709
|
this.generateMipmaps = false;
|
|
26400
26710
|
|
|
26711
|
+
this.compareFunction = null;
|
|
26712
|
+
|
|
26713
|
+
}
|
|
26714
|
+
|
|
26715
|
+
|
|
26716
|
+
copy( source ) {
|
|
26717
|
+
|
|
26718
|
+
super.copy( source );
|
|
26719
|
+
|
|
26720
|
+
this.compareFunction = source.compareFunction;
|
|
26721
|
+
|
|
26722
|
+
return this;
|
|
26723
|
+
|
|
26401
26724
|
}
|
|
26402
26725
|
|
|
26726
|
+
toJSON( meta ) {
|
|
26727
|
+
|
|
26728
|
+
const data = super.toJSON( meta );
|
|
26729
|
+
|
|
26730
|
+
if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;
|
|
26731
|
+
|
|
26732
|
+
return data;
|
|
26733
|
+
|
|
26734
|
+
}
|
|
26403
26735
|
|
|
26404
26736
|
}
|
|
26405
26737
|
|
|
@@ -26436,9 +26768,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
26436
26768
|
const controllers = [];
|
|
26437
26769
|
const controllerInputSources = [];
|
|
26438
26770
|
|
|
26439
|
-
const planes = new Set();
|
|
26440
|
-
const planesLastChangedTimes = new Map();
|
|
26441
|
-
|
|
26442
26771
|
//
|
|
26443
26772
|
|
|
26444
26773
|
const cameraL = new PerspectiveCamera();
|
|
@@ -26451,9 +26780,9 @@ class WebXRManager extends EventDispatcher {
|
|
|
26451
26780
|
|
|
26452
26781
|
const cameras = [ cameraL, cameraR ];
|
|
26453
26782
|
|
|
26454
|
-
const
|
|
26455
|
-
|
|
26456
|
-
|
|
26783
|
+
const cameraXR = new ArrayCamera();
|
|
26784
|
+
cameraXR.layers.enable( 1 );
|
|
26785
|
+
cameraXR.layers.enable( 2 );
|
|
26457
26786
|
|
|
26458
26787
|
let _currentDepthNear = null;
|
|
26459
26788
|
let _currentDepthFar = null;
|
|
@@ -26938,28 +27267,28 @@ class WebXRManager extends EventDispatcher {
|
|
|
26938
27267
|
|
|
26939
27268
|
if ( session === null ) return;
|
|
26940
27269
|
|
|
26941
|
-
|
|
26942
|
-
|
|
27270
|
+
cameraXR.near = cameraR.near = cameraL.near = camera.near;
|
|
27271
|
+
cameraXR.far = cameraR.far = cameraL.far = camera.far;
|
|
26943
27272
|
|
|
26944
|
-
if ( _currentDepthNear !==
|
|
27273
|
+
if ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {
|
|
26945
27274
|
|
|
26946
27275
|
// Note that the new renderState won't apply until the next frame. See #18320
|
|
26947
27276
|
|
|
26948
27277
|
session.updateRenderState( {
|
|
26949
|
-
depthNear:
|
|
26950
|
-
depthFar:
|
|
27278
|
+
depthNear: cameraXR.near,
|
|
27279
|
+
depthFar: cameraXR.far
|
|
26951
27280
|
} );
|
|
26952
27281
|
|
|
26953
|
-
_currentDepthNear =
|
|
26954
|
-
_currentDepthFar =
|
|
27282
|
+
_currentDepthNear = cameraXR.near;
|
|
27283
|
+
_currentDepthFar = cameraXR.far;
|
|
26955
27284
|
|
|
26956
27285
|
}
|
|
26957
27286
|
|
|
26958
|
-
const cameras =
|
|
27287
|
+
const cameras = cameraXR.cameras;
|
|
26959
27288
|
var object = poseTarget || camera;
|
|
26960
27289
|
const parent = object.parent;
|
|
26961
27290
|
|
|
26962
|
-
updateCamera(
|
|
27291
|
+
updateCamera( cameraXR, parent );
|
|
26963
27292
|
|
|
26964
27293
|
for ( let i = 0; i < cameras.length; i ++ ) {
|
|
26965
27294
|
|
|
@@ -26971,39 +27300,41 @@ class WebXRManager extends EventDispatcher {
|
|
|
26971
27300
|
|
|
26972
27301
|
if ( cameras.length === 2 ) {
|
|
26973
27302
|
|
|
26974
|
-
setProjectionFromUnion(
|
|
27303
|
+
setProjectionFromUnion( cameraXR, cameraL, cameraR );
|
|
26975
27304
|
|
|
26976
27305
|
} else {
|
|
26977
27306
|
|
|
26978
27307
|
// assume single camera setup (AR)
|
|
26979
27308
|
|
|
26980
|
-
|
|
27309
|
+
cameraXR.projectionMatrix.copy( cameraL.projectionMatrix );
|
|
26981
27310
|
|
|
26982
27311
|
}
|
|
26983
27312
|
|
|
26984
|
-
|
|
26985
|
-
updateUserCamera( camera, cameraVR, object );
|
|
27313
|
+
updateUserCamera( camera, cameraXR, object );
|
|
26986
27314
|
|
|
26987
27315
|
};
|
|
26988
27316
|
|
|
26989
|
-
function updateUserCamera( camera,
|
|
27317
|
+
function updateUserCamera( camera, cameraXR, object ) {
|
|
26990
27318
|
|
|
26991
|
-
|
|
27319
|
+
cameraXR.matrixWorld.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
|
|
26992
27320
|
|
|
26993
|
-
|
|
26994
|
-
object.matrix.copy( cameraVR.matrix );
|
|
26995
|
-
object.matrix.decompose( object.position, object.quaternion, object.scale );
|
|
27321
|
+
if ( object.parent === null ) {
|
|
26996
27322
|
|
|
26997
|
-
|
|
27323
|
+
object.matrix.copy( cameraXR.matrixWorld );
|
|
26998
27324
|
|
|
26999
|
-
|
|
27325
|
+
} else {
|
|
27000
27326
|
|
|
27001
|
-
|
|
27327
|
+
object.matrix.copy( object.parent.matrixWorld );
|
|
27328
|
+
object.matrix.invert();
|
|
27329
|
+
object.matrix.multiply( cameraXR.matrixWorld );
|
|
27002
27330
|
|
|
27003
27331
|
}
|
|
27004
27332
|
|
|
27005
|
-
|
|
27006
|
-
|
|
27333
|
+
object.matrix.decompose( object.position, object.quaternion, object.scale );
|
|
27334
|
+
object.updateMatrixWorld( true );
|
|
27335
|
+
|
|
27336
|
+
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
27337
|
+
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
27007
27338
|
|
|
27008
27339
|
if ( camera.isPerspectiveCamera ) {
|
|
27009
27340
|
|
|
@@ -27016,7 +27347,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
27016
27347
|
|
|
27017
27348
|
this.getCamera = function () {
|
|
27018
27349
|
|
|
27019
|
-
return
|
|
27350
|
+
return cameraXR;
|
|
27020
27351
|
|
|
27021
27352
|
};
|
|
27022
27353
|
|
|
@@ -27053,12 +27384,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
27053
27384
|
|
|
27054
27385
|
};
|
|
27055
27386
|
|
|
27056
|
-
this.getPlanes = function () {
|
|
27057
|
-
|
|
27058
|
-
return planes;
|
|
27059
|
-
|
|
27060
|
-
};
|
|
27061
|
-
|
|
27062
27387
|
// Animation Loop
|
|
27063
27388
|
|
|
27064
27389
|
let onAnimationFrameCallback = null;
|
|
@@ -27079,14 +27404,14 @@ class WebXRManager extends EventDispatcher {
|
|
|
27079
27404
|
|
|
27080
27405
|
}
|
|
27081
27406
|
|
|
27082
|
-
let
|
|
27407
|
+
let cameraXRNeedsUpdate = false;
|
|
27083
27408
|
|
|
27084
|
-
// check if it's necessary to rebuild
|
|
27409
|
+
// check if it's necessary to rebuild cameraXR's camera list
|
|
27085
27410
|
|
|
27086
|
-
if ( views.length !==
|
|
27411
|
+
if ( views.length !== cameraXR.cameras.length ) {
|
|
27087
27412
|
|
|
27088
|
-
|
|
27089
|
-
|
|
27413
|
+
cameraXR.cameras.length = 0;
|
|
27414
|
+
cameraXRNeedsUpdate = true;
|
|
27090
27415
|
|
|
27091
27416
|
}
|
|
27092
27417
|
|
|
@@ -27138,14 +27463,14 @@ class WebXRManager extends EventDispatcher {
|
|
|
27138
27463
|
|
|
27139
27464
|
if ( i === 0 ) {
|
|
27140
27465
|
|
|
27141
|
-
|
|
27142
|
-
|
|
27466
|
+
cameraXR.matrix.copy( camera.matrix );
|
|
27467
|
+
cameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
|
|
27143
27468
|
|
|
27144
27469
|
}
|
|
27145
27470
|
|
|
27146
|
-
if (
|
|
27471
|
+
if ( cameraXRNeedsUpdate === true ) {
|
|
27147
27472
|
|
|
27148
|
-
|
|
27473
|
+
cameraXR.cameras.push( camera );
|
|
27149
27474
|
|
|
27150
27475
|
}
|
|
27151
27476
|
|
|
@@ -27172,60 +27497,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
27172
27497
|
|
|
27173
27498
|
if ( frame.detectedPlanes ) {
|
|
27174
27499
|
|
|
27175
|
-
scope.dispatchEvent( { type: 'planesdetected', data: frame
|
|
27176
|
-
|
|
27177
|
-
let planesToRemove = null;
|
|
27178
|
-
|
|
27179
|
-
for ( const plane of planes ) {
|
|
27180
|
-
|
|
27181
|
-
if ( ! frame.detectedPlanes.has( plane ) ) {
|
|
27182
|
-
|
|
27183
|
-
if ( planesToRemove === null ) {
|
|
27184
|
-
|
|
27185
|
-
planesToRemove = [];
|
|
27186
|
-
|
|
27187
|
-
}
|
|
27188
|
-
|
|
27189
|
-
planesToRemove.push( plane );
|
|
27190
|
-
|
|
27191
|
-
}
|
|
27192
|
-
|
|
27193
|
-
}
|
|
27194
|
-
|
|
27195
|
-
if ( planesToRemove !== null ) {
|
|
27196
|
-
|
|
27197
|
-
for ( const plane of planesToRemove ) {
|
|
27198
|
-
|
|
27199
|
-
planes.delete( plane );
|
|
27200
|
-
planesLastChangedTimes.delete( plane );
|
|
27201
|
-
scope.dispatchEvent( { type: 'planeremoved', data: plane } );
|
|
27202
|
-
|
|
27203
|
-
}
|
|
27204
|
-
|
|
27205
|
-
}
|
|
27206
|
-
|
|
27207
|
-
for ( const plane of frame.detectedPlanes ) {
|
|
27208
|
-
|
|
27209
|
-
if ( ! planes.has( plane ) ) {
|
|
27210
|
-
|
|
27211
|
-
planes.add( plane );
|
|
27212
|
-
planesLastChangedTimes.set( plane, frame.lastChangedTime );
|
|
27213
|
-
scope.dispatchEvent( { type: 'planeadded', data: plane } );
|
|
27214
|
-
|
|
27215
|
-
} else {
|
|
27216
|
-
|
|
27217
|
-
const lastKnownTime = planesLastChangedTimes.get( plane );
|
|
27218
|
-
|
|
27219
|
-
if ( plane.lastChangedTime > lastKnownTime ) {
|
|
27220
|
-
|
|
27221
|
-
planesLastChangedTimes.set( plane, plane.lastChangedTime );
|
|
27222
|
-
scope.dispatchEvent( { type: 'planechanged', data: plane } );
|
|
27223
|
-
|
|
27224
|
-
}
|
|
27225
|
-
|
|
27226
|
-
}
|
|
27227
|
-
|
|
27228
|
-
}
|
|
27500
|
+
scope.dispatchEvent( { type: 'planesdetected', data: frame } );
|
|
27229
27501
|
|
|
27230
27502
|
}
|
|
27231
27503
|
|
|
@@ -27537,6 +27809,8 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
27537
27809
|
|
|
27538
27810
|
uniforms.alphaMap.value = material.alphaMap;
|
|
27539
27811
|
|
|
27812
|
+
refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
|
|
27813
|
+
|
|
27540
27814
|
}
|
|
27541
27815
|
|
|
27542
27816
|
if ( material.alphaTest > 0 ) {
|
|
@@ -27565,6 +27839,8 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
27565
27839
|
|
|
27566
27840
|
uniforms.alphaMap.value = material.alphaMap;
|
|
27567
27841
|
|
|
27842
|
+
refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
|
|
27843
|
+
|
|
27568
27844
|
}
|
|
27569
27845
|
|
|
27570
27846
|
if ( material.alphaTest > 0 ) {
|
|
@@ -27746,6 +28022,20 @@ function WebGLMaterials( renderer, properties ) {
|
|
|
27746
28022
|
|
|
27747
28023
|
}
|
|
27748
28024
|
|
|
28025
|
+
if ( material.anisotropy > 0 ) {
|
|
28026
|
+
|
|
28027
|
+
uniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );
|
|
28028
|
+
|
|
28029
|
+
if ( material.anisotropyMap ) {
|
|
28030
|
+
|
|
28031
|
+
uniforms.anisotropyMap.value = material.anisotropyMap;
|
|
28032
|
+
|
|
28033
|
+
refreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );
|
|
28034
|
+
|
|
28035
|
+
}
|
|
28036
|
+
|
|
28037
|
+
}
|
|
28038
|
+
|
|
27749
28039
|
uniforms.specularIntensity.value = material.specularIntensity;
|
|
27750
28040
|
uniforms.specularColor.value.copy( material.specularColor );
|
|
27751
28041
|
|
|
@@ -28244,6 +28534,9 @@ class WebGLRenderer {
|
|
|
28244
28534
|
|
|
28245
28535
|
}
|
|
28246
28536
|
|
|
28537
|
+
const uintClearColor = new Uint32Array( 4 );
|
|
28538
|
+
const intClearColor = new Int32Array( 4 );
|
|
28539
|
+
|
|
28247
28540
|
let currentRenderList = null;
|
|
28248
28541
|
let currentRenderState = null;
|
|
28249
28542
|
|
|
@@ -28320,6 +28613,9 @@ class WebGLRenderer {
|
|
|
28320
28613
|
const _currentScissor = new Vector4();
|
|
28321
28614
|
let _currentScissorTest = null;
|
|
28322
28615
|
|
|
28616
|
+
const _currentClearColor = new Color( 0x000000 );
|
|
28617
|
+
let _currentClearAlpha = 0;
|
|
28618
|
+
|
|
28323
28619
|
//
|
|
28324
28620
|
|
|
28325
28621
|
let _width = canvas.width;
|
|
@@ -28350,6 +28646,7 @@ class WebGLRenderer {
|
|
|
28350
28646
|
|
|
28351
28647
|
const _projScreenMatrix = new Matrix4();
|
|
28352
28648
|
|
|
28649
|
+
const _vector2 = new Vector2();
|
|
28353
28650
|
const _vector3 = new Vector3();
|
|
28354
28651
|
|
|
28355
28652
|
const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
|
|
@@ -28427,6 +28724,12 @@ class WebGLRenderer {
|
|
|
28427
28724
|
|
|
28428
28725
|
}
|
|
28429
28726
|
|
|
28727
|
+
if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
28728
|
+
|
|
28729
|
+
console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
|
|
28730
|
+
|
|
28731
|
+
}
|
|
28732
|
+
|
|
28430
28733
|
// Some experimental-webgl implementations do not have getShaderPrecisionFormat
|
|
28431
28734
|
|
|
28432
28735
|
if ( _gl.getShaderPrecisionFormat === undefined ) {
|
|
@@ -28708,7 +29011,63 @@ class WebGLRenderer {
|
|
|
28708
29011
|
|
|
28709
29012
|
let bits = 0;
|
|
28710
29013
|
|
|
28711
|
-
if ( color )
|
|
29014
|
+
if ( color ) {
|
|
29015
|
+
|
|
29016
|
+
// check if we're trying to clear an integer target
|
|
29017
|
+
let isIntegerFormat = false;
|
|
29018
|
+
if ( _currentRenderTarget !== null ) {
|
|
29019
|
+
|
|
29020
|
+
const targetFormat = _currentRenderTarget.texture.format;
|
|
29021
|
+
isIntegerFormat = targetFormat === RGBAIntegerFormat ||
|
|
29022
|
+
targetFormat === RGIntegerFormat ||
|
|
29023
|
+
targetFormat === RedIntegerFormat;
|
|
29024
|
+
|
|
29025
|
+
}
|
|
29026
|
+
|
|
29027
|
+
// use the appropriate clear functions to clear the target if it's a signed
|
|
29028
|
+
// or unsigned integer target
|
|
29029
|
+
if ( isIntegerFormat ) {
|
|
29030
|
+
|
|
29031
|
+
const targetType = _currentRenderTarget.texture.type;
|
|
29032
|
+
const isUnsignedType = targetType === UnsignedByteType ||
|
|
29033
|
+
targetType === UnsignedIntType ||
|
|
29034
|
+
targetType === UnsignedShortType ||
|
|
29035
|
+
targetType === UnsignedInt248Type ||
|
|
29036
|
+
targetType === UnsignedShort4444Type ||
|
|
29037
|
+
targetType === UnsignedShort5551Type;
|
|
29038
|
+
|
|
29039
|
+
const clearColor = background.getClearColor();
|
|
29040
|
+
const a = background.getClearAlpha();
|
|
29041
|
+
const r = clearColor.r;
|
|
29042
|
+
const g = clearColor.g;
|
|
29043
|
+
const b = clearColor.b;
|
|
29044
|
+
|
|
29045
|
+
if ( isUnsignedType ) {
|
|
29046
|
+
|
|
29047
|
+
uintClearColor[ 0 ] = r;
|
|
29048
|
+
uintClearColor[ 1 ] = g;
|
|
29049
|
+
uintClearColor[ 2 ] = b;
|
|
29050
|
+
uintClearColor[ 3 ] = a;
|
|
29051
|
+
_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );
|
|
29052
|
+
|
|
29053
|
+
} else {
|
|
29054
|
+
|
|
29055
|
+
intClearColor[ 0 ] = r;
|
|
29056
|
+
intClearColor[ 1 ] = g;
|
|
29057
|
+
intClearColor[ 2 ] = b;
|
|
29058
|
+
intClearColor[ 3 ] = a;
|
|
29059
|
+
_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );
|
|
29060
|
+
|
|
29061
|
+
}
|
|
29062
|
+
|
|
29063
|
+
} else {
|
|
29064
|
+
|
|
29065
|
+
bits |= _gl.COLOR_BUFFER_BIT;
|
|
29066
|
+
|
|
29067
|
+
}
|
|
29068
|
+
|
|
29069
|
+
}
|
|
29070
|
+
|
|
28712
29071
|
if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
|
|
28713
29072
|
if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
|
|
28714
29073
|
|
|
@@ -29167,6 +29526,8 @@ class WebGLRenderer {
|
|
|
29167
29526
|
|
|
29168
29527
|
//
|
|
29169
29528
|
|
|
29529
|
+
this.info.render.frame ++;
|
|
29530
|
+
|
|
29170
29531
|
if ( _clippingEnabled === true ) clipping.beginShadows();
|
|
29171
29532
|
|
|
29172
29533
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
@@ -29179,6 +29540,7 @@ class WebGLRenderer {
|
|
|
29179
29540
|
|
|
29180
29541
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
29181
29542
|
|
|
29543
|
+
|
|
29182
29544
|
//
|
|
29183
29545
|
|
|
29184
29546
|
background.render( currentRenderList, scene );
|
|
@@ -29312,28 +29674,24 @@ class WebGLRenderer {
|
|
|
29312
29674
|
|
|
29313
29675
|
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
|
|
29314
29676
|
|
|
29315
|
-
|
|
29316
|
-
|
|
29317
|
-
// update skeleton only once in a frame
|
|
29318
|
-
|
|
29319
|
-
if ( object.skeleton.frame !== info.render.frame ) {
|
|
29677
|
+
const geometry = objects.update( object );
|
|
29678
|
+
const material = object.material;
|
|
29320
29679
|
|
|
29321
|
-
|
|
29322
|
-
object.skeleton.frame = info.render.frame;
|
|
29680
|
+
if ( sortObjects ) {
|
|
29323
29681
|
|
|
29324
|
-
|
|
29682
|
+
if ( object.boundingSphere !== undefined ) {
|
|
29325
29683
|
|
|
29326
|
-
|
|
29684
|
+
if ( object.boundingSphere === null ) object.computeBoundingSphere();
|
|
29685
|
+
_vector3.copy( object.boundingSphere.center );
|
|
29327
29686
|
|
|
29328
|
-
|
|
29329
|
-
const material = object.material;
|
|
29687
|
+
} else {
|
|
29330
29688
|
|
|
29331
|
-
|
|
29689
|
+
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
29690
|
+
_vector3.copy( geometry.boundingSphere.center );
|
|
29332
29691
|
|
|
29333
|
-
|
|
29692
|
+
}
|
|
29334
29693
|
|
|
29335
29694
|
_vector3
|
|
29336
|
-
.copy( geometry.boundingSphere.center )
|
|
29337
29695
|
.applyMatrix4( object.matrixWorld )
|
|
29338
29696
|
.applyMatrix4( _projScreenMatrix );
|
|
29339
29697
|
|
|
@@ -29408,15 +29766,15 @@ class WebGLRenderer {
|
|
|
29408
29766
|
|
|
29409
29767
|
function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
|
|
29410
29768
|
|
|
29411
|
-
|
|
29769
|
+
const isWebGL2 = capabilities.isWebGL2;
|
|
29412
29770
|
|
|
29413
|
-
|
|
29771
|
+
if ( _transmissionRenderTarget === null ) {
|
|
29414
29772
|
|
|
29415
|
-
_transmissionRenderTarget = new WebGLRenderTarget(
|
|
29773
|
+
_transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
|
|
29416
29774
|
generateMipmaps: true,
|
|
29417
29775
|
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
|
|
29418
29776
|
minFilter: LinearMipmapLinearFilter,
|
|
29419
|
-
samples: ( isWebGL2
|
|
29777
|
+
samples: ( isWebGL2 ) ? 4 : 0
|
|
29420
29778
|
} );
|
|
29421
29779
|
|
|
29422
29780
|
// debug
|
|
@@ -29431,10 +29789,27 @@ class WebGLRenderer {
|
|
|
29431
29789
|
|
|
29432
29790
|
}
|
|
29433
29791
|
|
|
29792
|
+
_this.getDrawingBufferSize( _vector2 );
|
|
29793
|
+
|
|
29794
|
+
if ( isWebGL2 ) {
|
|
29795
|
+
|
|
29796
|
+
_transmissionRenderTarget.setSize( _vector2.x, _vector2.y );
|
|
29797
|
+
|
|
29798
|
+
} else {
|
|
29799
|
+
|
|
29800
|
+
_transmissionRenderTarget.setSize( floorPowerOfTwo( _vector2.x ), floorPowerOfTwo( _vector2.y ) );
|
|
29801
|
+
|
|
29802
|
+
}
|
|
29803
|
+
|
|
29434
29804
|
//
|
|
29435
29805
|
|
|
29436
29806
|
const currentRenderTarget = _this.getRenderTarget();
|
|
29437
29807
|
_this.setRenderTarget( _transmissionRenderTarget );
|
|
29808
|
+
|
|
29809
|
+
_this.getClearColor( _currentClearColor );
|
|
29810
|
+
_currentClearAlpha = _this.getClearAlpha();
|
|
29811
|
+
if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
|
|
29812
|
+
|
|
29438
29813
|
_this.clear();
|
|
29439
29814
|
|
|
29440
29815
|
// Turn off the features which can affect the frag color for opaque objects pass.
|
|
@@ -29485,6 +29860,8 @@ class WebGLRenderer {
|
|
|
29485
29860
|
|
|
29486
29861
|
_this.setRenderTarget( currentRenderTarget );
|
|
29487
29862
|
|
|
29863
|
+
_this.setClearColor( _currentClearColor, _currentClearAlpha );
|
|
29864
|
+
|
|
29488
29865
|
_this.toneMapping = currentToneMapping;
|
|
29489
29866
|
|
|
29490
29867
|
}
|
|
@@ -29688,7 +30065,7 @@ class WebGLRenderer {
|
|
|
29688
30065
|
const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );
|
|
29689
30066
|
const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
|
|
29690
30067
|
const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
|
|
29691
|
-
const vertexTangents = !!
|
|
30068
|
+
const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );
|
|
29692
30069
|
const morphTargets = !! geometry.morphAttributes.position;
|
|
29693
30070
|
const morphNormals = !! geometry.morphAttributes.normal;
|
|
29694
30071
|
const morphColors = !! geometry.morphAttributes.color;
|
|
@@ -30488,6 +30865,12 @@ class WebGLRenderer {
|
|
|
30488
30865
|
|
|
30489
30866
|
}
|
|
30490
30867
|
|
|
30868
|
+
get coordinateSystem() {
|
|
30869
|
+
|
|
30870
|
+
return WebGLCoordinateSystem;
|
|
30871
|
+
|
|
30872
|
+
}
|
|
30873
|
+
|
|
30491
30874
|
get physicallyCorrectLights() { // @deprecated, r150
|
|
30492
30875
|
|
|
30493
30876
|
console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
|
|
@@ -30645,20 +31028,6 @@ class Scene extends Object3D {
|
|
|
30645
31028
|
|
|
30646
31029
|
}
|
|
30647
31030
|
|
|
30648
|
-
get autoUpdate() { // @deprecated, r144
|
|
30649
|
-
|
|
30650
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
30651
|
-
return this.matrixWorldAutoUpdate;
|
|
30652
|
-
|
|
30653
|
-
}
|
|
30654
|
-
|
|
30655
|
-
set autoUpdate( value ) { // @deprecated, r144
|
|
30656
|
-
|
|
30657
|
-
console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
|
|
30658
|
-
this.matrixWorldAutoUpdate = value;
|
|
30659
|
-
|
|
30660
|
-
}
|
|
30661
|
-
|
|
30662
31031
|
}
|
|
30663
31032
|
|
|
30664
31033
|
class InterleavedBuffer {
|
|
@@ -31565,7 +31934,9 @@ const _vector3 = /*@__PURE__*/ new Vector3();
|
|
|
31565
31934
|
const _matrix4 = /*@__PURE__*/ new Matrix4();
|
|
31566
31935
|
const _vertex = /*@__PURE__*/ new Vector3();
|
|
31567
31936
|
|
|
31568
|
-
|
|
31937
|
+
const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
31938
|
+
const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
31939
|
+
const _ray$2 = /*@__PURE__*/ new Ray();
|
|
31569
31940
|
|
|
31570
31941
|
class SkinnedMesh extends Mesh {
|
|
31571
31942
|
|
|
@@ -31644,22 +32015,47 @@ class SkinnedMesh extends Mesh {
|
|
|
31644
32015
|
|
|
31645
32016
|
this.skeleton = source.skeleton;
|
|
31646
32017
|
|
|
32018
|
+
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
32019
|
+
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
32020
|
+
|
|
31647
32021
|
return this;
|
|
31648
32022
|
|
|
31649
32023
|
}
|
|
31650
32024
|
|
|
31651
|
-
|
|
32025
|
+
raycast( raycaster, intersects ) {
|
|
31652
32026
|
|
|
31653
|
-
|
|
32027
|
+
const material = this.material;
|
|
32028
|
+
const matrixWorld = this.matrixWorld;
|
|
32029
|
+
|
|
32030
|
+
if ( material === undefined ) return;
|
|
32031
|
+
|
|
32032
|
+
// test with bounding sphere in world space
|
|
32033
|
+
|
|
32034
|
+
if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
32035
|
+
|
|
32036
|
+
_sphere$3.copy( this.boundingSphere );
|
|
32037
|
+
_sphere$3.applyMatrix4( matrixWorld );
|
|
32038
|
+
|
|
32039
|
+
if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
|
|
32040
|
+
|
|
32041
|
+
// convert ray to local space of skinned mesh
|
|
31654
32042
|
|
|
31655
|
-
|
|
31656
|
-
|
|
32043
|
+
_inverseMatrix$2.copy( matrixWorld ).invert();
|
|
32044
|
+
_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
|
|
32045
|
+
|
|
32046
|
+
// test with bounding box in local space
|
|
32047
|
+
|
|
32048
|
+
if ( this.boundingBox !== null ) {
|
|
31657
32049
|
|
|
31658
|
-
|
|
32050
|
+
if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;
|
|
31659
32051
|
|
|
31660
|
-
|
|
32052
|
+
}
|
|
32053
|
+
|
|
32054
|
+
// test for intersections with geometry
|
|
31661
32055
|
|
|
31662
|
-
|
|
32056
|
+
this._computeIntersections( raycaster, intersects, _ray$2 );
|
|
32057
|
+
|
|
32058
|
+
}
|
|
31663
32059
|
|
|
31664
32060
|
getVertexPosition( index, target ) {
|
|
31665
32061
|
|
|
@@ -31834,8 +32230,6 @@ class Skeleton {
|
|
|
31834
32230
|
this.boneTexture = null;
|
|
31835
32231
|
this.boneTextureSize = 0;
|
|
31836
32232
|
|
|
31837
|
-
this.frame = - 1;
|
|
31838
|
-
|
|
31839
32233
|
this.init();
|
|
31840
32234
|
|
|
31841
32235
|
}
|
|
@@ -32060,7 +32454,7 @@ class Skeleton {
|
|
|
32060
32454
|
|
|
32061
32455
|
const data = {
|
|
32062
32456
|
metadata: {
|
|
32063
|
-
version: 4.
|
|
32457
|
+
version: 4.6,
|
|
32064
32458
|
type: 'Skeleton',
|
|
32065
32459
|
generator: 'Skeleton.toJSON'
|
|
32066
32460
|
},
|
|
@@ -32231,6 +32625,9 @@ class InstancedMesh extends Mesh {
|
|
|
32231
32625
|
|
|
32232
32626
|
this.count = source.count;
|
|
32233
32627
|
|
|
32628
|
+
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
32629
|
+
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
32630
|
+
|
|
32234
32631
|
return this;
|
|
32235
32632
|
|
|
32236
32633
|
}
|
|
@@ -32906,14 +33303,12 @@ class VideoTexture extends Texture {
|
|
|
32906
33303
|
|
|
32907
33304
|
class FramebufferTexture extends Texture {
|
|
32908
33305
|
|
|
32909
|
-
constructor( width, height
|
|
33306
|
+
constructor( width, height ) {
|
|
32910
33307
|
|
|
32911
33308
|
super( { width, height } );
|
|
32912
33309
|
|
|
32913
33310
|
this.isFramebufferTexture = true;
|
|
32914
33311
|
|
|
32915
|
-
this.format = format;
|
|
32916
|
-
|
|
32917
33312
|
this.magFilter = NearestFilter;
|
|
32918
33313
|
this.minFilter = NearestFilter;
|
|
32919
33314
|
|
|
@@ -33364,7 +33759,7 @@ class Curve {
|
|
|
33364
33759
|
|
|
33365
33760
|
const data = {
|
|
33366
33761
|
metadata: {
|
|
33367
|
-
version: 4.
|
|
33762
|
+
version: 4.6,
|
|
33368
33763
|
type: 'Curve',
|
|
33369
33764
|
generator: 'Curve.toJSON'
|
|
33370
33765
|
}
|
|
@@ -37006,6 +37401,7 @@ function addContour( vertices, contour ) {
|
|
|
37006
37401
|
* }
|
|
37007
37402
|
*/
|
|
37008
37403
|
|
|
37404
|
+
|
|
37009
37405
|
class ExtrudeGeometry extends BufferGeometry {
|
|
37010
37406
|
|
|
37011
37407
|
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 = {} ) {
|
|
@@ -39152,6 +39548,9 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39152
39548
|
|
|
39153
39549
|
this.type = 'MeshPhysicalMaterial';
|
|
39154
39550
|
|
|
39551
|
+
this.anisotropyRotation = 0;
|
|
39552
|
+
this.anisotropyMap = null;
|
|
39553
|
+
|
|
39155
39554
|
this.clearcoatMap = null;
|
|
39156
39555
|
this.clearcoatRoughness = 0.0;
|
|
39157
39556
|
this.clearcoatRoughnessMap = null;
|
|
@@ -39195,30 +39594,31 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39195
39594
|
this.specularColor = new Color( 1, 1, 1 );
|
|
39196
39595
|
this.specularColorMap = null;
|
|
39197
39596
|
|
|
39198
|
-
this.
|
|
39597
|
+
this._anisotropy = 0;
|
|
39199
39598
|
this._clearcoat = 0;
|
|
39200
39599
|
this._iridescence = 0;
|
|
39600
|
+
this._sheen = 0.0;
|
|
39201
39601
|
this._transmission = 0;
|
|
39202
39602
|
|
|
39203
39603
|
this.setValues( parameters );
|
|
39204
39604
|
|
|
39205
39605
|
}
|
|
39206
39606
|
|
|
39207
|
-
get
|
|
39607
|
+
get anisotropy() {
|
|
39208
39608
|
|
|
39209
|
-
return this.
|
|
39609
|
+
return this._anisotropy;
|
|
39210
39610
|
|
|
39211
39611
|
}
|
|
39212
39612
|
|
|
39213
|
-
set
|
|
39613
|
+
set anisotropy( value ) {
|
|
39214
39614
|
|
|
39215
|
-
if ( this.
|
|
39615
|
+
if ( this._anisotropy > 0 !== value > 0 ) {
|
|
39216
39616
|
|
|
39217
39617
|
this.version ++;
|
|
39218
39618
|
|
|
39219
39619
|
}
|
|
39220
39620
|
|
|
39221
|
-
this.
|
|
39621
|
+
this._anisotropy = value;
|
|
39222
39622
|
|
|
39223
39623
|
}
|
|
39224
39624
|
|
|
@@ -39258,6 +39658,24 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39258
39658
|
|
|
39259
39659
|
}
|
|
39260
39660
|
|
|
39661
|
+
get sheen() {
|
|
39662
|
+
|
|
39663
|
+
return this._sheen;
|
|
39664
|
+
|
|
39665
|
+
}
|
|
39666
|
+
|
|
39667
|
+
set sheen( value ) {
|
|
39668
|
+
|
|
39669
|
+
if ( this._sheen > 0 !== value > 0 ) {
|
|
39670
|
+
|
|
39671
|
+
this.version ++;
|
|
39672
|
+
|
|
39673
|
+
}
|
|
39674
|
+
|
|
39675
|
+
this._sheen = value;
|
|
39676
|
+
|
|
39677
|
+
}
|
|
39678
|
+
|
|
39261
39679
|
get transmission() {
|
|
39262
39680
|
|
|
39263
39681
|
return this._transmission;
|
|
@@ -39287,6 +39705,10 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39287
39705
|
|
|
39288
39706
|
};
|
|
39289
39707
|
|
|
39708
|
+
this.anisotropy = source.anisotropy;
|
|
39709
|
+
this.anisotropyRotation = source.anisotropyRotation;
|
|
39710
|
+
this.anisotropyMap = source.anisotropyMap;
|
|
39711
|
+
|
|
39290
39712
|
this.clearcoat = source.clearcoat;
|
|
39291
39713
|
this.clearcoatMap = source.clearcoatMap;
|
|
39292
39714
|
this.clearcoatRoughness = source.clearcoatRoughness;
|
|
@@ -41866,6 +42288,8 @@ class Loader {
|
|
|
41866
42288
|
|
|
41867
42289
|
}
|
|
41868
42290
|
|
|
42291
|
+
Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT';
|
|
42292
|
+
|
|
41869
42293
|
const loading = {};
|
|
41870
42294
|
|
|
41871
42295
|
class HttpError extends Error {
|
|
@@ -42428,6 +42852,7 @@ class CubeTextureLoader extends Loader {
|
|
|
42428
42852
|
load( urls, onLoad, onProgress, onError ) {
|
|
42429
42853
|
|
|
42430
42854
|
const texture = new CubeTexture();
|
|
42855
|
+
texture.colorSpace = SRGBColorSpace;
|
|
42431
42856
|
|
|
42432
42857
|
const loader = new ImageLoader( this.manager );
|
|
42433
42858
|
loader.setCrossOrigin( this.crossOrigin );
|
|
@@ -43571,6 +43996,8 @@ class MaterialLoader extends Loader {
|
|
|
43571
43996
|
if ( json.thickness !== undefined ) material.thickness = json.thickness;
|
|
43572
43997
|
if ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;
|
|
43573
43998
|
if ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );
|
|
43999
|
+
if ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;
|
|
44000
|
+
if ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;
|
|
43574
44001
|
if ( json.fog !== undefined ) material.fog = json.fog;
|
|
43575
44002
|
if ( json.flatShading !== undefined ) material.flatShading = json.flatShading;
|
|
43576
44003
|
if ( json.blending !== undefined ) material.blending = json.blending;
|
|
@@ -43580,6 +44007,7 @@ class MaterialLoader extends Loader {
|
|
|
43580
44007
|
if ( json.opacity !== undefined ) material.opacity = json.opacity;
|
|
43581
44008
|
if ( json.transparent !== undefined ) material.transparent = json.transparent;
|
|
43582
44009
|
if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;
|
|
44010
|
+
if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;
|
|
43583
44011
|
if ( json.depthTest !== undefined ) material.depthTest = json.depthTest;
|
|
43584
44012
|
if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;
|
|
43585
44013
|
if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;
|
|
@@ -43774,6 +44202,8 @@ class MaterialLoader extends Loader {
|
|
|
43774
44202
|
if ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );
|
|
43775
44203
|
if ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );
|
|
43776
44204
|
|
|
44205
|
+
if ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );
|
|
44206
|
+
|
|
43777
44207
|
if ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );
|
|
43778
44208
|
if ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );
|
|
43779
44209
|
|
|
@@ -44761,6 +45191,7 @@ class ObjectLoader extends Loader {
|
|
|
44761
45191
|
if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
|
|
44762
45192
|
if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
|
|
44763
45193
|
if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
|
|
45194
|
+
if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
|
|
44764
45195
|
|
|
44765
45196
|
if ( data.userData !== undefined ) texture.userData = data.userData;
|
|
44766
45197
|
|
|
@@ -46112,6 +46543,14 @@ class PositionalAudio extends Audio {
|
|
|
46112
46543
|
|
|
46113
46544
|
}
|
|
46114
46545
|
|
|
46546
|
+
connect() {
|
|
46547
|
+
|
|
46548
|
+
super.connect();
|
|
46549
|
+
|
|
46550
|
+
this.panner.connect( this.gain );
|
|
46551
|
+
|
|
46552
|
+
}
|
|
46553
|
+
|
|
46115
46554
|
disconnect() {
|
|
46116
46555
|
|
|
46117
46556
|
super.disconnect();
|
|
@@ -49457,6 +49896,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
|
|
|
49457
49896
|
* The azimuthal angle (theta) is measured from the positive z-axis.
|
|
49458
49897
|
*/
|
|
49459
49898
|
|
|
49899
|
+
|
|
49460
49900
|
class Spherical {
|
|
49461
49901
|
|
|
49462
49902
|
constructor( radius = 1, phi = 0, theta = 0 ) {
|
|
@@ -51407,216 +51847,6 @@ class ShapePath {
|
|
|
51407
51847
|
|
|
51408
51848
|
}
|
|
51409
51849
|
|
|
51410
|
-
class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144
|
|
51411
|
-
|
|
51412
|
-
constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {
|
|
51413
|
-
|
|
51414
|
-
console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' );
|
|
51415
|
-
super( width, height, depth, widthSegments, heightSegments, depthSegments );
|
|
51416
|
-
|
|
51417
|
-
|
|
51418
|
-
}
|
|
51419
|
-
|
|
51420
|
-
}
|
|
51421
|
-
|
|
51422
|
-
class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144
|
|
51423
|
-
|
|
51424
|
-
constructor( radius, length, capSegments, radialSegments ) {
|
|
51425
|
-
|
|
51426
|
-
console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' );
|
|
51427
|
-
super( radius, length, capSegments, radialSegments );
|
|
51428
|
-
|
|
51429
|
-
}
|
|
51430
|
-
|
|
51431
|
-
}
|
|
51432
|
-
|
|
51433
|
-
class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144
|
|
51434
|
-
|
|
51435
|
-
constructor( radius, segments, thetaStart, thetaLength ) {
|
|
51436
|
-
|
|
51437
|
-
console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' );
|
|
51438
|
-
super( radius, segments, thetaStart, thetaLength );
|
|
51439
|
-
|
|
51440
|
-
}
|
|
51441
|
-
|
|
51442
|
-
}
|
|
51443
|
-
|
|
51444
|
-
class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144
|
|
51445
|
-
|
|
51446
|
-
constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
51447
|
-
|
|
51448
|
-
console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' );
|
|
51449
|
-
super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
51450
|
-
|
|
51451
|
-
}
|
|
51452
|
-
|
|
51453
|
-
}
|
|
51454
|
-
|
|
51455
|
-
class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144
|
|
51456
|
-
|
|
51457
|
-
constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
|
|
51458
|
-
|
|
51459
|
-
console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' );
|
|
51460
|
-
super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
|
|
51461
|
-
|
|
51462
|
-
}
|
|
51463
|
-
|
|
51464
|
-
}
|
|
51465
|
-
|
|
51466
|
-
class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144
|
|
51467
|
-
|
|
51468
|
-
constructor( radius, detail ) {
|
|
51469
|
-
|
|
51470
|
-
console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' );
|
|
51471
|
-
super( radius, detail );
|
|
51472
|
-
|
|
51473
|
-
}
|
|
51474
|
-
|
|
51475
|
-
}
|
|
51476
|
-
|
|
51477
|
-
class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144
|
|
51478
|
-
|
|
51479
|
-
constructor( shapes, options ) {
|
|
51480
|
-
|
|
51481
|
-
console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' );
|
|
51482
|
-
super( shapes, options );
|
|
51483
|
-
|
|
51484
|
-
}
|
|
51485
|
-
|
|
51486
|
-
}
|
|
51487
|
-
|
|
51488
|
-
class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144
|
|
51489
|
-
|
|
51490
|
-
constructor( radius, detail ) {
|
|
51491
|
-
|
|
51492
|
-
console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' );
|
|
51493
|
-
super( radius, detail );
|
|
51494
|
-
|
|
51495
|
-
}
|
|
51496
|
-
|
|
51497
|
-
}
|
|
51498
|
-
|
|
51499
|
-
class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144
|
|
51500
|
-
|
|
51501
|
-
constructor( points, segments, phiStart, phiLength ) {
|
|
51502
|
-
|
|
51503
|
-
console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' );
|
|
51504
|
-
super( points, segments, phiStart, phiLength );
|
|
51505
|
-
|
|
51506
|
-
}
|
|
51507
|
-
|
|
51508
|
-
}
|
|
51509
|
-
|
|
51510
|
-
class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144
|
|
51511
|
-
|
|
51512
|
-
constructor( radius, detail ) {
|
|
51513
|
-
|
|
51514
|
-
console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' );
|
|
51515
|
-
super( radius, detail );
|
|
51516
|
-
|
|
51517
|
-
}
|
|
51518
|
-
|
|
51519
|
-
}
|
|
51520
|
-
|
|
51521
|
-
class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144
|
|
51522
|
-
|
|
51523
|
-
constructor( width, height, widthSegments, heightSegments ) {
|
|
51524
|
-
|
|
51525
|
-
console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' );
|
|
51526
|
-
super( width, height, widthSegments, heightSegments );
|
|
51527
|
-
|
|
51528
|
-
}
|
|
51529
|
-
|
|
51530
|
-
}
|
|
51531
|
-
|
|
51532
|
-
class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144
|
|
51533
|
-
|
|
51534
|
-
constructor( vertices, indices, radius, detail ) {
|
|
51535
|
-
|
|
51536
|
-
console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' );
|
|
51537
|
-
super( vertices, indices, radius, detail );
|
|
51538
|
-
|
|
51539
|
-
}
|
|
51540
|
-
|
|
51541
|
-
}
|
|
51542
|
-
|
|
51543
|
-
class RingBufferGeometry extends RingGeometry { // @deprecated, r144
|
|
51544
|
-
|
|
51545
|
-
constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {
|
|
51546
|
-
|
|
51547
|
-
console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' );
|
|
51548
|
-
super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength );
|
|
51549
|
-
|
|
51550
|
-
}
|
|
51551
|
-
|
|
51552
|
-
}
|
|
51553
|
-
|
|
51554
|
-
class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144
|
|
51555
|
-
|
|
51556
|
-
constructor( shapes, curveSegments ) {
|
|
51557
|
-
|
|
51558
|
-
console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' );
|
|
51559
|
-
super( shapes, curveSegments );
|
|
51560
|
-
|
|
51561
|
-
}
|
|
51562
|
-
|
|
51563
|
-
}
|
|
51564
|
-
|
|
51565
|
-
class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144
|
|
51566
|
-
|
|
51567
|
-
constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {
|
|
51568
|
-
|
|
51569
|
-
console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' );
|
|
51570
|
-
super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
|
|
51571
|
-
|
|
51572
|
-
}
|
|
51573
|
-
|
|
51574
|
-
}
|
|
51575
|
-
|
|
51576
|
-
class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144
|
|
51577
|
-
|
|
51578
|
-
constructor( radius, detail ) {
|
|
51579
|
-
|
|
51580
|
-
console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' );
|
|
51581
|
-
super( radius, detail );
|
|
51582
|
-
|
|
51583
|
-
}
|
|
51584
|
-
|
|
51585
|
-
}
|
|
51586
|
-
|
|
51587
|
-
class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144
|
|
51588
|
-
|
|
51589
|
-
constructor( radius, tube, radialSegments, tubularSegments, arc ) {
|
|
51590
|
-
|
|
51591
|
-
console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' );
|
|
51592
|
-
super( radius, tube, radialSegments, tubularSegments, arc );
|
|
51593
|
-
|
|
51594
|
-
}
|
|
51595
|
-
|
|
51596
|
-
}
|
|
51597
|
-
|
|
51598
|
-
class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144
|
|
51599
|
-
|
|
51600
|
-
constructor( radius, tube, tubularSegments, radialSegments, p, q ) {
|
|
51601
|
-
|
|
51602
|
-
console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' );
|
|
51603
|
-
super( radius, tube, tubularSegments, radialSegments, p, q );
|
|
51604
|
-
|
|
51605
|
-
}
|
|
51606
|
-
|
|
51607
|
-
}
|
|
51608
|
-
|
|
51609
|
-
class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144
|
|
51610
|
-
|
|
51611
|
-
constructor( path, tubularSegments, radius, radialSegments, closed ) {
|
|
51612
|
-
|
|
51613
|
-
console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' );
|
|
51614
|
-
super( path, tubularSegments, radius, radialSegments, closed );
|
|
51615
|
-
|
|
51616
|
-
}
|
|
51617
|
-
|
|
51618
|
-
}
|
|
51619
|
-
|
|
51620
51850
|
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
51621
51851
|
|
|
51622
51852
|
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
@@ -51639,4 +51869,4 @@ if ( typeof window !== 'undefined' ) {
|
|
|
51639
51869
|
|
|
51640
51870
|
}
|
|
51641
51871
|
|
|
51642
|
-
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper,
|
|
51872
|
+
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, TwoPassDoubleSide, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL1Renderer, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, sRGBEncoding };
|