super-three 0.179.0 → 0.181.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +1112 -595
- package/build/three.core.js +616 -345
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +492 -254
- 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 +6573 -2150
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +6572 -2149
- 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 +52 -43
- 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 +3 -2
- 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 +41 -27
- 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
|
|
|
@@ -53,8 +53,9 @@ import { WebGLUtils } from './webgl/WebGLUtils.js';
|
|
|
53
53
|
import { WebXRManager } from './webxr/WebXRManager.js';
|
|
54
54
|
import { WebGLMaterials } from './webgl/WebGLMaterials.js';
|
|
55
55
|
import { WebGLUniformsGroups } from './webgl/WebGLUniformsGroups.js';
|
|
56
|
-
import { createCanvasElement, probeAsync, warnOnce } from '../utils.js';
|
|
56
|
+
import { createCanvasElement, probeAsync, warnOnce, error, warn, log } from '../utils.js';
|
|
57
57
|
import { ColorManagement } from '../math/ColorManagement.js';
|
|
58
|
+
import { getDFGLUT } from './shaders/DFGLUTData.js';
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* This renderer uses WebGL 2 to display scenes.
|
|
@@ -112,6 +113,21 @@ class WebGLRenderer {
|
|
|
112
113
|
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
const INTEGER_FORMATS = new Set( [
|
|
117
|
+
RGBAIntegerFormat,
|
|
118
|
+
RGIntegerFormat,
|
|
119
|
+
RedIntegerFormat
|
|
120
|
+
] );
|
|
121
|
+
|
|
122
|
+
const UNSIGNED_TYPES = new Set( [
|
|
123
|
+
UnsignedByteType,
|
|
124
|
+
UnsignedIntType,
|
|
125
|
+
UnsignedShortType,
|
|
126
|
+
UnsignedInt248Type,
|
|
127
|
+
UnsignedShort4444Type,
|
|
128
|
+
UnsignedShort5551Type
|
|
129
|
+
] );
|
|
130
|
+
|
|
115
131
|
const uintClearColor = new Uint32Array( 4 );
|
|
116
132
|
const intClearColor = new Int32Array( 4 );
|
|
117
133
|
|
|
@@ -133,7 +149,7 @@ class WebGLRenderer {
|
|
|
133
149
|
* document.body.appendChild( renderer.domElement );
|
|
134
150
|
* ```
|
|
135
151
|
*
|
|
136
|
-
* @type {
|
|
152
|
+
* @type {HTMLCanvasElement|OffscreenCanvas}
|
|
137
153
|
*/
|
|
138
154
|
this.domElement = canvas;
|
|
139
155
|
|
|
@@ -386,7 +402,7 @@ class WebGLRenderer {
|
|
|
386
402
|
|
|
387
403
|
} catch ( error ) {
|
|
388
404
|
|
|
389
|
-
|
|
405
|
+
error( 'WebGLRenderer: ' + error.message );
|
|
390
406
|
throw error;
|
|
391
407
|
|
|
392
408
|
}
|
|
@@ -523,7 +539,7 @@ class WebGLRenderer {
|
|
|
523
539
|
|
|
524
540
|
// xr
|
|
525
541
|
|
|
526
|
-
const xr = new WebXRManager( _this, _gl );
|
|
542
|
+
const xr = new WebXRManager( _this, _gl, extensions, multiviewStereo );
|
|
527
543
|
|
|
528
544
|
/**
|
|
529
545
|
* A reference to the XR manager.
|
|
@@ -625,7 +641,7 @@ class WebGLRenderer {
|
|
|
625
641
|
|
|
626
642
|
if ( xr.isPresenting ) {
|
|
627
643
|
|
|
628
|
-
|
|
644
|
+
warn( 'WebGLRenderer: Can\'t change size while VR device is presenting.' );
|
|
629
645
|
return;
|
|
630
646
|
|
|
631
647
|
}
|
|
@@ -887,9 +903,7 @@ class WebGLRenderer {
|
|
|
887
903
|
if ( _currentRenderTarget !== null ) {
|
|
888
904
|
|
|
889
905
|
const targetFormat = _currentRenderTarget.texture.format;
|
|
890
|
-
isIntegerFormat = targetFormat
|
|
891
|
-
targetFormat === RGIntegerFormat ||
|
|
892
|
-
targetFormat === RedIntegerFormat;
|
|
906
|
+
isIntegerFormat = INTEGER_FORMATS.has( targetFormat );
|
|
893
907
|
|
|
894
908
|
}
|
|
895
909
|
|
|
@@ -898,12 +912,7 @@ class WebGLRenderer {
|
|
|
898
912
|
if ( isIntegerFormat ) {
|
|
899
913
|
|
|
900
914
|
const targetType = _currentRenderTarget.texture.type;
|
|
901
|
-
const isUnsignedType = targetType
|
|
902
|
-
targetType === UnsignedIntType ||
|
|
903
|
-
targetType === UnsignedShortType ||
|
|
904
|
-
targetType === UnsignedInt248Type ||
|
|
905
|
-
targetType === UnsignedShort4444Type ||
|
|
906
|
-
targetType === UnsignedShort5551Type;
|
|
915
|
+
const isUnsignedType = UNSIGNED_TYPES.has( targetType );
|
|
907
916
|
|
|
908
917
|
const clearColor = background.getClearColor();
|
|
909
918
|
const a = background.getClearAlpha();
|
|
@@ -1017,7 +1026,7 @@ class WebGLRenderer {
|
|
|
1017
1026
|
|
|
1018
1027
|
event.preventDefault();
|
|
1019
1028
|
|
|
1020
|
-
|
|
1029
|
+
log( 'WebGLRenderer: Context Lost.' );
|
|
1021
1030
|
|
|
1022
1031
|
_isContextLost = true;
|
|
1023
1032
|
|
|
@@ -1025,7 +1034,7 @@ class WebGLRenderer {
|
|
|
1025
1034
|
|
|
1026
1035
|
function onContextRestore( /* event */ ) {
|
|
1027
1036
|
|
|
1028
|
-
|
|
1037
|
+
log( 'WebGLRenderer: Context Restored.' );
|
|
1029
1038
|
|
|
1030
1039
|
_isContextLost = false;
|
|
1031
1040
|
|
|
@@ -1047,7 +1056,7 @@ class WebGLRenderer {
|
|
|
1047
1056
|
|
|
1048
1057
|
function onContextCreationError( event ) {
|
|
1049
1058
|
|
|
1050
|
-
|
|
1059
|
+
error( 'WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );
|
|
1051
1060
|
|
|
1052
1061
|
}
|
|
1053
1062
|
|
|
@@ -1220,7 +1229,7 @@ class WebGLRenderer {
|
|
|
1220
1229
|
if ( object._multiDrawInstances !== null ) {
|
|
1221
1230
|
|
|
1222
1231
|
// @deprecated, r174
|
|
1223
|
-
warnOnce( '
|
|
1232
|
+
warnOnce( 'WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
|
|
1224
1233
|
renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
|
|
1225
1234
|
|
|
1226
1235
|
} else {
|
|
@@ -1496,6 +1505,13 @@ class WebGLRenderer {
|
|
|
1496
1505
|
|
|
1497
1506
|
if ( typeof self !== 'undefined' ) animation.setContext( self );
|
|
1498
1507
|
|
|
1508
|
+
/**
|
|
1509
|
+
* Applications are advised to always define the animation loop
|
|
1510
|
+
* with this method and not manually with `requestAnimationFrame()`
|
|
1511
|
+
* for best compatibility.
|
|
1512
|
+
*
|
|
1513
|
+
* @param {?onAnimationCallback} callback - The application's animation loop.
|
|
1514
|
+
*/
|
|
1499
1515
|
this.setAnimationLoop = function ( callback ) {
|
|
1500
1516
|
|
|
1501
1517
|
onAnimationFrameCallback = callback;
|
|
@@ -1528,7 +1544,7 @@ class WebGLRenderer {
|
|
|
1528
1544
|
|
|
1529
1545
|
if ( camera !== undefined && camera.isCamera !== true ) {
|
|
1530
1546
|
|
|
1531
|
-
|
|
1547
|
+
error( 'WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
|
|
1532
1548
|
return;
|
|
1533
1549
|
|
|
1534
1550
|
}
|
|
@@ -1686,6 +1702,8 @@ class WebGLRenderer {
|
|
|
1686
1702
|
|
|
1687
1703
|
if ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera );
|
|
1688
1704
|
|
|
1705
|
+
textures.runDeferredUploads();
|
|
1706
|
+
|
|
1689
1707
|
// _gl.finish();
|
|
1690
1708
|
|
|
1691
1709
|
bindingStates.resetDefaultState();
|
|
@@ -1836,9 +1854,7 @@ class WebGLRenderer {
|
|
|
1836
1854
|
|
|
1837
1855
|
function renderScene( currentRenderList, scene, camera, viewport ) {
|
|
1838
1856
|
|
|
1839
|
-
const opaqueObjects = currentRenderList
|
|
1840
|
-
const transmissiveObjects = currentRenderList.transmissive;
|
|
1841
|
-
const transparentObjects = currentRenderList.transparent;
|
|
1857
|
+
const { opaque: opaqueObjects, transmissive: transmissiveObjects, transparent: transparentObjects } = currentRenderList;
|
|
1842
1858
|
|
|
1843
1859
|
currentRenderState.setupLightsView( camera );
|
|
1844
1860
|
|
|
@@ -1943,10 +1959,7 @@ class WebGLRenderer {
|
|
|
1943
1959
|
|
|
1944
1960
|
const renderItem = transmissiveObjects[ i ];
|
|
1945
1961
|
|
|
1946
|
-
const object = renderItem
|
|
1947
|
-
const geometry = renderItem.geometry;
|
|
1948
|
-
const material = renderItem.material;
|
|
1949
|
-
const group = renderItem.group;
|
|
1962
|
+
const { object, geometry, material, group } = renderItem;
|
|
1950
1963
|
|
|
1951
1964
|
if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {
|
|
1952
1965
|
|
|
@@ -1993,9 +2006,7 @@ class WebGLRenderer {
|
|
|
1993
2006
|
|
|
1994
2007
|
const renderItem = renderList[ i ];
|
|
1995
2008
|
|
|
1996
|
-
const object = renderItem
|
|
1997
|
-
const geometry = renderItem.geometry;
|
|
1998
|
-
const group = renderItem.group;
|
|
2009
|
+
const { object, geometry, group } = renderItem;
|
|
1999
2010
|
let material = renderItem.material;
|
|
2000
2011
|
|
|
2001
2012
|
if ( material.allowOverride === true && overrideMaterial !== null ) {
|
|
@@ -2534,6 +2545,13 @@ class WebGLRenderer {
|
|
|
2534
2545
|
|
|
2535
2546
|
}
|
|
2536
2547
|
|
|
2548
|
+
// Set DFG LUT for physically-based materials
|
|
2549
|
+
if ( m_uniforms.dfgLUT !== undefined ) {
|
|
2550
|
+
|
|
2551
|
+
m_uniforms.dfgLUT.value = getDFGLUT();
|
|
2552
|
+
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2537
2555
|
if ( refreshMaterial ) {
|
|
2538
2556
|
|
|
2539
2557
|
p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
|
|
@@ -2707,7 +2725,7 @@ class WebGLRenderer {
|
|
|
2707
2725
|
const renderTargetProperties = properties.get( renderTarget );
|
|
2708
2726
|
|
|
2709
2727
|
renderTargetProperties.__autoAllocateDepthBuffer = renderTarget.resolveDepthBuffer === false;
|
|
2710
|
-
if ( ! renderTargetProperties.__autoAllocateDepthBuffer
|
|
2728
|
+
if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {
|
|
2711
2729
|
|
|
2712
2730
|
// The multisample_render_to_texture extension doesn't work properly if there
|
|
2713
2731
|
// are midframe flushes and an external depth buffer. Disable use of the extension.
|
|
@@ -2922,7 +2940,7 @@ class WebGLRenderer {
|
|
|
2922
2940
|
|
|
2923
2941
|
if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {
|
|
2924
2942
|
|
|
2925
|
-
|
|
2943
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );
|
|
2926
2944
|
return;
|
|
2927
2945
|
|
|
2928
2946
|
}
|
|
@@ -2947,14 +2965,14 @@ class WebGLRenderer {
|
|
|
2947
2965
|
|
|
2948
2966
|
if ( ! capabilities.textureFormatReadable( textureFormat ) ) {
|
|
2949
2967
|
|
|
2950
|
-
|
|
2968
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
|
|
2951
2969
|
return;
|
|
2952
2970
|
|
|
2953
2971
|
}
|
|
2954
2972
|
|
|
2955
2973
|
if ( ! capabilities.textureTypeReadable( textureType ) ) {
|
|
2956
2974
|
|
|
2957
|
-
|
|
2975
|
+
error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
|
|
2958
2976
|
return;
|
|
2959
2977
|
|
|
2960
2978
|
}
|
|
@@ -3370,15 +3388,6 @@ class WebGLRenderer {
|
|
|
3370
3388
|
|
|
3371
3389
|
};
|
|
3372
3390
|
|
|
3373
|
-
this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
|
|
3374
|
-
|
|
3375
|
-
// @deprecated, r170
|
|
3376
|
-
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
|
|
3377
|
-
|
|
3378
|
-
return this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );
|
|
3379
|
-
|
|
3380
|
-
};
|
|
3381
|
-
|
|
3382
3391
|
/**
|
|
3383
3392
|
* Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data
|
|
3384
3393
|
* can be copied into it using {@link WebGLRenderer#copyTextureToTexture} before it has been
|
|
@@ -3495,7 +3504,7 @@ class WebGLRenderer {
|
|
|
3495
3504
|
* WebGLRenderer options.
|
|
3496
3505
|
*
|
|
3497
3506
|
* @typedef {Object} WebGLRenderer~Options
|
|
3498
|
-
* @property {
|
|
3507
|
+
* @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.
|
|
3499
3508
|
* @property {WebGL2RenderingContext} [context=null] - Can be used to attach an existing rendering context to this renderer.
|
|
3500
3509
|
* @property {('highp'|'mediump'|'lowp')} [precision='highp'] - The default shader precision. Uses `highp` if supported by the device.
|
|
3501
3510
|
* @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
|
|