super-three 0.164.0 → 0.167.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/README.md +3 -3
- package/build/three.cjs +1273 -503
- package/build/three.module.js +1269 -504
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +76086 -0
- package/build/three.webgpu.min.js +6 -0
- package/examples/jsm/Addons.js +2 -1
- package/examples/jsm/controls/TransformControls.js +1 -1
- package/examples/jsm/csm/CSMShader.js +4 -4
- package/examples/jsm/environments/RoomEnvironment.js +1 -5
- package/examples/jsm/exporters/GLTFExporter.js +8 -4
- package/examples/jsm/exporters/USDZExporter.js +6 -4
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/helpers/ViewHelper.js +75 -61
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +91 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +8 -63
- package/examples/jsm/lines/LineMaterial.js +1 -15
- package/examples/jsm/lines/LineSegments2.js +15 -0
- package/examples/jsm/lines/Wireframe.js +16 -1
- package/examples/jsm/lines/webgpu/Line2.js +20 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +376 -0
- package/examples/jsm/loaders/DRACOLoader.js +1 -1
- package/examples/jsm/loaders/FBXLoader.js +47 -58
- package/examples/jsm/loaders/GLTFLoader.js +12 -4
- package/examples/jsm/loaders/LDrawLoader.js +3 -2
- package/examples/jsm/loaders/MMDLoader.js +31 -12
- package/examples/jsm/loaders/MaterialXLoader.js +2 -9
- package/examples/jsm/loaders/USDZLoader.js +124 -76
- package/examples/jsm/loaders/UltraHDRLoader.js +583 -0
- package/examples/jsm/loaders/VTKLoader.js +76 -3
- package/examples/jsm/misc/GPUComputationRenderer.js +9 -19
- package/examples/jsm/modifiers/CurveModifier.js +11 -9
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -1
- package/examples/jsm/objects/InstancedPoints.js +2 -2
- package/examples/jsm/objects/Lensflare.js +2 -2
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- package/examples/jsm/postprocessing/RenderTransitionPass.js +13 -38
- package/examples/jsm/postprocessing/SSAOPass.js +6 -9
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- package/examples/jsm/renderers/CSS2DRenderer.js +25 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +24 -3
- package/examples/jsm/shaders/ColorifyShader.js +1 -2
- package/examples/jsm/shaders/FXAAShader.js +0 -2
- package/examples/jsm/shaders/GTAOShader.js +1 -1
- package/examples/jsm/shaders/LuminosityHighPassShader.js +1 -3
- package/examples/jsm/transpiler/GLSLDecoder.js +46 -4
- package/examples/jsm/transpiler/TSLEncoder.js +17 -15
- package/examples/jsm/utils/BufferGeometryUtils.js +18 -16
- package/examples/jsm/utils/GPUStatsPanel.js +2 -0
- package/examples/jsm/utils/SortUtils.js +8 -5
- package/package.json +9 -7
- package/src/Three.WebGPU.js +194 -0
- package/src/Three.js +2 -0
- package/src/animation/tracks/BooleanKeyframeTrack.js +10 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -2
- package/src/animation/tracks/StringKeyframeTrack.js +10 -1
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +24 -22
- package/src/core/Raycaster.js +6 -2
- package/src/extras/TextureUtils.js +210 -0
- package/src/lights/Light.js +1 -0
- package/src/lights/LightShadow.js +5 -0
- package/{examples/jsm/lights → src/lights/webgpu}/IESSpotLight.js +1 -1
- package/src/loaders/FileLoader.js +4 -0
- package/src/loaders/LoaderUtils.js +3 -1
- package/src/loaders/ObjectLoader.js +34 -2
- package/src/materials/Material.js +13 -4
- package/src/math/Box2.js +4 -4
- package/src/math/Box3.js +6 -6
- package/src/math/ColorManagement.js +10 -0
- package/src/math/Matrix2.js +54 -0
- package/src/math/Vector4.js +13 -0
- package/{examples/jsm → src}/nodes/Nodes.js +39 -20
- package/{examples/jsm → src}/nodes/accessors/BatchNode.js +28 -10
- package/src/nodes/accessors/BitangentNode.js +13 -0
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +36 -1
- package/{examples/jsm → src}/nodes/accessors/BufferNode.js +6 -0
- package/src/nodes/accessors/CameraNode.js +19 -0
- package/{examples/jsm → src}/nodes/accessors/CubeTextureNode.js +22 -5
- package/src/nodes/accessors/InstanceNode.js +140 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialNode.js +24 -2
- package/{examples/jsm → src}/nodes/accessors/ModelNode.js +4 -0
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +24 -20
- package/src/nodes/accessors/NormalNode.js +14 -0
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/PositionNode.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +7 -1
- package/src/nodes/accessors/ReflectVectorNode.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +50 -1
- package/{examples/jsm/nodes/accessors/TextureStoreNode.js → src/nodes/accessors/StorageTextureNode.js} +28 -6
- package/src/nodes/accessors/TangentNode.js +23 -0
- package/src/nodes/accessors/Texture3DNode.js +100 -0
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +55 -18
- package/src/nodes/accessors/UVNode.js +3 -0
- package/{examples/jsm → src}/nodes/accessors/UniformsNode.js +7 -1
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +2 -1
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +14 -0
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +2 -1
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +34 -8
- package/{examples/jsm → src}/nodes/core/CacheNode.js +7 -10
- package/{examples/jsm → src}/nodes/core/ContextNode.js +6 -0
- package/{examples/jsm → src}/nodes/core/IndexNode.js +6 -0
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +76 -0
- package/{examples/jsm → src}/nodes/core/Node.js +33 -14
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +194 -45
- package/src/nodes/core/NodeCache.js +36 -0
- package/{examples/jsm → src}/nodes/core/NodeFrame.js +42 -0
- package/{examples/jsm → src}/nodes/core/NodeFunction.js +2 -2
- package/{examples/jsm → src}/nodes/core/NodeKeywords.js +1 -1
- package/{examples/jsm → src}/nodes/core/NodeUniform.js +1 -2
- package/{examples/jsm → src}/nodes/core/NodeUtils.js +6 -1
- package/{examples/jsm → src}/nodes/core/OutputStructNode.js +1 -5
- package/{examples/jsm → src}/nodes/core/PropertyNode.js +2 -0
- package/{examples/jsm → src}/nodes/core/TempNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/UniformGroupNode.js +20 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +10 -1
- package/{examples/jsm → src}/nodes/core/VarNode.js +2 -6
- package/src/nodes/core/VaryingNode.js +104 -0
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +24 -20
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +18 -21
- package/src/nodes/display/BloomNode.js +333 -0
- package/{examples/jsm → src}/nodes/display/ColorAdjustmentNode.js +7 -2
- package/{examples/jsm → src}/nodes/display/ColorSpaceNode.js +1 -1
- package/src/nodes/display/DenoiseNode.js +198 -0
- package/src/nodes/display/DepthOfFieldNode.js +119 -0
- package/src/nodes/display/DotScreenNode.js +75 -0
- package/src/nodes/display/FXAANode.js +327 -0
- package/src/nodes/display/FilmNode.js +52 -0
- package/{examples/jsm → src}/nodes/display/FrontFacingNode.js +2 -1
- package/src/nodes/display/GTAONode.js +324 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +34 -17
- package/src/nodes/display/Lut3DNode.js +53 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +1 -1
- package/src/nodes/display/PassNode.js +291 -0
- package/src/nodes/display/PixelationPassNode.js +201 -0
- package/src/nodes/display/RGBShiftNode.js +49 -0
- package/src/nodes/display/RenderOutputNode.js +56 -0
- package/src/nodes/display/SobelOperatorNode.js +121 -0
- package/{examples/jsm → src}/nodes/display/ToneMappingNode.js +44 -5
- package/src/nodes/display/TransitionNode.js +76 -0
- package/{examples/jsm → src}/nodes/display/ViewportDepthNode.js +39 -16
- package/{examples/jsm → src}/nodes/display/ViewportDepthTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportNode.js +3 -2
- package/{examples/jsm → src}/nodes/display/ViewportSharedTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +5 -2
- package/src/nodes/functions/BSDF/LTC.js +131 -0
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +5 -3
- package/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.js +103 -18
- package/src/nodes/functions/ToonLightingModel.js +51 -0
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +19 -6
- package/{examples/jsm → src}/nodes/lighting/AONode.js +1 -4
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +1 -1
- package/src/nodes/lighting/AnalyticLightNode.js +333 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +26 -0
- package/src/nodes/lighting/BasicLightMapNode.js +29 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/lighting/EnvironmentNode.js +5 -4
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +2 -1
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +1 -1
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +2 -0
- package/{examples/jsm → src}/nodes/lighting/LightsNode.js +18 -3
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +2 -3
- package/src/nodes/lighting/RectAreaLightNode.js +97 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/loaders/NodeLoader.js +3 -1
- package/{examples/jsm → src}/nodes/loaders/NodeMaterialLoader.js +2 -1
- package/{examples/jsm → src}/nodes/loaders/NodeObjectLoader.js +2 -1
- package/{examples/jsm → src}/nodes/materials/InstancedPointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/Line2NodeMaterial.js +4 -4
- package/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineDashedNodeMaterial.js +4 -3
- package/{examples/jsm → src}/nodes/materials/Materials.js +3 -0
- package/src/nodes/materials/MeshBasicNodeMaterial.js +73 -0
- package/{examples/jsm → src}/nodes/materials/MeshLambertNodeMaterial.js +12 -3
- package/src/nodes/materials/MeshMatcapNodeMaterial.js +53 -0
- package/{examples/jsm → src}/nodes/materials/MeshNormalNodeMaterial.js +5 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhongNodeMaterial.js +11 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhysicalNodeMaterial.js +26 -8
- package/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.js +14 -3
- package/src/nodes/materials/MeshToonNodeMaterial.js +34 -0
- package/{examples/jsm → src}/nodes/materials/NodeMaterial.js +97 -24
- package/{examples/jsm → src}/nodes/materials/PointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/ShadowNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/SpriteNodeMaterial.js +3 -3
- package/src/nodes/materials/VolumeNodeMaterial.js +106 -0
- package/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +9 -17
- package/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +474 -577
- package/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +2 -8
- package/{examples/jsm → src}/nodes/math/CondNode.js +13 -6
- package/{examples/jsm → src}/nodes/math/HashNode.js +2 -2
- package/{examples/jsm → src}/nodes/math/MathNode.js +14 -1
- package/{examples/jsm → src}/nodes/math/OperatorNode.js +6 -6
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/{examples/jsm → src}/nodes/pmrem/PMREMNode.js +2 -1
- package/{examples/jsm → src}/nodes/shadernode/ShaderNode.js +57 -33
- package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +1 -1
- package/{examples/jsm → src}/nodes/utils/DiscardNode.js +1 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +2 -0
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +7 -6
- package/{examples/jsm → src}/nodes/utils/MatcapUVNode.js +1 -1
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +8 -2
- package/src/nodes/utils/RTTNode.js +130 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +9 -1
- package/{examples/jsm → src}/nodes/utils/TimerNode.js +1 -1
- package/src/objects/BatchedMesh.js +232 -162
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +312 -68
- package/{examples/jsm → src}/renderers/common/Attributes.js +4 -1
- package/{examples/jsm → src}/renderers/common/Backend.js +30 -27
- package/{examples/jsm → src}/renderers/common/Background.js +9 -3
- package/src/renderers/common/BindGroup.js +16 -0
- package/{examples/jsm → src}/renderers/common/Bindings.js +54 -22
- package/src/renderers/common/ChainMap.js +59 -0
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +8 -6
- package/{examples/jsm → src}/renderers/common/Color4.js +1 -1
- package/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +7 -1
- package/{examples/jsm → src}/renderers/common/Geometries.js +37 -5
- package/{examples/jsm → src}/renderers/common/Info.js +34 -6
- package/{examples/jsm → src}/renderers/common/Pipelines.js +2 -2
- package/src/renderers/common/PostProcessing.js +87 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +6 -3
- package/src/renderers/common/RenderBundle.js +18 -0
- package/src/renderers/common/RenderBundles.js +38 -0
- package/{examples/jsm → src}/renderers/common/RenderContext.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderList.js +9 -0
- package/{examples/jsm → src}/renderers/common/RenderObject.js +50 -11
- package/{examples/jsm → src}/renderers/common/Renderer.js +220 -40
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +2 -2
- package/{examples/jsm → src}/renderers/common/StorageBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageInstancedBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageTexture.js +2 -1
- package/{examples/jsm → src}/renderers/common/Textures.js +6 -2
- package/{examples/jsm → src}/renderers/common/Uniform.js +10 -5
- package/{examples/jsm → src}/renderers/common/UniformsGroup.js +69 -31
- package/{examples/jsm → src}/renderers/common/extras/PMREMGenerator.js +13 -12
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampledTexture.js +19 -4
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampler.js +8 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeStorageBuffer.js +5 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniform.js +3 -3
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformBuffer.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.js +2 -8
- package/{examples/jsm → src}/renderers/common/nodes/Nodes.js +37 -16
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +31 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -10
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +8 -22
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +10 -31
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +45 -13
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +3 -0
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +8 -0
- package/src/renderers/shaders/UniformsLib.js +3 -0
- package/src/renderers/webgl/WebGLAttributes.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +6 -0
- package/src/renderers/webgl/WebGLBufferRenderer.js +6 -19
- package/src/renderers/webgl/WebGLExtensions.js +3 -1
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +6 -18
- package/src/renderers/webgl/WebGLLights.js +15 -12
- package/src/renderers/webgl/WebGLMaterials.js +1 -5
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -2
- package/src/renderers/webgl/WebGLProgram.js +28 -31
- package/src/renderers/webgl/WebGLPrograms.js +15 -15
- package/src/renderers/webgl/WebGLRenderStates.js +2 -2
- package/src/renderers/webgl/WebGLTextures.js +100 -70
- package/src/renderers/webgl/WebGLUniforms.js +12 -2
- package/src/renderers/webgl/WebGLUniformsGroups.js +7 -7
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.js +156 -54
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +188 -41
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLAttributeUtils.js +2 -2
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLConstants.js +1 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLExtensions.js +2 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLState.js +1 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +126 -7
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +212 -78
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +2 -2
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +245 -49
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +159 -0
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUAttributeUtils.js +2 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUBindingUtils.js +30 -14
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +9 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +74 -24
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +101 -25
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +24 -3
- package/src/renderers/webxr/WebXRDepthSensing.js +9 -3
- package/src/renderers/webxr/WebXRManager.js +12 -2
- package/src/textures/CompressedArrayTexture.js +14 -0
- package/src/textures/DataArrayTexture.js +14 -0
- package/src/textures/DepthTexture.js +1 -3
- package/src/utils.js +30 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -119
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -106
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -104
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -109
- package/examples/jsm/nodes/accessors/UVNode.js +0 -47
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/core/VaryingNode.js +0 -65
- package/examples/jsm/nodes/display/PassNode.js +0 -199
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -255
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/examples/jsm/renderers/common/ChainMap.js +0 -89
- package/examples/jsm/renderers/common/PostProcessing.js +0 -33
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +0 -44
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- /package/{examples/jsm → src}/nodes/accessors/AccessorsUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/InstancedPointsMaterialNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/PointUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SceneNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SkinningNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureBicubicNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/CodeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/ExpressionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/AssignNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/BypassNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ConstNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/InputNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeAttribute.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeCode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeFunctionInput.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVar.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVarying.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ParameterNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StackNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StructTypeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/UniformGroup.js +0 -0
- /package/{examples/jsm → src}/nodes/core/constants.js +0 -0
- /package/{examples/jsm → src}/nodes/display/BlendModeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/BumpMapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/PosterizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogExp2Node.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogRangeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/ShadowMaskModel.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getGeometryRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/IrradianceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightingContextNode.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/MeshSSSNodeMaterial.js +0 -0
- /package/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
- /package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +0 -0
- /package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/math/TriNoise3D.js +0 -0
- /package/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/pmrem/PMREMUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/procedural/CheckerNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/ConvertNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/EquirectUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/JoinNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/OscNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/PackingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RemapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SetNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SplitNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Animation.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Binding.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Buffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/BufferUtils.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ComputePipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Constants.js +0 -0
- /package/{examples/jsm → src}/renderers/common/DataMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ProgrammableStage.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderLists.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderObjects.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderPipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Sampler.js +0 -0
- /package/{examples/jsm → src}/renderers/common/StorageBuffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/UniformBuffer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBufferRenderer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLCapabilities.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +0 -0
package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, FloatType, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, SRGBColorSpace, NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare } from '
|
|
1
|
+
import { LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, FloatType, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, SRGBColorSpace, NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare } from '../../../constants.js';
|
|
2
2
|
|
|
3
3
|
let initialized = false, wrappingToGL, filterToGL, compareToGL;
|
|
4
4
|
|
|
@@ -83,6 +83,10 @@ class WebGLTextureUtils {
|
|
|
83
83
|
|
|
84
84
|
glTextureType = gl.TEXTURE_2D_ARRAY;
|
|
85
85
|
|
|
86
|
+
} else if ( texture.isData3DTexture === true ) {
|
|
87
|
+
|
|
88
|
+
glTextureType = gl.TEXTURE_3D;
|
|
89
|
+
|
|
86
90
|
} else {
|
|
87
91
|
|
|
88
92
|
glTextureType = gl.TEXTURE_2D;
|
|
@@ -113,6 +117,11 @@ class WebGLTextureUtils {
|
|
|
113
117
|
if ( glType === gl.FLOAT ) internalFormat = gl.R32F;
|
|
114
118
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.R16F;
|
|
115
119
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.R8;
|
|
120
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.R16;
|
|
121
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.R32UI;
|
|
122
|
+
if ( glType === gl.BYTE ) internalFormat = gl.R8I;
|
|
123
|
+
if ( glType === gl.SHORT ) internalFormat = gl.R16I;
|
|
124
|
+
if ( glType === gl.INT ) internalFormat = gl.R32I;
|
|
116
125
|
|
|
117
126
|
}
|
|
118
127
|
|
|
@@ -132,6 +141,22 @@ class WebGLTextureUtils {
|
|
|
132
141
|
if ( glType === gl.FLOAT ) internalFormat = gl.RG32F;
|
|
133
142
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RG16F;
|
|
134
143
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RG8;
|
|
144
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RG16;
|
|
145
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RG32UI;
|
|
146
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RG8I;
|
|
147
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RG16I;
|
|
148
|
+
if ( glType === gl.INT ) internalFormat = gl.RG32I;
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if ( glFormat === gl.RG_INTEGER ) {
|
|
153
|
+
|
|
154
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RG8UI;
|
|
155
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RG16UI;
|
|
156
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RG32UI;
|
|
157
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RG8I;
|
|
158
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RG16I;
|
|
159
|
+
if ( glType === gl.INT ) internalFormat = gl.RG32I;
|
|
135
160
|
|
|
136
161
|
}
|
|
137
162
|
|
|
@@ -140,6 +165,12 @@ class WebGLTextureUtils {
|
|
|
140
165
|
if ( glType === gl.FLOAT ) internalFormat = gl.RGB32F;
|
|
141
166
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RGB16F;
|
|
142
167
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGB8;
|
|
168
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGB16;
|
|
169
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGB32UI;
|
|
170
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGB8I;
|
|
171
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGB16I;
|
|
172
|
+
if ( glType === gl.INT ) internalFormat = gl.RGB32I;
|
|
173
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = ( colorSpace === SRGBColorSpace && forceLinearTransfer === false ) ? gl.SRGB8 : gl.RGB8;
|
|
143
174
|
if ( glType === gl.UNSIGNED_SHORT_5_6_5 ) internalFormat = gl.RGB565;
|
|
144
175
|
if ( glType === gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl.RGB5_A1;
|
|
145
176
|
if ( glType === gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl.RGB4;
|
|
@@ -147,16 +178,44 @@ class WebGLTextureUtils {
|
|
|
147
178
|
|
|
148
179
|
}
|
|
149
180
|
|
|
181
|
+
if ( glFormat === gl.RGB_INTEGER ) {
|
|
182
|
+
|
|
183
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGB8UI;
|
|
184
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGB16UI;
|
|
185
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGB32UI;
|
|
186
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGB8I;
|
|
187
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGB16I;
|
|
188
|
+
if ( glType === gl.INT ) internalFormat = gl.RGB32I;
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
150
192
|
if ( glFormat === gl.RGBA ) {
|
|
151
193
|
|
|
152
194
|
if ( glType === gl.FLOAT ) internalFormat = gl.RGBA32F;
|
|
153
195
|
if ( glType === gl.HALF_FLOAT ) internalFormat = gl.RGBA16F;
|
|
196
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGBA8;
|
|
197
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGBA16;
|
|
198
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGBA32UI;
|
|
199
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGBA8I;
|
|
200
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGBA16I;
|
|
201
|
+
if ( glType === gl.INT ) internalFormat = gl.RGBA32I;
|
|
154
202
|
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = ( colorSpace === SRGBColorSpace && forceLinearTransfer === false ) ? gl.SRGB8_ALPHA8 : gl.RGBA8;
|
|
155
203
|
if ( glType === gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl.RGBA4;
|
|
156
204
|
if ( glType === gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl.RGB5_A1;
|
|
157
205
|
|
|
158
206
|
}
|
|
159
207
|
|
|
208
|
+
if ( glFormat === gl.RGBA_INTEGER ) {
|
|
209
|
+
|
|
210
|
+
if ( glType === gl.UNSIGNED_BYTE ) internalFormat = gl.RGBA8UI;
|
|
211
|
+
if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.RGBA16UI;
|
|
212
|
+
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.RGBA32UI;
|
|
213
|
+
if ( glType === gl.BYTE ) internalFormat = gl.RGBA8I;
|
|
214
|
+
if ( glType === gl.SHORT ) internalFormat = gl.RGBA16I;
|
|
215
|
+
if ( glType === gl.INT ) internalFormat = gl.RGBA32I;
|
|
216
|
+
|
|
217
|
+
}
|
|
218
|
+
|
|
160
219
|
if ( glFormat === gl.DEPTH_COMPONENT ) {
|
|
161
220
|
|
|
162
221
|
if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.DEPTH24_STENCIL8;
|
|
@@ -286,6 +345,10 @@ class WebGLTextureUtils {
|
|
|
286
345
|
|
|
287
346
|
gl.texStorage3D( gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, width, height, depth );
|
|
288
347
|
|
|
348
|
+
} else if ( texture.isData3DTexture ) {
|
|
349
|
+
|
|
350
|
+
gl.texStorage3D( gl.TEXTURE_3D, levels, glInternalFormat, width, height, depth );
|
|
351
|
+
|
|
289
352
|
} else if ( ! texture.isVideoTexture ) {
|
|
290
353
|
|
|
291
354
|
gl.texStorage2D( glTextureType, levels, glInternalFormat, width, height );
|
|
@@ -429,6 +492,12 @@ class WebGLTextureUtils {
|
|
|
429
492
|
|
|
430
493
|
gl.texSubImage3D( gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
|
|
431
494
|
|
|
495
|
+
} else if ( texture.isData3DTexture ) {
|
|
496
|
+
|
|
497
|
+
const image = options.image;
|
|
498
|
+
|
|
499
|
+
gl.texSubImage3D( gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
|
|
500
|
+
|
|
432
501
|
} else if ( texture.isVideoTexture ) {
|
|
433
502
|
|
|
434
503
|
texture.update();
|
|
@@ -524,41 +593,91 @@ class WebGLTextureUtils {
|
|
|
524
593
|
|
|
525
594
|
}
|
|
526
595
|
|
|
527
|
-
copyTextureToTexture(
|
|
596
|
+
copyTextureToTexture( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
|
|
528
597
|
|
|
529
598
|
const { gl, backend } = this;
|
|
530
599
|
const { state } = this.backend;
|
|
531
600
|
|
|
532
|
-
const width = srcTexture.image.width;
|
|
533
|
-
const height = srcTexture.image.height;
|
|
534
601
|
const { textureGPU: dstTextureGPU, glTextureType, glType, glFormat } = backend.get( dstTexture );
|
|
535
602
|
|
|
603
|
+
|
|
604
|
+
let width, height, minX, minY;
|
|
605
|
+
let dstX, dstY;
|
|
606
|
+
if ( srcRegion !== null ) {
|
|
607
|
+
|
|
608
|
+
width = srcRegion.max.x - srcRegion.min.x;
|
|
609
|
+
height = srcRegion.max.y - srcRegion.min.y;
|
|
610
|
+
minX = srcRegion.min.x;
|
|
611
|
+
minY = srcRegion.min.y;
|
|
612
|
+
|
|
613
|
+
} else {
|
|
614
|
+
|
|
615
|
+
width = srcTexture.image.width;
|
|
616
|
+
height = srcTexture.image.height;
|
|
617
|
+
minX = 0;
|
|
618
|
+
minY = 0;
|
|
619
|
+
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if ( dstPosition !== null ) {
|
|
623
|
+
|
|
624
|
+
dstX = dstPosition.x;
|
|
625
|
+
dstY = dstPosition.y;
|
|
626
|
+
|
|
627
|
+
} else {
|
|
628
|
+
|
|
629
|
+
dstX = 0;
|
|
630
|
+
dstY = 0;
|
|
631
|
+
|
|
632
|
+
}
|
|
633
|
+
|
|
536
634
|
state.bindTexture( glTextureType, dstTextureGPU );
|
|
537
635
|
|
|
538
636
|
// As another texture upload may have changed pixelStorei
|
|
539
637
|
// parameters, make sure they are correct for the dstTexture
|
|
638
|
+
gl.pixelStorei( gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
540
639
|
gl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );
|
|
541
640
|
gl.pixelStorei( gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );
|
|
542
641
|
gl.pixelStorei( gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );
|
|
543
642
|
|
|
643
|
+
const currentUnpackRowLen = gl.getParameter( gl.UNPACK_ROW_LENGTH );
|
|
644
|
+
const currentUnpackImageHeight = gl.getParameter( gl.UNPACK_IMAGE_HEIGHT );
|
|
645
|
+
const currentUnpackSkipPixels = gl.getParameter( gl.UNPACK_SKIP_PIXELS );
|
|
646
|
+
const currentUnpackSkipRows = gl.getParameter( gl.UNPACK_SKIP_ROWS );
|
|
647
|
+
const currentUnpackSkipImages = gl.getParameter( gl.UNPACK_SKIP_IMAGES );
|
|
648
|
+
|
|
649
|
+
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;
|
|
650
|
+
|
|
651
|
+
gl.pixelStorei( gl.UNPACK_ROW_LENGTH, image.width );
|
|
652
|
+
gl.pixelStorei( gl.UNPACK_IMAGE_HEIGHT, image.height );
|
|
653
|
+
gl.pixelStorei( gl.UNPACK_SKIP_PIXELS, minX );
|
|
654
|
+
gl.pixelStorei( gl.UNPACK_SKIP_ROWS, minY );
|
|
655
|
+
|
|
656
|
+
|
|
544
657
|
if ( srcTexture.isDataTexture ) {
|
|
545
658
|
|
|
546
|
-
gl.texSubImage2D( gl.TEXTURE_2D, level,
|
|
659
|
+
gl.texSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image.data );
|
|
547
660
|
|
|
548
661
|
} else {
|
|
549
662
|
|
|
550
663
|
if ( srcTexture.isCompressedTexture ) {
|
|
551
664
|
|
|
552
|
-
gl.compressedTexSubImage2D( gl.TEXTURE_2D, level,
|
|
665
|
+
gl.compressedTexSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data );
|
|
553
666
|
|
|
554
667
|
} else {
|
|
555
668
|
|
|
556
|
-
gl.texSubImage2D( gl.TEXTURE_2D, level,
|
|
669
|
+
gl.texSubImage2D( gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image );
|
|
557
670
|
|
|
558
671
|
}
|
|
559
672
|
|
|
560
673
|
}
|
|
561
674
|
|
|
675
|
+
gl.pixelStorei( gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );
|
|
676
|
+
gl.pixelStorei( gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );
|
|
677
|
+
gl.pixelStorei( gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );
|
|
678
|
+
gl.pixelStorei( gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );
|
|
679
|
+
gl.pixelStorei( gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );
|
|
680
|
+
|
|
562
681
|
// Generate mipmaps only when copying level 0
|
|
563
682
|
if ( level === 0 && dstTexture.generateMipmaps ) gl.generateMipmap( gl.TEXTURE_2D );
|
|
564
683
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, RGB_S3TC_DXT1_Format, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RedFormat, RGBFormat, RGBAFormat, AlphaFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, RGBA_BPTC_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, SRGBColorSpace, NoColorSpace } from '
|
|
1
|
+
import { RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, RGB_S3TC_DXT1_Format, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RedFormat, RGBFormat, RGBAFormat, AlphaFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, RGBA_BPTC_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, SRGBColorSpace, NoColorSpace } from '../../../constants.js';
|
|
2
2
|
|
|
3
3
|
class WebGLUtils {
|
|
4
4
|
|