@plastic-software/three 0.179.0 → 0.181.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 +1108 -591
- package/build/three.core.js +616 -345
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +488 -250
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +37 -6
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +6576 -2152
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +6575 -2151
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
- package/examples/jsm/Addons.js +1 -1
- package/examples/jsm/animation/CCDIKSolver.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +8 -8
- package/examples/jsm/controls/DragControls.js +7 -57
- package/examples/jsm/controls/FirstPersonControls.js +3 -3
- package/examples/jsm/controls/FlyControls.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +2 -2
- package/examples/jsm/controls/PointerLockControls.js +2 -10
- package/examples/jsm/controls/TrackballControls.js +1 -1
- package/examples/jsm/controls/TransformControls.js +1 -1
- package/examples/jsm/effects/AsciiEffect.js +8 -8
- package/examples/jsm/exporters/DRACOExporter.js +2 -2
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +33 -25
- package/examples/jsm/exporters/KTX2Exporter.js +4 -2
- package/examples/jsm/exporters/PLYExporter.js +1 -1
- package/examples/jsm/exporters/USDZExporter.js +9 -2
- package/examples/jsm/geometries/DecalGeometry.js +2 -2
- package/examples/jsm/geometries/ParametricGeometry.js +1 -1
- package/examples/jsm/geometries/TeapotGeometry.js +2 -2
- package/examples/jsm/geometries/TextGeometry.js +3 -2
- package/examples/jsm/gpgpu/BitonicSort.js +715 -0
- package/examples/jsm/helpers/ViewHelper.js +43 -5
- package/examples/jsm/inspector/Inspector.js +427 -0
- package/examples/jsm/inspector/RendererInspector.js +415 -0
- package/examples/jsm/inspector/tabs/Console.js +204 -0
- package/examples/jsm/inspector/tabs/Parameters.js +332 -0
- package/examples/jsm/inspector/tabs/Performance.js +268 -0
- package/examples/jsm/inspector/tabs/Viewer.js +166 -0
- package/examples/jsm/inspector/ui/Graph.js +95 -0
- package/examples/jsm/inspector/ui/Item.js +170 -0
- package/examples/jsm/inspector/ui/List.js +75 -0
- package/examples/jsm/inspector/ui/Profiler.js +170 -0
- package/examples/jsm/inspector/ui/Style.js +654 -0
- package/examples/jsm/inspector/ui/Tab.js +46 -0
- package/examples/jsm/inspector/ui/Values.js +423 -0
- package/examples/jsm/inspector/ui/utils.js +56 -0
- package/examples/jsm/interactive/HTMLMesh.js +6 -10
- package/examples/jsm/interactive/InteractiveGroup.js +1 -1
- package/examples/jsm/interactive/SelectionBox.js +30 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
- package/examples/jsm/lines/Line2.js +3 -3
- package/examples/jsm/lines/LineGeometry.js +1 -1
- package/examples/jsm/lines/LineSegments2.js +2 -2
- package/examples/jsm/lines/Wireframe.js +2 -2
- package/examples/jsm/lines/WireframeGeometry2.js +1 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
- package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +3 -3
- package/examples/jsm/loaders/DDSLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +73 -22
- package/examples/jsm/loaders/EXRLoader.js +5 -5
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/FontLoader.js +23 -5
- package/examples/jsm/loaders/GLTFLoader.js +14 -8
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
- package/examples/jsm/loaders/HDRLoader.js +486 -0
- package/examples/jsm/loaders/KTX2Loader.js +136 -49
- package/examples/jsm/loaders/KTXLoader.js +2 -2
- package/examples/jsm/loaders/LDrawLoader.js +1 -1
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +1 -1
- package/examples/jsm/loaders/LWOLoader.js +2 -2
- package/examples/jsm/loaders/MaterialXLoader.js +22 -5
- package/examples/jsm/loaders/OBJLoader.js +1 -1
- package/examples/jsm/loaders/PDBLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +7 -473
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TTFLoader.js +4 -4
- package/examples/jsm/loaders/UltraHDRLoader.js +2 -2
- package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/ColorSpaces.js +19 -1
- package/examples/jsm/math/ConvexHull.js +3 -3
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/math/Lut.js +2 -2
- package/examples/jsm/math/SimplexNoise.js +1 -1
- package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
- package/examples/jsm/misc/ProgressiveLightMap.js +9 -3
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +7 -1
- package/examples/jsm/misc/TubePainter.js +383 -40
- package/examples/jsm/misc/Volume.js +1 -1
- package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
- package/examples/jsm/objects/ReflectorForSSRPass.js +1 -0
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/SkyMesh.js +1 -1
- package/examples/jsm/objects/Water.js +3 -3
- package/examples/jsm/objects/WaterMesh.js +6 -6
- package/examples/jsm/postprocessing/GlitchPass.js +2 -2
- package/examples/jsm/postprocessing/OutlinePass.js +1 -1
- package/examples/jsm/postprocessing/SSRPass.js +37 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +8 -6
- package/examples/jsm/renderers/CSS2DRenderer.js +16 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +7 -6
- package/examples/jsm/renderers/SVGRenderer.js +1 -1
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +1 -1
- package/examples/jsm/shaders/AfterimageShader.js +1 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -1
- package/examples/jsm/shaders/BokehShader.js +1 -1
- package/examples/jsm/shaders/BokehShader2.js +1 -1
- package/examples/jsm/shaders/DotScreenShader.js +1 -1
- package/examples/jsm/shaders/FocusShader.js +1 -1
- package/examples/jsm/shaders/GTAOShader.js +2 -2
- package/examples/jsm/shaders/GodRaysShader.js +1 -1
- package/examples/jsm/shaders/KaleidoShader.js +1 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +2 -2
- package/examples/jsm/shaders/SSRShader.js +1 -1
- package/examples/jsm/shaders/SepiaShader.js +1 -1
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +1 -1
- package/examples/jsm/shaders/TriangleBlurShader.js +1 -1
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +1 -1
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +22 -19
- package/examples/jsm/transpiler/TSLEncoder.js +9 -10
- package/examples/jsm/transpiler/WGSLEncoder.js +24 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
- package/examples/jsm/tsl/display/AnamorphicNode.js +28 -4
- package/examples/jsm/tsl/display/BloomNode.js +7 -3
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +2 -1
- package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +446 -90
- package/examples/jsm/tsl/display/GTAONode.js +53 -5
- package/examples/jsm/tsl/display/GaussianBlurNode.js +49 -35
- package/examples/jsm/tsl/display/OutlineNode.js +13 -2
- package/examples/jsm/tsl/display/SSGINode.js +654 -0
- package/examples/jsm/tsl/display/SSRNode.js +182 -65
- package/examples/jsm/tsl/display/SSSNode.js +488 -0
- package/examples/jsm/tsl/display/TRAANode.js +124 -7
- package/examples/jsm/tsl/display/boxBlur.js +65 -0
- package/examples/jsm/tsl/display/hashBlur.js +16 -18
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +21 -1
- package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
- package/examples/jsm/webxr/OculusHandModel.js +1 -1
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/examples/jsm/webxr/XRHandModelFactory.js +2 -6
- package/package.json +5 -10
- package/src/Three.Core.js +4 -2
- package/src/Three.TSL.js +36 -5
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +2 -0
- package/src/animation/AnimationClip.js +20 -4
- package/src/animation/AnimationMixer.js +3 -3
- package/src/animation/AnimationObjectGroup.js +2 -1
- package/src/animation/KeyframeTrack.js +7 -6
- package/src/animation/PropertyBinding.js +12 -11
- package/src/audio/Audio.js +10 -9
- package/src/audio/PositionalAudio.js +1 -1
- package/src/cameras/OrthographicCamera.js +1 -1
- package/src/cameras/PerspectiveCamera.js +1 -1
- package/src/cameras/StereoCamera.js +2 -2
- package/src/constants.js +11 -3
- package/src/core/BufferGeometry.js +10 -10
- package/src/core/EventDispatcher.js +1 -1
- package/src/core/InterleavedBuffer.js +1 -1
- package/src/core/InterleavedBufferAttribute.js +3 -2
- package/src/core/Object3D.js +3 -2
- package/src/core/Raycaster.js +2 -1
- package/src/core/RenderTarget.js +10 -1
- package/src/extras/Controls.js +5 -4
- package/src/extras/DataUtils.js +2 -1
- package/src/extras/Earcut.js +6 -0
- package/src/extras/ImageUtils.js +2 -2
- package/src/extras/PMREMGenerator.js +268 -55
- package/src/extras/TextureUtils.js +2 -1
- package/src/extras/core/Curve.js +2 -1
- package/src/extras/core/Interpolations.js +7 -1
- package/src/extras/core/ShapePath.js +4 -4
- package/src/extras/lib/earcut.js +8 -8
- package/src/geometries/BoxGeometry.js +1 -0
- package/src/geometries/CapsuleGeometry.js +1 -0
- package/src/geometries/CircleGeometry.js +1 -0
- package/src/geometries/ConeGeometry.js +1 -0
- package/src/geometries/CylinderGeometry.js +1 -0
- package/src/geometries/DodecahedronGeometry.js +1 -0
- package/src/geometries/ExtrudeGeometry.js +8 -6
- package/src/geometries/IcosahedronGeometry.js +1 -0
- package/src/geometries/LatheGeometry.js +1 -0
- package/src/geometries/OctahedronGeometry.js +1 -0
- package/src/geometries/PlaneGeometry.js +1 -0
- package/src/geometries/RingGeometry.js +1 -0
- package/src/geometries/ShapeGeometry.js +1 -0
- package/src/geometries/SphereGeometry.js +1 -0
- package/src/geometries/TetrahedronGeometry.js +1 -0
- package/src/geometries/TorusGeometry.js +1 -0
- package/src/geometries/TorusKnotGeometry.js +1 -0
- package/src/geometries/TubeGeometry.js +1 -0
- package/src/helpers/CameraHelper.js +1 -1
- package/src/lights/webgpu/ProjectorLight.js +1 -1
- package/src/loaders/AnimationLoader.js +2 -1
- package/src/loaders/AudioLoader.js +2 -1
- package/src/loaders/BufferGeometryLoader.js +2 -2
- package/src/loaders/Cache.js +2 -2
- package/src/loaders/DataTextureLoader.js +1 -1
- package/src/loaders/FileLoader.js +3 -2
- package/src/loaders/ImageBitmapLoader.js +5 -4
- package/src/loaders/ImageLoader.js +1 -1
- package/src/loaders/Loader.js +3 -3
- package/src/loaders/LoadingManager.js +25 -3
- package/src/loaders/MaterialLoader.js +3 -2
- package/src/loaders/ObjectLoader.js +13 -13
- package/src/loaders/TextureLoader.js +1 -1
- package/src/loaders/nodes/NodeLoader.js +3 -2
- package/src/materials/Material.js +16 -3
- package/src/materials/MeshBasicMaterial.js +1 -0
- package/src/materials/MeshDepthMaterial.js +1 -0
- package/src/materials/MeshDistanceMaterial.js +1 -1
- package/src/materials/MeshLambertMaterial.js +2 -1
- package/src/materials/MeshMatcapMaterial.js +22 -0
- package/src/materials/MeshNormalMaterial.js +1 -0
- package/src/materials/MeshPhongMaterial.js +2 -1
- package/src/materials/MeshPhysicalMaterial.js +2 -1
- package/src/materials/MeshStandardMaterial.js +8 -7
- package/src/materials/MeshToonMaterial.js +1 -0
- package/src/materials/PointsMaterial.js +1 -1
- package/src/materials/ShaderMaterial.js +2 -2
- package/src/materials/nodes/Line2NodeMaterial.js +2 -2
- package/src/materials/nodes/MeshSSSNodeMaterial.js +1 -1
- package/src/materials/nodes/NodeMaterial.js +62 -22
- package/src/materials/nodes/PointsNodeMaterial.js +81 -28
- package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
- package/src/materials/nodes/manager/NodeMaterialObserver.js +3 -2
- package/src/math/Color.js +6 -5
- package/src/math/ColorManagement.js +9 -3
- package/src/math/Cylindrical.js +1 -1
- package/src/math/Euler.js +2 -1
- package/src/math/MathUtils.js +13 -11
- package/src/math/Matrix2.js +1 -1
- package/src/math/Matrix3.js +2 -2
- package/src/math/Matrix4.js +7 -7
- package/src/math/Plane.js +1 -1
- package/src/math/Quaternion.js +68 -66
- package/src/math/Spherical.js +1 -1
- package/src/nodes/Nodes.js +4 -1
- package/src/nodes/TSL.js +4 -1
- package/src/nodes/accessors/BufferNode.js +1 -1
- package/src/nodes/accessors/Camera.js +133 -7
- package/src/nodes/accessors/ClippingNode.js +6 -5
- package/src/nodes/accessors/CubeTextureNode.js +5 -4
- package/src/nodes/accessors/InstanceNode.js +25 -5
- package/src/nodes/accessors/Lights.js +10 -0
- package/src/nodes/accessors/Normal.js +5 -4
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/Position.js +18 -2
- package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
- package/src/nodes/accessors/ReferenceNode.js +3 -2
- package/src/nodes/accessors/SceneNode.js +2 -1
- package/src/nodes/accessors/StorageBufferNode.js +2 -1
- package/src/nodes/accessors/StorageTextureNode.js +22 -0
- package/src/nodes/accessors/Texture3DNode.js +14 -1
- package/src/nodes/accessors/TextureNode.js +130 -44
- package/src/nodes/code/FunctionCallNode.js +24 -4
- package/src/nodes/code/FunctionNode.js +23 -0
- package/src/nodes/core/ArrayNode.js +1 -0
- package/src/nodes/core/AssignNode.js +4 -3
- package/src/nodes/core/AttributeNode.js +2 -1
- package/src/nodes/core/ContextNode.js +29 -10
- package/src/nodes/core/IndexNode.js +2 -2
- package/src/nodes/core/InputNode.js +2 -1
- package/src/nodes/core/InspectorNode.js +128 -0
- package/src/nodes/core/{CacheNode.js → IsolateNode.js} +40 -7
- package/src/nodes/core/Node.js +152 -31
- package/src/nodes/core/NodeBuilder.js +183 -35
- package/src/nodes/core/NodeFrame.js +21 -21
- package/src/nodes/core/NodeFunction.js +2 -1
- package/src/nodes/core/NodeParser.js +2 -1
- package/src/nodes/core/NodeUniform.js +1 -1
- package/src/nodes/core/NodeUtils.js +17 -91
- package/src/nodes/core/ParameterNode.js +31 -0
- package/src/nodes/core/PropertyNode.js +7 -0
- package/src/nodes/core/StackNode.js +43 -16
- package/src/nodes/core/StructNode.js +5 -5
- package/src/nodes/core/StructTypeNode.js +1 -0
- package/src/nodes/core/SubBuildNode.js +2 -2
- package/src/nodes/core/UniformNode.js +18 -10
- package/src/nodes/core/VarNode.js +70 -33
- package/src/nodes/core/VaryingNode.js +3 -2
- package/src/nodes/display/BlendModes.js +5 -4
- package/src/nodes/display/BumpMapNode.js +1 -1
- package/src/nodes/display/ColorAdjustment.js +1 -1
- package/src/nodes/display/FrontFacingNode.js +4 -8
- package/src/nodes/display/NormalMapNode.js +2 -1
- package/src/nodes/display/PassNode.js +52 -11
- package/src/nodes/display/RenderOutputNode.js +28 -2
- package/src/nodes/display/ScreenNode.js +44 -14
- package/src/nodes/display/ToneMappingNode.js +31 -4
- package/src/nodes/display/ToonOutlinePassNode.js +8 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
- package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
- package/src/nodes/display/ViewportTextureNode.js +42 -12
- package/src/nodes/fog/Fog.js +3 -2
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
- package/src/nodes/functions/BSDF/DFGApprox.js +60 -19
- package/src/nodes/functions/BasicLightingModel.js +2 -1
- package/src/nodes/functions/PhysicalLightingModel.js +3 -2
- package/src/nodes/functions/VolumetricLightingModel.js +5 -5
- package/src/nodes/geometry/RangeNode.js +40 -4
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -1
- package/src/nodes/gpgpu/ComputeNode.js +17 -5
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -1
- package/src/nodes/lighting/EnvironmentNode.js +6 -6
- package/src/nodes/lighting/LightsNode.js +3 -4
- package/src/nodes/lighting/PointShadowNode.js +6 -0
- package/src/nodes/lighting/ShadowFilterNode.js +2 -0
- package/src/nodes/lighting/ShadowNode.js +75 -8
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/ConditionalNode.js +24 -7
- package/src/nodes/math/MathNode.js +25 -19
- package/src/nodes/math/OperatorNode.js +7 -5
- package/src/nodes/pmrem/PMREMUtils.js +117 -2
- package/src/nodes/shapes/Shapes.js +1 -1
- package/src/nodes/tsl/TSLBase.js +5 -2
- package/src/nodes/tsl/TSLCore.js +460 -159
- package/src/nodes/utils/DebugNode.js +2 -1
- package/src/nodes/utils/EventNode.js +36 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +37 -19
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +20 -24
- package/src/nodes/utils/MemberNode.js +59 -7
- package/src/nodes/utils/PostProcessingUtils.js +28 -1
- package/src/nodes/utils/RTTNode.js +13 -3
- package/src/nodes/utils/ReflectorNode.js +58 -7
- package/src/nodes/utils/SampleNode.js +12 -2
- package/src/nodes/utils/SplitNode.js +11 -0
- package/src/nodes/utils/Timer.js +0 -47
- package/src/objects/BatchedMesh.js +2 -2
- package/src/objects/LOD.js +1 -1
- package/src/objects/Line.js +2 -1
- package/src/objects/LineSegments.js +2 -1
- package/src/objects/Skeleton.js +3 -2
- package/src/objects/SkinnedMesh.js +3 -1
- package/src/objects/Sprite.js +4 -3
- package/src/renderers/WebGLRenderer.js +48 -41
- package/src/renderers/common/Animation.js +13 -1
- package/src/renderers/common/Attributes.js +1 -1
- package/src/renderers/common/Backend.js +108 -27
- package/src/renderers/common/Background.js +2 -1
- package/src/renderers/common/Bindings.js +58 -2
- package/src/renderers/common/CanvasTarget.js +341 -0
- package/src/renderers/common/ChainMap.js +1 -1
- package/src/renderers/common/DataMap.js +1 -1
- package/src/renderers/common/Geometries.js +26 -0
- package/src/renderers/common/Info.js +4 -2
- package/src/renderers/common/InspectorBase.js +146 -0
- package/src/renderers/common/Pipelines.js +1 -1
- package/src/renderers/common/PostProcessing.js +6 -25
- package/src/renderers/common/QuadMesh.js +7 -1
- package/src/renderers/common/RenderContext.js +2 -2
- package/src/renderers/common/RenderList.js +7 -3
- package/src/renderers/common/RenderObject.js +16 -2
- package/src/renderers/common/RenderObjects.js +1 -1
- package/src/renderers/common/Renderer.js +473 -245
- package/src/renderers/common/RendererUtils.js +9 -0
- package/src/renderers/common/SampledTexture.js +9 -1
- package/src/renderers/common/Sampler.js +50 -12
- package/src/renderers/common/StorageTexture.js +9 -1
- package/src/renderers/common/Textures.js +121 -45
- package/src/renderers/common/TimestampQueryPool.js +65 -3
- package/src/renderers/common/UniformsGroup.js +2 -1
- package/src/renderers/common/XRManager.js +42 -22
- package/src/renderers/common/extras/PMREMGenerator.js +160 -65
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeLibrary.js +9 -7
- package/src/renderers/common/nodes/NodeSampler.js +13 -1
- package/src/renderers/common/nodes/Nodes.js +38 -16
- package/src/renderers/shaders/DFGLUTData.js +64 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -18
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -15
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +1 -1
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/shaders/UniformsUtils.js +25 -4
- package/src/renderers/webgl/WebGLCapabilities.js +2 -1
- package/src/renderers/webgl/WebGLExtensions.js +2 -25
- package/src/renderers/webgl/WebGLInfo.js +3 -1
- package/src/renderers/webgl/WebGLProgram.js +15 -14
- package/src/renderers/webgl/WebGLPrograms.js +2 -1
- package/src/renderers/webgl/WebGLShadowMap.js +3 -2
- package/src/renderers/webgl/WebGLState.js +15 -14
- package/src/renderers/webgl/WebGLTextures.js +19 -14
- package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
- package/src/renderers/webgl/WebGLUtils.js +3 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +199 -167
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +181 -25
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
- package/src/renderers/webgl-fallback/utils/WebGLState.js +7 -6
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +169 -19
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +51 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
- package/src/renderers/webgpu/WebGPUBackend.js +153 -123
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
- package/src/renderers/webgpu/WebGPURenderer.js +3 -2
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +142 -50
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +2 -1
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +5 -3
- package/src/renderers/webgpu/utils/WebGPUConstants.js +7 -2
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +53 -34
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +260 -99
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +32 -9
- package/src/renderers/webgpu/utils/WebGPUUtils.js +22 -2
- package/src/renderers/webxr/WebXRManager.js +42 -26
- package/src/textures/ExternalTexture.js +15 -4
- package/src/textures/Source.js +3 -2
- package/src/textures/Texture.js +3 -2
- package/src/textures/VideoTexture.js +2 -3
- package/src/utils.js +67 -3
- package/examples/jsm/loaders/RGBMLoader.js +0 -1148
|
@@ -100,6 +100,17 @@ class SplitNode extends Node {
|
|
|
100
100
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Returns the scope of the node.
|
|
105
|
+
*
|
|
106
|
+
* @return {Node} The scope of the node.
|
|
107
|
+
*/
|
|
108
|
+
getScope() {
|
|
109
|
+
|
|
110
|
+
return this.node.getScope();
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
103
114
|
generate( builder, output ) {
|
|
104
115
|
|
|
105
116
|
const node = this.node;
|
package/src/nodes/utils/Timer.js
CHANGED
|
@@ -24,50 +24,3 @@ export const deltaTime = /*@__PURE__*/ uniform( 0 ).setGroup( renderGroup ).onRe
|
|
|
24
24
|
* @type {UniformNode<uint>}
|
|
25
25
|
*/
|
|
26
26
|
export const frameId = /*@__PURE__*/ uniform( 0, 'uint' ).setGroup( renderGroup ).onRenderUpdate( ( frame ) => frame.frameId );
|
|
27
|
-
|
|
28
|
-
// Deprecated
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @tsl
|
|
32
|
-
* @function
|
|
33
|
-
* @deprecated since r170. Use {@link time} instead.
|
|
34
|
-
*
|
|
35
|
-
* @param {number} [timeScale=1] - The time scale.
|
|
36
|
-
* @returns {UniformNode<float>}
|
|
37
|
-
*/
|
|
38
|
-
export const timerLocal = ( timeScale = 1 ) => { // @deprecated, r170
|
|
39
|
-
|
|
40
|
-
console.warn( 'TSL: timerLocal() is deprecated. Use "time" instead.' );
|
|
41
|
-
return time.mul( timeScale );
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @tsl
|
|
47
|
-
* @function
|
|
48
|
-
* @deprecated since r170. Use {@link time} instead.
|
|
49
|
-
*
|
|
50
|
-
* @param {number} [timeScale=1] - The time scale.
|
|
51
|
-
* @returns {UniformNode<float>}
|
|
52
|
-
*/
|
|
53
|
-
export const timerGlobal = ( timeScale = 1 ) => { // @deprecated, r170
|
|
54
|
-
|
|
55
|
-
console.warn( 'TSL: timerGlobal() is deprecated. Use "time" instead.' );
|
|
56
|
-
return time.mul( timeScale );
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @tsl
|
|
62
|
-
* @function
|
|
63
|
-
* @deprecated since r170. Use {@link deltaTime} instead.
|
|
64
|
-
*
|
|
65
|
-
* @param {number} [timeScale=1] - The time scale.
|
|
66
|
-
* @returns {UniformNode<float>}
|
|
67
|
-
*/
|
|
68
|
-
export const timerDelta = ( timeScale = 1 ) => { // @deprecated, r170
|
|
69
|
-
|
|
70
|
-
console.warn( 'TSL: timerDelta() is deprecated. Use "deltaTime" instead.' );
|
|
71
|
-
return deltaTime.mul( timeScale );
|
|
72
|
-
|
|
73
|
-
};
|
|
@@ -971,7 +971,7 @@ class BatchedMesh extends Mesh {
|
|
|
971
971
|
*
|
|
972
972
|
* @param {number} geometryId - The ID of the geometry to return the bounding box for.
|
|
973
973
|
* @param {Box3} target - The target object that is used to store the method's result.
|
|
974
|
-
* @return {Box3
|
|
974
|
+
* @return {?Box3} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
|
|
975
975
|
*/
|
|
976
976
|
getBoundingBoxAt( geometryId, target ) {
|
|
977
977
|
|
|
@@ -1016,7 +1016,7 @@ class BatchedMesh extends Mesh {
|
|
|
1016
1016
|
*
|
|
1017
1017
|
* @param {number} geometryId - The ID of the geometry to return the bounding sphere for.
|
|
1018
1018
|
* @param {Sphere} target - The target object that is used to store the method's result.
|
|
1019
|
-
* @return {Sphere
|
|
1019
|
+
* @return {?Sphere} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
|
|
1020
1020
|
*/
|
|
1021
1021
|
getBoundingSphereAt( geometryId, target ) {
|
|
1022
1022
|
|
package/src/objects/LOD.js
CHANGED
|
@@ -183,7 +183,7 @@ class LOD extends Object3D {
|
|
|
183
183
|
* the given distance.
|
|
184
184
|
*
|
|
185
185
|
* @param {number} distance - The LOD distance.
|
|
186
|
-
* @return {Object3D
|
|
186
|
+
* @return {?Object3D} The found 3D object. `null` if no 3D object has been found.
|
|
187
187
|
*/
|
|
188
188
|
getObjectForDistance( distance ) {
|
|
189
189
|
|
package/src/objects/Line.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Vector3 } from '../math/Vector3.js';
|
|
|
6
6
|
import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
|
|
7
7
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
8
8
|
import { Float32BufferAttribute } from '../core/BufferAttribute.js';
|
|
9
|
+
import { warn } from '../utils.js';
|
|
9
10
|
|
|
10
11
|
const _vStart = /*@__PURE__*/ new Vector3();
|
|
11
12
|
const _vEnd = /*@__PURE__*/ new Vector3();
|
|
@@ -142,7 +143,7 @@ class Line extends Object3D {
|
|
|
142
143
|
|
|
143
144
|
} else {
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
warn( 'Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
|
|
146
147
|
|
|
147
148
|
}
|
|
148
149
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Line } from './Line.js';
|
|
2
2
|
import { Vector3 } from '../math/Vector3.js';
|
|
3
3
|
import { Float32BufferAttribute } from '../core/BufferAttribute.js';
|
|
4
|
+
import { warn } from '../utils.js';
|
|
4
5
|
|
|
5
6
|
const _start = /*@__PURE__*/ new Vector3();
|
|
6
7
|
const _end = /*@__PURE__*/ new Vector3();
|
|
@@ -60,7 +61,7 @@ class LineSegments extends Line {
|
|
|
60
61
|
|
|
61
62
|
} else {
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
warn( 'LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
|
|
64
65
|
|
|
65
66
|
}
|
|
66
67
|
|
package/src/objects/Skeleton.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Bone } from './Bone.js';
|
|
|
6
6
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
7
7
|
import { DataTexture } from '../textures/DataTexture.js';
|
|
8
8
|
import { generateUUID } from '../math/MathUtils.js';
|
|
9
|
+
import { warn } from '../utils.js';
|
|
9
10
|
|
|
10
11
|
const _offsetMatrix = /*@__PURE__*/ new Matrix4();
|
|
11
12
|
const _identityMatrix = /*@__PURE__*/ new Matrix4();
|
|
@@ -106,7 +107,7 @@ class Skeleton {
|
|
|
106
107
|
|
|
107
108
|
if ( bones.length !== boneInverses.length ) {
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
warn( 'Skeleton: Number of inverse bone matrices does not match amount of bones.' );
|
|
110
111
|
|
|
111
112
|
this.boneInverses = [];
|
|
112
113
|
|
|
@@ -324,7 +325,7 @@ class Skeleton {
|
|
|
324
325
|
|
|
325
326
|
if ( bone === undefined ) {
|
|
326
327
|
|
|
327
|
-
|
|
328
|
+
warn( 'Skeleton: No bone found with UUID:', uuid );
|
|
328
329
|
bone = new Bone();
|
|
329
330
|
|
|
330
331
|
}
|
|
@@ -6,6 +6,7 @@ import { Vector3 } from '../math/Vector3.js';
|
|
|
6
6
|
import { Vector4 } from '../math/Vector4.js';
|
|
7
7
|
import { Ray } from '../math/Ray.js';
|
|
8
8
|
import { AttachedBindMode, DetachedBindMode } from '../constants.js';
|
|
9
|
+
import { warn } from '../utils.js';
|
|
9
10
|
|
|
10
11
|
const _basePosition = /*@__PURE__*/ new Vector3();
|
|
11
12
|
|
|
@@ -32,6 +33,7 @@ const _ray = /*@__PURE__*/ new Ray();
|
|
|
32
33
|
* or {@link FBXLoader } import respective models.
|
|
33
34
|
*
|
|
34
35
|
* @augments Mesh
|
|
36
|
+
* @demo scenes/bones-browser.html
|
|
35
37
|
*/
|
|
36
38
|
class SkinnedMesh extends Mesh {
|
|
37
39
|
|
|
@@ -299,7 +301,7 @@ class SkinnedMesh extends Mesh {
|
|
|
299
301
|
|
|
300
302
|
} else {
|
|
301
303
|
|
|
302
|
-
|
|
304
|
+
warn( 'SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );
|
|
303
305
|
|
|
304
306
|
}
|
|
305
307
|
|
package/src/objects/Sprite.js
CHANGED
|
@@ -7,6 +7,7 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
|
7
7
|
import { InterleavedBuffer } from '../core/InterleavedBuffer.js';
|
|
8
8
|
import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js';
|
|
9
9
|
import { SpriteMaterial } from '../materials/SpriteMaterial.js';
|
|
10
|
+
import { error } from '../utils.js';
|
|
10
11
|
|
|
11
12
|
let _geometry;
|
|
12
13
|
|
|
@@ -48,7 +49,7 @@ class Sprite extends Object3D {
|
|
|
48
49
|
/**
|
|
49
50
|
* Constructs a new sprite.
|
|
50
51
|
*
|
|
51
|
-
* @param {SpriteMaterial} [material] - The sprite material.
|
|
52
|
+
* @param {(SpriteMaterial|SpriteNodeMaterial)} [material] - The sprite material.
|
|
52
53
|
*/
|
|
53
54
|
constructor( material = new SpriteMaterial() ) {
|
|
54
55
|
|
|
@@ -94,7 +95,7 @@ class Sprite extends Object3D {
|
|
|
94
95
|
/**
|
|
95
96
|
* The sprite material.
|
|
96
97
|
*
|
|
97
|
-
* @type {SpriteMaterial}
|
|
98
|
+
* @type {(SpriteMaterial|SpriteNodeMaterial)}
|
|
98
99
|
*/
|
|
99
100
|
this.material = material;
|
|
100
101
|
|
|
@@ -129,7 +130,7 @@ class Sprite extends Object3D {
|
|
|
129
130
|
|
|
130
131
|
if ( raycaster.camera === null ) {
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
error( 'Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
|
|
133
134
|
|
|
134
135
|
}
|
|
135
136
|
|
|
@@ -52,8 +52,9 @@ import { WebGLUtils } from './webgl/WebGLUtils.js';
|
|
|
52
52
|
import { WebXRManager } from './webxr/WebXRManager.js';
|
|
53
53
|
import { WebGLMaterials } from './webgl/WebGLMaterials.js';
|
|
54
54
|
import { WebGLUniformsGroups } from './webgl/WebGLUniformsGroups.js';
|
|
55
|
-
import { createCanvasElement, probeAsync, warnOnce } from '../utils.js';
|
|
55
|
+
import { createCanvasElement, probeAsync, warnOnce, error, warn, log } from '../utils.js';
|
|
56
56
|
import { ColorManagement } from '../math/ColorManagement.js';
|
|
57
|
+
import { getDFGLUT } from './shaders/DFGLUTData.js';
|
|
57
58
|
|
|
58
59
|
/**
|
|
59
60
|
* This renderer uses WebGL 2 to display scenes.
|
|
@@ -110,6 +111,21 @@ class WebGLRenderer {
|
|
|
110
111
|
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
const INTEGER_FORMATS = new Set( [
|
|
115
|
+
RGBAIntegerFormat,
|
|
116
|
+
RGIntegerFormat,
|
|
117
|
+
RedIntegerFormat
|
|
118
|
+
] );
|
|
119
|
+
|
|
120
|
+
const UNSIGNED_TYPES = new Set( [
|
|
121
|
+
UnsignedByteType,
|
|
122
|
+
UnsignedIntType,
|
|
123
|
+
UnsignedShortType,
|
|
124
|
+
UnsignedInt248Type,
|
|
125
|
+
UnsignedShort4444Type,
|
|
126
|
+
UnsignedShort5551Type
|
|
127
|
+
] );
|
|
128
|
+
|
|
113
129
|
const uintClearColor = new Uint32Array( 4 );
|
|
114
130
|
const intClearColor = new Int32Array( 4 );
|
|
115
131
|
|
|
@@ -131,7 +147,7 @@ class WebGLRenderer {
|
|
|
131
147
|
* document.body.appendChild( renderer.domElement );
|
|
132
148
|
* ```
|
|
133
149
|
*
|
|
134
|
-
* @type {
|
|
150
|
+
* @type {HTMLCanvasElement|OffscreenCanvas}
|
|
135
151
|
*/
|
|
136
152
|
this.domElement = canvas;
|
|
137
153
|
|
|
@@ -384,7 +400,7 @@ class WebGLRenderer {
|
|
|
384
400
|
|
|
385
401
|
} catch ( error ) {
|
|
386
402
|
|
|
387
|
-
|
|
403
|
+
error( 'WebGLRenderer: ' + error.message );
|
|
388
404
|
throw error;
|
|
389
405
|
|
|
390
406
|
}
|
|
@@ -621,7 +637,7 @@ class WebGLRenderer {
|
|
|
621
637
|
|
|
622
638
|
if ( xr.isPresenting ) {
|
|
623
639
|
|
|
624
|
-
|
|
640
|
+
warn( 'WebGLRenderer: Can\'t change size while VR device is presenting.' );
|
|
625
641
|
return;
|
|
626
642
|
|
|
627
643
|
}
|
|
@@ -883,9 +899,7 @@ class WebGLRenderer {
|
|
|
883
899
|
if ( _currentRenderTarget !== null ) {
|
|
884
900
|
|
|
885
901
|
const targetFormat = _currentRenderTarget.texture.format;
|
|
886
|
-
isIntegerFormat = targetFormat
|
|
887
|
-
targetFormat === RGIntegerFormat ||
|
|
888
|
-
targetFormat === RedIntegerFormat;
|
|
902
|
+
isIntegerFormat = INTEGER_FORMATS.has( targetFormat );
|
|
889
903
|
|
|
890
904
|
}
|
|
891
905
|
|
|
@@ -894,12 +908,7 @@ class WebGLRenderer {
|
|
|
894
908
|
if ( isIntegerFormat ) {
|
|
895
909
|
|
|
896
910
|
const targetType = _currentRenderTarget.texture.type;
|
|
897
|
-
const isUnsignedType = targetType
|
|
898
|
-
targetType === UnsignedIntType ||
|
|
899
|
-
targetType === UnsignedShortType ||
|
|
900
|
-
targetType === UnsignedInt248Type ||
|
|
901
|
-
targetType === UnsignedShort4444Type ||
|
|
902
|
-
targetType === UnsignedShort5551Type;
|
|
911
|
+
const isUnsignedType = UNSIGNED_TYPES.has( targetType );
|
|
903
912
|
|
|
904
913
|
const clearColor = background.getClearColor();
|
|
905
914
|
const a = background.getClearAlpha();
|
|
@@ -1013,7 +1022,7 @@ class WebGLRenderer {
|
|
|
1013
1022
|
|
|
1014
1023
|
event.preventDefault();
|
|
1015
1024
|
|
|
1016
|
-
|
|
1025
|
+
log( 'WebGLRenderer: Context Lost.' );
|
|
1017
1026
|
|
|
1018
1027
|
_isContextLost = true;
|
|
1019
1028
|
|
|
@@ -1021,7 +1030,7 @@ class WebGLRenderer {
|
|
|
1021
1030
|
|
|
1022
1031
|
function onContextRestore( /* event */ ) {
|
|
1023
1032
|
|
|
1024
|
-
|
|
1033
|
+
log( 'WebGLRenderer: Context Restored.' );
|
|
1025
1034
|
|
|
1026
1035
|
_isContextLost = false;
|
|
1027
1036
|
|
|
@@ -1043,7 +1052,7 @@ class WebGLRenderer {
|
|
|
1043
1052
|
|
|
1044
1053
|
function onContextCreationError( event ) {
|
|
1045
1054
|
|
|
1046
|
-
|
|
1055
|
+
error( 'WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );
|
|
1047
1056
|
|
|
1048
1057
|
}
|
|
1049
1058
|
|
|
@@ -1216,7 +1225,7 @@ class WebGLRenderer {
|
|
|
1216
1225
|
if ( object._multiDrawInstances !== null ) {
|
|
1217
1226
|
|
|
1218
1227
|
// @deprecated, r174
|
|
1219
|
-
warnOnce( '
|
|
1228
|
+
warnOnce( 'WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
|
|
1220
1229
|
renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
|
|
1221
1230
|
|
|
1222
1231
|
} else {
|
|
@@ -1492,6 +1501,13 @@ class WebGLRenderer {
|
|
|
1492
1501
|
|
|
1493
1502
|
if ( typeof self !== 'undefined' ) animation.setContext( self );
|
|
1494
1503
|
|
|
1504
|
+
/**
|
|
1505
|
+
* Applications are advised to always define the animation loop
|
|
1506
|
+
* with this method and not manually with `requestAnimationFrame()`
|
|
1507
|
+
* for best compatibility.
|
|
1508
|
+
*
|
|
1509
|
+
* @param {?onAnimationCallback} callback - The application's animation loop.
|
|
1510
|
+
*/
|
|
1495
1511
|
this.setAnimationLoop = function ( callback ) {
|
|
1496
1512
|
|
|
1497
1513
|
onAnimationFrameCallback = callback;
|
|
@@ -1524,7 +1540,7 @@ class WebGLRenderer {
|
|
|
1524
1540
|
|
|
1525
1541
|
if ( camera !== undefined && camera.isCamera !== true ) {
|
|
1526
1542
|
|
|
1527
|
-
|
|
1543
|
+
error( 'WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
|
|
1528
1544
|
return;
|
|
1529
1545
|
|
|
1530
1546
|
}
|
|
@@ -1822,9 +1838,7 @@ class WebGLRenderer {
|
|
|
1822
1838
|
|
|
1823
1839
|
function renderScene( currentRenderList, scene, camera, viewport ) {
|
|
1824
1840
|
|
|
1825
|
-
const opaqueObjects = currentRenderList
|
|
1826
|
-
const transmissiveObjects = currentRenderList.transmissive;
|
|
1827
|
-
const transparentObjects = currentRenderList.transparent;
|
|
1841
|
+
const { opaque: opaqueObjects, transmissive: transmissiveObjects, transparent: transparentObjects } = currentRenderList;
|
|
1828
1842
|
|
|
1829
1843
|
currentRenderState.setupLightsView( camera );
|
|
1830
1844
|
|
|
@@ -1929,10 +1943,7 @@ class WebGLRenderer {
|
|
|
1929
1943
|
|
|
1930
1944
|
const renderItem = transmissiveObjects[ i ];
|
|
1931
1945
|
|
|
1932
|
-
const object = renderItem
|
|
1933
|
-
const geometry = renderItem.geometry;
|
|
1934
|
-
const material = renderItem.material;
|
|
1935
|
-
const group = renderItem.group;
|
|
1946
|
+
const { object, geometry, material, group } = renderItem;
|
|
1936
1947
|
|
|
1937
1948
|
if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {
|
|
1938
1949
|
|
|
@@ -1979,9 +1990,7 @@ class WebGLRenderer {
|
|
|
1979
1990
|
|
|
1980
1991
|
const renderItem = renderList[ i ];
|
|
1981
1992
|
|
|
1982
|
-
const object = renderItem
|
|
1983
|
-
const geometry = renderItem.geometry;
|
|
1984
|
-
const group = renderItem.group;
|
|
1993
|
+
const { object, geometry, group } = renderItem;
|
|
1985
1994
|
let material = renderItem.material;
|
|
1986
1995
|
|
|
1987
1996
|
if ( material.allowOverride === true && overrideMaterial !== null ) {
|
|
@@ -2520,6 +2529,13 @@ class WebGLRenderer {
|
|
|
2520
2529
|
|
|
2521
2530
|
}
|
|
2522
2531
|
|
|
2532
|
+
// Set DFG LUT for physically-based materials
|
|
2533
|
+
if ( m_uniforms.dfgLUT !== undefined ) {
|
|
2534
|
+
|
|
2535
|
+
m_uniforms.dfgLUT.value = getDFGLUT();
|
|
2536
|
+
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2523
2539
|
if ( refreshMaterial ) {
|
|
2524
2540
|
|
|
2525
2541
|
p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
|
|
@@ -2866,7 +2882,7 @@ class WebGLRenderer {
|
|
|
2866
2882
|
|
|
2867
2883
|
if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {
|
|
2868
2884
|
|
|
2869
|
-
|
|
2885
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );
|
|
2870
2886
|
return;
|
|
2871
2887
|
|
|
2872
2888
|
}
|
|
@@ -2891,14 +2907,14 @@ class WebGLRenderer {
|
|
|
2891
2907
|
|
|
2892
2908
|
if ( ! capabilities.textureFormatReadable( textureFormat ) ) {
|
|
2893
2909
|
|
|
2894
|
-
|
|
2910
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
|
|
2895
2911
|
return;
|
|
2896
2912
|
|
|
2897
2913
|
}
|
|
2898
2914
|
|
|
2899
2915
|
if ( ! capabilities.textureTypeReadable( textureType ) ) {
|
|
2900
2916
|
|
|
2901
|
-
|
|
2917
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
|
|
2902
2918
|
return;
|
|
2903
2919
|
|
|
2904
2920
|
}
|
|
@@ -3314,15 +3330,6 @@ class WebGLRenderer {
|
|
|
3314
3330
|
|
|
3315
3331
|
};
|
|
3316
3332
|
|
|
3317
|
-
this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
|
|
3318
|
-
|
|
3319
|
-
// @deprecated, r170
|
|
3320
|
-
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
|
|
3321
|
-
|
|
3322
|
-
return this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );
|
|
3323
|
-
|
|
3324
|
-
};
|
|
3325
|
-
|
|
3326
3333
|
/**
|
|
3327
3334
|
* Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data
|
|
3328
3335
|
* can be copied into it using {@link WebGLRenderer#copyTextureToTexture} before it has been
|
|
@@ -3439,7 +3446,7 @@ class WebGLRenderer {
|
|
|
3439
3446
|
* WebGLRenderer options.
|
|
3440
3447
|
*
|
|
3441
3448
|
* @typedef {Object} WebGLRenderer~Options
|
|
3442
|
-
* @property {
|
|
3449
|
+
* @property {HTMLCanvasElement|OffscreenCanvas} [canvas=null] - A canvas element where the renderer draws its output. If not passed in here, a new canvas element will be created by the renderer.
|
|
3443
3450
|
* @property {WebGL2RenderingContext} [context=null] - Can be used to attach an existing rendering context to this renderer.
|
|
3444
3451
|
* @property {('highp'|'mediump'|'lowp')} [precision='highp'] - The default shader precision. Uses `highp` if supported by the device.
|
|
3445
3452
|
* @property {boolean} [alpha=false] - Controls the default clear alpha value. When set to`true`, the value is `0`. Otherwise it's `1`.
|
|
@@ -9,10 +9,18 @@ class Animation {
|
|
|
9
9
|
/**
|
|
10
10
|
* Constructs a new animation loop management component.
|
|
11
11
|
*
|
|
12
|
+
* @param {Renderer} renderer - A reference to the main renderer.
|
|
12
13
|
* @param {Nodes} nodes - Renderer component for managing nodes related logic.
|
|
13
14
|
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
14
15
|
*/
|
|
15
|
-
constructor( nodes, info ) {
|
|
16
|
+
constructor( renderer, nodes, info ) {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A reference to the main renderer.
|
|
20
|
+
*
|
|
21
|
+
* @type {Renderer}
|
|
22
|
+
*/
|
|
23
|
+
this.renderer = renderer;
|
|
16
24
|
|
|
17
25
|
/**
|
|
18
26
|
* Renderer component for managing nodes related logic.
|
|
@@ -70,8 +78,12 @@ class Animation {
|
|
|
70
78
|
|
|
71
79
|
this.info.frame = this.nodes.nodeFrame.frameId;
|
|
72
80
|
|
|
81
|
+
this.renderer._inspector.begin();
|
|
82
|
+
|
|
73
83
|
if ( this._animationLoop !== null ) this._animationLoop( time, xrFrame );
|
|
74
84
|
|
|
85
|
+
this.renderer._inspector.finish();
|
|
86
|
+
|
|
75
87
|
};
|
|
76
88
|
|
|
77
89
|
update();
|
|
@@ -33,7 +33,7 @@ class Attributes extends DataMap {
|
|
|
33
33
|
* Deletes the data for the given attribute.
|
|
34
34
|
*
|
|
35
35
|
* @param {BufferAttribute} attribute - The attribute.
|
|
36
|
-
* @return {Object
|
|
36
|
+
* @return {?Object} The deleted attribute data.
|
|
37
37
|
*/
|
|
38
38
|
delete( attribute ) {
|
|
39
39
|
|