@plastic-software/three 0.180.0 → 0.181.2
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 +944 -487
- package/build/three.core.js +506 -327
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +436 -164
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +8 -2
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +3753 -1177
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +3752 -1176
- 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/animation/CCDIKSolver.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +1 -1
- package/examples/jsm/controls/DragControls.js +1 -1
- package/examples/jsm/controls/FirstPersonControls.js +1 -1
- package/examples/jsm/controls/FlyControls.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +2 -2
- package/examples/jsm/controls/PointerLockControls.js +2 -2
- 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 +3 -3
- 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/lights/RectAreaLightTexturesLib.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +2 -2
- package/examples/jsm/loaders/DDSLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +73 -22
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/FontLoader.js +23 -5
- package/examples/jsm/loaders/GLTFLoader.js +5 -3
- package/examples/jsm/loaders/KTX2Loader.js +28 -21
- 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/SVGLoader.js +2 -2
- package/examples/jsm/loaders/UltraHDRLoader.js +1 -1
- package/examples/jsm/math/ConvexHull.js +1 -1
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/math/SimplexNoise.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/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/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/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/TSLEncoder.js +7 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
- package/examples/jsm/tsl/display/AnamorphicNode.js +2 -1
- package/examples/jsm/tsl/display/BloomNode.js +4 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +7 -0
- package/examples/jsm/tsl/display/GTAONode.js +45 -5
- package/examples/jsm/tsl/display/GaussianBlurNode.js +5 -3
- package/examples/jsm/tsl/display/OutlineNode.js +11 -0
- package/examples/jsm/tsl/display/SSGINode.js +654 -0
- package/examples/jsm/tsl/display/SSRNode.js +2 -0
- package/examples/jsm/tsl/display/SSSNode.js +488 -0
- package/examples/jsm/tsl/display/TRAANode.js +123 -6
- package/examples/jsm/tsl/display/boxBlur.js +1 -0
- package/examples/jsm/tsl/display/hashBlur.js +1 -0
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +21 -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 +3 -2
- package/src/Three.TSL.js +7 -1
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +2 -0
- package/src/animation/AnimationClip.js +3 -2
- 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 +1 -1
- package/src/core/BufferGeometry.js +8 -8
- 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/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 +7 -7
- 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/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 +4 -3
- package/src/materials/MeshBasicMaterial.js +1 -0
- package/src/materials/MeshDepthMaterial.js +1 -0
- 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/manager/NodeMaterialObserver.js +2 -1
- package/src/math/Color.js +6 -5
- package/src/math/ColorManagement.js +2 -2
- 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 +1 -1
- package/src/nodes/TSL.js +1 -1
- package/src/nodes/accessors/CubeTextureNode.js +3 -2
- package/src/nodes/accessors/InstanceNode.js +22 -4
- package/src/nodes/accessors/Lights.js +10 -0
- package/src/nodes/accessors/Normal.js +5 -4
- package/src/nodes/accessors/Position.js +18 -2
- package/src/nodes/accessors/ReferenceNode.js +2 -1
- 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 +1 -1
- package/src/nodes/accessors/TextureNode.js +61 -27
- package/src/nodes/code/FunctionCallNode.js +5 -4
- package/src/nodes/core/ArrayNode.js +1 -0
- package/src/nodes/core/AttributeNode.js +2 -1
- package/src/nodes/core/ContextNode.js +5 -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 +137 -12
- package/src/nodes/core/NodeBuilder.js +135 -21
- package/src/nodes/core/NodeFrame.js +20 -20
- package/src/nodes/core/NodeFunction.js +2 -1
- package/src/nodes/core/NodeParser.js +2 -1
- package/src/nodes/core/NodeUtils.js +17 -90
- package/src/nodes/core/ParameterNode.js +31 -0
- package/src/nodes/core/PropertyNode.js +7 -0
- package/src/nodes/core/StackNode.js +16 -14
- package/src/nodes/core/UniformNode.js +2 -1
- package/src/nodes/core/VarNode.js +70 -12
- 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/NormalMapNode.js +2 -1
- package/src/nodes/display/PassNode.js +51 -10
- package/src/nodes/display/RenderOutputNode.js +28 -2
- package/src/nodes/display/ScreenNode.js +2 -1
- package/src/nodes/display/ToneMappingNode.js +31 -4
- package/src/nodes/display/ToonOutlinePassNode.js +8 -0
- 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 +25 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -1
- package/src/nodes/lighting/EnvironmentNode.js +6 -6
- package/src/nodes/lighting/LightsNode.js +2 -3
- 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/ConditionalNode.js +6 -5
- package/src/nodes/math/MathNode.js +22 -4
- package/src/nodes/math/OperatorNode.js +3 -2
- 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 +36 -15
- 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 +3 -2
- package/src/nodes/utils/LoopNode.js +20 -24
- package/src/nodes/utils/MemberNode.js +2 -1
- package/src/nodes/utils/PostProcessingUtils.js +28 -1
- package/src/nodes/utils/RTTNode.js +12 -2
- package/src/nodes/utils/ReflectorNode.js +10 -3
- 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 +2 -1
- package/src/renderers/WebGLRenderer.js +49 -33
- package/src/renderers/common/Animation.js +13 -1
- package/src/renderers/common/Backend.js +93 -30
- package/src/renderers/common/Background.js +2 -1
- package/src/renderers/common/Bindings.js +56 -2
- package/src/renderers/common/CanvasTarget.js +341 -0
- 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/PostProcessing.js +6 -25
- package/src/renderers/common/QuadMesh.js +7 -1
- package/src/renderers/common/RenderList.js +7 -3
- package/src/renderers/common/RenderObject.js +3 -1
- package/src/renderers/common/RenderObjects.js +1 -1
- package/src/renderers/common/Renderer.js +436 -228
- package/src/renderers/common/RendererUtils.js +9 -0
- package/src/renderers/common/SampledTexture.js +8 -0
- package/src/renderers/common/Sampler.js +37 -11
- package/src/renderers/common/StorageTexture.js +9 -1
- package/src/renderers/common/Textures.js +89 -35
- package/src/renderers/common/TimestampQueryPool.js +63 -1
- package/src/renderers/common/UniformsGroup.js +2 -1
- package/src/renderers/common/XRManager.js +7 -3
- package/src/renderers/common/extras/PMREMGenerator.js +160 -65
- package/src/renderers/common/nodes/NodeLibrary.js +4 -2
- 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/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 +11 -10
- package/src/renderers/webgl/WebGLPrograms.js +2 -1
- package/src/renderers/webgl/WebGLShadowMap.js +2 -1
- package/src/renderers/webgl/WebGLState.js +15 -14
- package/src/renderers/webgl/WebGLTextures.js +18 -14
- package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
- package/src/renderers/webgl-fallback/WebGLBackend.js +22 -41
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +74 -11
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
- package/src/renderers/webgl-fallback/utils/WebGLState.js +6 -5
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +117 -16
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +42 -12
- package/src/renderers/webgpu/WebGPUBackend.js +134 -108
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
- package/src/renderers/webgpu/WebGPURenderer.js +3 -2
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +21 -19
- 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 +5 -0
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +44 -16
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +146 -74
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +29 -6
- package/src/renderers/webgpu/utils/WebGPUUtils.js +22 -2
- package/src/renderers/webxr/WebXRManager.js +3 -2
- package/src/textures/Source.js +2 -1
- package/src/textures/Texture.js +3 -2
- package/src/textures/VideoTexture.js +2 -0
- package/src/utils.js +67 -3
|
@@ -5,6 +5,7 @@ import { Color } from '../../math/Color.js';
|
|
|
5
5
|
*
|
|
6
6
|
* If not state object is provided, the function creates one.
|
|
7
7
|
*
|
|
8
|
+
* @private
|
|
8
9
|
* @function
|
|
9
10
|
* @param {Renderer} renderer - The renderer.
|
|
10
11
|
* @param {Object} [state={}] - The state.
|
|
@@ -36,6 +37,7 @@ export function saveRendererState( renderer, state = {} ) {
|
|
|
36
37
|
*
|
|
37
38
|
* If not state object is provided, the function creates one.
|
|
38
39
|
*
|
|
40
|
+
* @private
|
|
39
41
|
* @function
|
|
40
42
|
* @param {Renderer} renderer - The renderer.
|
|
41
43
|
* @param {Object} [state={}] - The state.
|
|
@@ -57,6 +59,7 @@ export function resetRendererState( renderer, state ) {
|
|
|
57
59
|
/**
|
|
58
60
|
* Restores the state of the given renderer from the given state object.
|
|
59
61
|
*
|
|
62
|
+
* @private
|
|
60
63
|
* @function
|
|
61
64
|
* @param {Renderer} renderer - The renderer.
|
|
62
65
|
* @param {Object} state - The state to restore.
|
|
@@ -81,6 +84,7 @@ export function restoreRendererState( renderer, state ) {
|
|
|
81
84
|
*
|
|
82
85
|
* If not state object is provided, the function creates one.
|
|
83
86
|
*
|
|
87
|
+
* @private
|
|
84
88
|
* @function
|
|
85
89
|
* @param {Scene} scene - The scene.
|
|
86
90
|
* @param {Object} [state={}] - The state.
|
|
@@ -102,6 +106,7 @@ export function saveSceneState( scene, state = {} ) {
|
|
|
102
106
|
*
|
|
103
107
|
* If not state object is provided, the function creates one.
|
|
104
108
|
*
|
|
109
|
+
* @private
|
|
105
110
|
* @function
|
|
106
111
|
* @param {Scene} scene - The scene.
|
|
107
112
|
* @param {Object} [state={}] - The state.
|
|
@@ -122,6 +127,7 @@ export function resetSceneState( scene, state ) {
|
|
|
122
127
|
/**
|
|
123
128
|
* Restores the state of the given scene from the given state object.
|
|
124
129
|
*
|
|
130
|
+
* @private
|
|
125
131
|
* @function
|
|
126
132
|
* @param {Scene} scene - The scene.
|
|
127
133
|
* @param {Object} state - The state to restore.
|
|
@@ -139,6 +145,7 @@ export function restoreSceneState( scene, state ) {
|
|
|
139
145
|
*
|
|
140
146
|
* If not state object is provided, the function creates one.
|
|
141
147
|
*
|
|
148
|
+
* @private
|
|
142
149
|
* @function
|
|
143
150
|
* @param {Renderer} renderer - The renderer.
|
|
144
151
|
* @param {Scene} scene - The scene.
|
|
@@ -160,6 +167,7 @@ export function saveRendererAndSceneState( renderer, scene, state = {} ) {
|
|
|
160
167
|
*
|
|
161
168
|
* If not state object is provided, the function creates one.
|
|
162
169
|
*
|
|
170
|
+
* @private
|
|
163
171
|
* @function
|
|
164
172
|
* @param {Renderer} renderer - The renderer.
|
|
165
173
|
* @param {Scene} scene - The scene.
|
|
@@ -178,6 +186,7 @@ export function resetRendererAndSceneState( renderer, scene, state ) {
|
|
|
178
186
|
/**
|
|
179
187
|
* Restores the state of the given renderer and scene from the given state object.
|
|
180
188
|
*
|
|
189
|
+
* @private
|
|
181
190
|
* @function
|
|
182
191
|
* @param {Renderer} renderer - The renderer.
|
|
183
192
|
* @param {Scene} scene - The scene.
|
|
@@ -35,6 +35,14 @@ class SampledTexture extends Sampler {
|
|
|
35
35
|
*/
|
|
36
36
|
this.store = false;
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* The mip level to bind for storage textures.
|
|
40
|
+
*
|
|
41
|
+
* @type {number}
|
|
42
|
+
* @default 0
|
|
43
|
+
*/
|
|
44
|
+
this.mipLevel = 0;
|
|
45
|
+
|
|
38
46
|
/**
|
|
39
47
|
* This flag can be used for type testing.
|
|
40
48
|
*
|
|
@@ -21,8 +21,25 @@ class Sampler extends Binding {
|
|
|
21
21
|
/**
|
|
22
22
|
* The texture the sampler is referring to.
|
|
23
23
|
*
|
|
24
|
+
* @private
|
|
24
25
|
* @type {?Texture}
|
|
25
26
|
*/
|
|
27
|
+
this._texture = null;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An event listener which is added to {@link texture}'s dispose event.
|
|
31
|
+
*
|
|
32
|
+
* @private
|
|
33
|
+
* @type {Function}
|
|
34
|
+
*/
|
|
35
|
+
this._onTextureDispose = () => {
|
|
36
|
+
|
|
37
|
+
this.generation = null;
|
|
38
|
+
this.version = 0;
|
|
39
|
+
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Assignment to the texture via a setter must occur after "_onTextureDispose" is initialized.
|
|
26
43
|
this.texture = texture;
|
|
27
44
|
|
|
28
45
|
/**
|
|
@@ -41,6 +58,14 @@ class Sampler extends Binding {
|
|
|
41
58
|
*/
|
|
42
59
|
this.generation = null;
|
|
43
60
|
|
|
61
|
+
/**
|
|
62
|
+
* The binding's sampler key.
|
|
63
|
+
*
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @default ''
|
|
66
|
+
*/
|
|
67
|
+
this.samplerKey = '';
|
|
68
|
+
|
|
44
69
|
/**
|
|
45
70
|
* This flag can be used for type testing.
|
|
46
71
|
*
|
|
@@ -54,23 +79,16 @@ class Sampler extends Binding {
|
|
|
54
79
|
|
|
55
80
|
/**
|
|
56
81
|
* Sets the texture of this sampler.
|
|
57
|
-
*
|
|
82
|
+
*
|
|
83
|
+
* @param {Texture} value - The texture to set.
|
|
58
84
|
*/
|
|
59
85
|
set texture( value ) {
|
|
60
86
|
|
|
61
87
|
if ( this._texture === value ) return;
|
|
62
88
|
|
|
63
|
-
const onDispose = () => {
|
|
64
|
-
|
|
65
|
-
this._texture = null;
|
|
66
|
-
this.generation = null;
|
|
67
|
-
this.version = 0;
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
|
|
71
89
|
if ( this._texture ) {
|
|
72
90
|
|
|
73
|
-
this._texture.removeEventListener( 'dispose',
|
|
91
|
+
this._texture.removeEventListener( 'dispose', this._onTextureDispose );
|
|
74
92
|
|
|
75
93
|
}
|
|
76
94
|
|
|
@@ -81,7 +99,7 @@ class Sampler extends Binding {
|
|
|
81
99
|
|
|
82
100
|
if ( this._texture ) {
|
|
83
101
|
|
|
84
|
-
this._texture.addEventListener( 'dispose',
|
|
102
|
+
this._texture.addEventListener( 'dispose', this._onTextureDispose );
|
|
85
103
|
|
|
86
104
|
}
|
|
87
105
|
|
|
@@ -128,6 +146,14 @@ class Sampler extends Binding {
|
|
|
128
146
|
// TODO: Find better solution, see #31747
|
|
129
147
|
|
|
130
148
|
clonedSampler._texture = null;
|
|
149
|
+
|
|
150
|
+
clonedSampler._onTextureDispose = () => {
|
|
151
|
+
|
|
152
|
+
clonedSampler.generation = null;
|
|
153
|
+
clonedSampler.version = 0;
|
|
154
|
+
|
|
155
|
+
};
|
|
156
|
+
|
|
131
157
|
clonedSampler.texture = this.texture;
|
|
132
158
|
|
|
133
159
|
return clonedSampler;
|
|
@@ -52,8 +52,16 @@ class StorageTexture extends Texture {
|
|
|
52
52
|
*/
|
|
53
53
|
this.isStorageTexture = true;
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* When `true`, mipmaps will be auto-generated after compute writes.
|
|
57
|
+
* When `false`, mipmaps must be written manually via compute shaders.
|
|
58
|
+
*
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
this.mipmapsAutoUpdate = true;
|
|
56
63
|
|
|
64
|
+
}
|
|
57
65
|
/**
|
|
58
66
|
* Sets the size of the storage texture.
|
|
59
67
|
*
|
|
@@ -4,6 +4,7 @@ import { Vector3 } from '../../math/Vector3.js';
|
|
|
4
4
|
import { DepthTexture } from '../../textures/DepthTexture.js';
|
|
5
5
|
import { DepthStencilFormat, DepthFormat, UnsignedIntType, UnsignedInt248Type, UnsignedByteType, SRGBTransfer } from '../../constants.js';
|
|
6
6
|
import { ColorManagement } from '../../math/ColorManagement.js';
|
|
7
|
+
import { warn } from '../../utils.js';
|
|
7
8
|
|
|
8
9
|
const _size = /*@__PURE__*/ new Vector3();
|
|
9
10
|
|
|
@@ -84,6 +85,7 @@ class Textures extends DataMap {
|
|
|
84
85
|
depthTexture.image.width = mipWidth;
|
|
85
86
|
depthTexture.image.height = mipHeight;
|
|
86
87
|
depthTexture.image.depth = size.depth;
|
|
88
|
+
depthTexture.renderTarget = renderTarget;
|
|
87
89
|
depthTexture.isArrayTexture = renderTarget.multiview === true && size.depth > 1;
|
|
88
90
|
|
|
89
91
|
depthTextureMips[ activeMipmapLevel ] = depthTexture;
|
|
@@ -162,28 +164,13 @@ class Textures extends DataMap {
|
|
|
162
164
|
|
|
163
165
|
// dispose
|
|
164
166
|
|
|
165
|
-
|
|
167
|
+
renderTargetData.onDispose = () => {
|
|
166
168
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
for ( let i = 0; i < textures.length; i ++ ) {
|
|
170
|
-
|
|
171
|
-
this._destroyTexture( textures[ i ] );
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if ( depthTexture ) {
|
|
176
|
-
|
|
177
|
-
this._destroyTexture( depthTexture );
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
this.delete( renderTarget );
|
|
182
|
-
this.backend.delete( renderTarget );
|
|
169
|
+
this._destroyRenderTarget( renderTarget );
|
|
183
170
|
|
|
184
171
|
};
|
|
185
172
|
|
|
186
|
-
renderTarget.addEventListener( 'dispose', onDispose );
|
|
173
|
+
renderTarget.addEventListener( 'dispose', renderTargetData.onDispose );
|
|
187
174
|
|
|
188
175
|
}
|
|
189
176
|
|
|
@@ -209,7 +196,6 @@ class Textures extends DataMap {
|
|
|
209
196
|
|
|
210
197
|
// it's an update
|
|
211
198
|
|
|
212
|
-
backend.destroySampler( texture );
|
|
213
199
|
backend.destroyTexture( texture );
|
|
214
200
|
|
|
215
201
|
}
|
|
@@ -252,28 +238,23 @@ class Textures extends DataMap {
|
|
|
252
238
|
|
|
253
239
|
if ( isRenderTarget || texture.isStorageTexture === true || texture.isExternalTexture === true ) {
|
|
254
240
|
|
|
255
|
-
backend.createSampler( texture );
|
|
256
241
|
backend.createTexture( texture, options );
|
|
257
242
|
|
|
258
243
|
textureData.generation = texture.version;
|
|
259
244
|
|
|
260
245
|
} else {
|
|
261
246
|
|
|
262
|
-
const needsCreate = textureData.initialized !== true;
|
|
263
|
-
|
|
264
|
-
if ( needsCreate ) backend.createSampler( texture );
|
|
265
|
-
|
|
266
247
|
if ( texture.version > 0 ) {
|
|
267
248
|
|
|
268
249
|
const image = texture.image;
|
|
269
250
|
|
|
270
251
|
if ( image === undefined ) {
|
|
271
252
|
|
|
272
|
-
|
|
253
|
+
warn( 'Renderer: Texture marked for update but image is undefined.' );
|
|
273
254
|
|
|
274
255
|
} else if ( image.complete === false ) {
|
|
275
256
|
|
|
276
|
-
|
|
257
|
+
warn( 'Renderer: Texture marked for update but image is incomplete.' );
|
|
277
258
|
|
|
278
259
|
} else {
|
|
279
260
|
|
|
@@ -306,7 +287,13 @@ class Textures extends DataMap {
|
|
|
306
287
|
|
|
307
288
|
if ( texture.source.dataReady === true ) backend.updateTexture( texture, options );
|
|
308
289
|
|
|
309
|
-
|
|
290
|
+
const skipAutoGeneration = texture.isStorageTexture === true && texture.mipmapsAutoUpdate === false;
|
|
291
|
+
|
|
292
|
+
if ( options.needsMipmaps && texture.mipmaps.length === 0 && ! skipAutoGeneration ) {
|
|
293
|
+
|
|
294
|
+
backend.generateMipmaps( texture );
|
|
295
|
+
|
|
296
|
+
}
|
|
310
297
|
|
|
311
298
|
if ( texture.onUpdate ) texture.onUpdate( texture );
|
|
312
299
|
|
|
@@ -340,21 +327,19 @@ class Textures extends DataMap {
|
|
|
340
327
|
|
|
341
328
|
if ( texture.isVideoTexture && ColorManagement.getTransfer( texture.colorSpace ) !== SRGBTransfer ) {
|
|
342
329
|
|
|
343
|
-
|
|
330
|
+
warn( 'WebGPURenderer: Video textures must use a color space with a sRGB transfer function, e.g. SRGBColorSpace.' );
|
|
344
331
|
|
|
345
332
|
}
|
|
346
333
|
|
|
347
334
|
// dispose
|
|
348
335
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
texture.removeEventListener( 'dispose', onDispose );
|
|
336
|
+
textureData.onDispose = () => {
|
|
352
337
|
|
|
353
338
|
this._destroyTexture( texture );
|
|
354
339
|
|
|
355
340
|
};
|
|
356
341
|
|
|
357
|
-
texture.addEventListener( 'dispose', onDispose );
|
|
342
|
+
texture.addEventListener( 'dispose', textureData.onDispose );
|
|
358
343
|
|
|
359
344
|
}
|
|
360
345
|
|
|
@@ -364,6 +349,24 @@ class Textures extends DataMap {
|
|
|
364
349
|
|
|
365
350
|
}
|
|
366
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Updates the sampler for the given texture. This method has no effect
|
|
354
|
+
* for the WebGL backend since it has no concept of samplers. Texture
|
|
355
|
+
* parameters are configured with the `texParameter()` command for each
|
|
356
|
+
* texture.
|
|
357
|
+
*
|
|
358
|
+
* In WebGPU, samplers are objects like textures and it's possible to share
|
|
359
|
+
* them when the texture parameters match.
|
|
360
|
+
*
|
|
361
|
+
* @param {Texture} texture - The texture to update the sampler for.
|
|
362
|
+
* @return {string} The current sampler key.
|
|
363
|
+
*/
|
|
364
|
+
updateSampler( texture ) {
|
|
365
|
+
|
|
366
|
+
return this.backend.updateSampler( texture );
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
367
370
|
/**
|
|
368
371
|
* Computes the size of the given texture and writes the result
|
|
369
372
|
* into the target vector. This vector is also returned by the
|
|
@@ -390,7 +393,7 @@ class Textures extends DataMap {
|
|
|
390
393
|
target.height = image.videoHeight || 1;
|
|
391
394
|
target.depth = 1;
|
|
392
395
|
|
|
393
|
-
} else if ( image instanceof VideoFrame ) {
|
|
396
|
+
} else if ( ( typeof VideoFrame !== 'undefined' ) && ( image instanceof VideoFrame ) ) {
|
|
394
397
|
|
|
395
398
|
target.width = image.displayWidth || 1;
|
|
396
399
|
target.height = image.displayHeight || 1;
|
|
@@ -464,6 +467,46 @@ class Textures extends DataMap {
|
|
|
464
467
|
|
|
465
468
|
}
|
|
466
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Frees internal resources when the given render target isn't
|
|
472
|
+
* required anymore.
|
|
473
|
+
*
|
|
474
|
+
* @param {RenderTarget} renderTarget - The render target to destroy.
|
|
475
|
+
*/
|
|
476
|
+
_destroyRenderTarget( renderTarget ) {
|
|
477
|
+
|
|
478
|
+
if ( this.has( renderTarget ) === true ) {
|
|
479
|
+
|
|
480
|
+
const renderTargetData = this.get( renderTarget );
|
|
481
|
+
|
|
482
|
+
const textures = renderTargetData.textures;
|
|
483
|
+
const depthTexture = renderTargetData.depthTexture;
|
|
484
|
+
|
|
485
|
+
//
|
|
486
|
+
|
|
487
|
+
renderTarget.removeEventListener( 'dispose', renderTargetData.onDispose );
|
|
488
|
+
|
|
489
|
+
//
|
|
490
|
+
|
|
491
|
+
for ( let i = 0; i < textures.length; i ++ ) {
|
|
492
|
+
|
|
493
|
+
this._destroyTexture( textures[ i ] );
|
|
494
|
+
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if ( depthTexture ) {
|
|
498
|
+
|
|
499
|
+
this._destroyTexture( depthTexture );
|
|
500
|
+
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
this.delete( renderTarget );
|
|
504
|
+
this.backend.delete( renderTarget );
|
|
505
|
+
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
}
|
|
509
|
+
|
|
467
510
|
/**
|
|
468
511
|
* Frees internal resource when the given texture isn't
|
|
469
512
|
* required anymore.
|
|
@@ -474,8 +517,19 @@ class Textures extends DataMap {
|
|
|
474
517
|
|
|
475
518
|
if ( this.has( texture ) === true ) {
|
|
476
519
|
|
|
477
|
-
this.
|
|
478
|
-
|
|
520
|
+
const textureData = this.get( texture );
|
|
521
|
+
|
|
522
|
+
//
|
|
523
|
+
|
|
524
|
+
texture.removeEventListener( 'dispose', textureData.onDispose );
|
|
525
|
+
|
|
526
|
+
// if a texture is not ready for use, it falls back to a default texture so it's possible
|
|
527
|
+
// to use it for rendering. If a texture in this state is disposed, it's important to
|
|
528
|
+
// not destroy/delete the underlying GPU texture object since it is cached and shared with
|
|
529
|
+
// other textures.
|
|
530
|
+
|
|
531
|
+
const isDefaultTexture = textureData.isDefaultTexture;
|
|
532
|
+
this.backend.destroyTexture( texture, isDefaultTexture );
|
|
479
533
|
|
|
480
534
|
this.delete( texture );
|
|
481
535
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { warn } from '../../utils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Abstract base class of a timestamp query pool.
|
|
3
5
|
*
|
|
@@ -59,6 +61,13 @@ class TimestampQueryPool {
|
|
|
59
61
|
*/
|
|
60
62
|
this.lastValue = 0;
|
|
61
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Stores all timestamp frames.
|
|
66
|
+
*
|
|
67
|
+
* @type {Array<number>}
|
|
68
|
+
*/
|
|
69
|
+
this.frames = [];
|
|
70
|
+
|
|
62
71
|
/**
|
|
63
72
|
* TODO
|
|
64
73
|
*
|
|
@@ -67,6 +76,58 @@ class TimestampQueryPool {
|
|
|
67
76
|
*/
|
|
68
77
|
this.pendingResolve = false;
|
|
69
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Stores the latest timestamp for each render context.
|
|
81
|
+
*
|
|
82
|
+
* @type {Map<string, number>}
|
|
83
|
+
*/
|
|
84
|
+
this.timestamps = new Map();
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns all timestamp frames.
|
|
90
|
+
*
|
|
91
|
+
* @return {Array<number>} The timestamp frames.
|
|
92
|
+
*/
|
|
93
|
+
getTimestampFrames() {
|
|
94
|
+
|
|
95
|
+
return this.frames;
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Returns the timestamp for a given render context.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} uid - A unique identifier for the render context.
|
|
103
|
+
* @return {?number} The timestamp, or undefined if not available.
|
|
104
|
+
*/
|
|
105
|
+
getTimestamp( uid ) {
|
|
106
|
+
|
|
107
|
+
let timestamp = this.timestamps.get( uid );
|
|
108
|
+
|
|
109
|
+
if ( timestamp === undefined ) {
|
|
110
|
+
|
|
111
|
+
warn( `TimestampQueryPool: No timestamp available for uid ${ uid }.` );
|
|
112
|
+
|
|
113
|
+
timestamp = 0;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return timestamp;
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns whether a timestamp is available for a given render context.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} uid - A unique identifier for the render context.
|
|
125
|
+
* @return {boolean} True if a timestamp is available, false otherwise.
|
|
126
|
+
*/
|
|
127
|
+
hasTimestamp( uid ) {
|
|
128
|
+
|
|
129
|
+
return this.timestamps.has( uid );
|
|
130
|
+
|
|
70
131
|
}
|
|
71
132
|
|
|
72
133
|
/**
|
|
@@ -74,9 +135,10 @@ class TimestampQueryPool {
|
|
|
74
135
|
*
|
|
75
136
|
* @abstract
|
|
76
137
|
* @param {string} uid - A unique identifier for the render context.
|
|
138
|
+
* @param {number} frameId - The current frame identifier.
|
|
77
139
|
* @returns {?number}
|
|
78
140
|
*/
|
|
79
|
-
allocateQueriesForContext( /* uid */ ) {}
|
|
141
|
+
allocateQueriesForContext( /* uid, frameId */ ) {}
|
|
80
142
|
|
|
81
143
|
/**
|
|
82
144
|
* Resolve all timestamps and return data (or process them).
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import UniformBuffer from './UniformBuffer.js';
|
|
2
2
|
import { GPU_CHUNK_BYTES } from './Constants.js';
|
|
3
|
+
import { error } from '../../utils.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* This class represents a uniform buffer binding but with
|
|
@@ -208,7 +209,7 @@ class UniformsGroup extends UniformBuffer {
|
|
|
208
209
|
if ( uniform.isMatrix3Uniform ) return this.updateMatrix3( uniform );
|
|
209
210
|
if ( uniform.isMatrix4Uniform ) return this.updateMatrix4( uniform );
|
|
210
211
|
|
|
211
|
-
|
|
212
|
+
error( 'WebGPUUniformsGroup: Unsupported uniform type.', uniform );
|
|
212
213
|
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -16,6 +16,7 @@ import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
|
|
|
16
16
|
import { PlaneGeometry } from '../../geometries/PlaneGeometry.js';
|
|
17
17
|
import { MeshBasicMaterial } from '../../materials/MeshBasicMaterial.js';
|
|
18
18
|
import { Mesh } from '../../objects/Mesh.js';
|
|
19
|
+
import { warn } from '../../utils.js';
|
|
19
20
|
|
|
20
21
|
const _cameraLPos = /*@__PURE__*/ new Vector3();
|
|
21
22
|
const _cameraRPos = /*@__PURE__*/ new Vector3();
|
|
@@ -506,7 +507,7 @@ class XRManager extends EventDispatcher {
|
|
|
506
507
|
|
|
507
508
|
if ( this.isPresenting === true ) {
|
|
508
509
|
|
|
509
|
-
|
|
510
|
+
warn( 'XRManager: Cannot change framebuffer scale while presenting.' );
|
|
510
511
|
|
|
511
512
|
}
|
|
512
513
|
|
|
@@ -536,7 +537,7 @@ class XRManager extends EventDispatcher {
|
|
|
536
537
|
|
|
537
538
|
if ( this.isPresenting === true ) {
|
|
538
539
|
|
|
539
|
-
|
|
540
|
+
warn( 'XRManager: Cannot change reference space type while presenting.' );
|
|
540
541
|
|
|
541
542
|
}
|
|
542
543
|
|
|
@@ -1040,7 +1041,7 @@ class XRManager extends EventDispatcher {
|
|
|
1040
1041
|
// fallback to XRWebGLLayer
|
|
1041
1042
|
|
|
1042
1043
|
const layerInit = {
|
|
1043
|
-
antialias: renderer.
|
|
1044
|
+
antialias: renderer.currentSamples > 0,
|
|
1044
1045
|
alpha: true,
|
|
1045
1046
|
depth: renderer.depth,
|
|
1046
1047
|
stencil: renderer.stencil,
|
|
@@ -1380,6 +1381,9 @@ function onSessionEnd() {
|
|
|
1380
1381
|
|
|
1381
1382
|
this._session = null;
|
|
1382
1383
|
this._xrRenderTarget = null;
|
|
1384
|
+
this._glBinding = null;
|
|
1385
|
+
this._glBaseLayer = null;
|
|
1386
|
+
this._glProjLayer = null;
|
|
1383
1387
|
|
|
1384
1388
|
// switch layers back to emulated
|
|
1385
1389
|
if ( this._sessionUsesLayers === true ) {
|