@playdrop/playdrop-cli 0.3.5-build.1 → 0.3.8-build.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/config/client-meta.json +5 -5
- package/dist/apps/upload.js +1 -0
- package/dist/catalogue.d.ts +7 -0
- package/dist/catalogue.js +70 -33
- package/dist/commands/create.js +129 -70
- package/dist/commands/createRemixContent.d.ts +3 -0
- package/dist/commands/createRemixContent.js +310 -0
- package/dist/commands/generation.d.ts +0 -1
- package/dist/commands/generation.js +0 -18
- package/dist/commands/init.js +3 -3
- package/dist/commands/upload.js +11 -0
- package/dist/index.js +17 -4
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +8 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +2 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +3 -2
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +24 -2
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +3 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +19 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +3 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +19 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +3 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +9 -0
- package/node_modules/@playdrop/config/client-meta.json +5 -5
- package/node_modules/@playdrop/types/dist/api.d.ts +22 -1
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +1 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +27 -0
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.d.ts +21 -0
- package/node_modules/@playdrop/types/dist/graph.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.js +66 -0
- package/node_modules/@playdrop/types/dist/version.d.ts +1 -0
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -0
- package/node_modules/@playdrop/vox-three/dist/src/index.js +18 -0
- package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -0
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +25 -0
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +425 -0
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -0
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.d.ts +1 -0
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +79 -0
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -0
- package/node_modules/@playdrop/vox-three/package.json +25 -0
- package/node_modules/three/LICENSE +1 -1
- package/node_modules/three/README.md +7 -7
- package/node_modules/three/build/three.cjs +49655 -25499
- package/node_modules/three/build/three.core.js +58952 -0
- package/node_modules/three/build/three.core.min.js +6 -0
- package/node_modules/three/build/three.module.js +11162 -45962
- package/node_modules/three/build/three.module.min.js +2 -2
- package/node_modules/three/build/three.tsl.js +640 -0
- package/node_modules/three/build/three.tsl.min.js +6 -0
- package/node_modules/three/build/three.webgpu.js +79685 -0
- package/node_modules/three/build/three.webgpu.min.js +6 -0
- package/node_modules/three/build/three.webgpu.nodes.js +79456 -0
- package/node_modules/three/build/three.webgpu.nodes.min.js +6 -0
- package/node_modules/three/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/node_modules/three/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
- package/node_modules/three/examples/jsm/Addons.js +8 -18
- package/node_modules/three/examples/jsm/animation/AnimationClipCreator.js +59 -7
- package/node_modules/three/examples/jsm/animation/CCDIKSolver.js +154 -45
- package/node_modules/three/examples/jsm/capabilities/WebGL.js +28 -23
- package/node_modules/three/examples/jsm/capabilities/WebGPU.js +19 -17
- package/node_modules/three/examples/jsm/controls/ArcballControls.js +636 -324
- package/node_modules/three/examples/jsm/controls/DragControls.js +332 -101
- package/node_modules/three/examples/jsm/controls/FirstPersonControls.js +291 -169
- package/node_modules/three/examples/jsm/controls/FlyControls.js +245 -191
- package/node_modules/three/examples/jsm/controls/MapControls.js +43 -9
- package/node_modules/three/examples/jsm/controls/OrbitControls.js +1156 -802
- package/node_modules/three/examples/jsm/controls/PointerLockControls.js +137 -35
- package/node_modules/three/examples/jsm/controls/TrackballControls.js +629 -456
- package/node_modules/three/examples/jsm/controls/TransformControls.js +442 -97
- package/node_modules/three/examples/jsm/csm/CSM.js +230 -17
- package/node_modules/three/examples/jsm/csm/CSMFrustum.js +61 -4
- package/node_modules/three/examples/jsm/csm/CSMHelper.js +50 -0
- package/node_modules/three/examples/jsm/csm/CSMShader.js +17 -5
- package/node_modules/three/examples/jsm/csm/CSMShadowNode.js +599 -0
- package/node_modules/three/examples/jsm/curves/CurveExtras.js +303 -31
- package/node_modules/three/examples/jsm/curves/NURBSCurve.js +91 -16
- package/node_modules/three/examples/jsm/curves/NURBSSurface.js +52 -6
- package/node_modules/three/examples/jsm/curves/NURBSUtils.js +102 -112
- package/node_modules/three/examples/jsm/curves/NURBSVolume.js +24 -4
- package/node_modules/three/examples/jsm/effects/AnaglyphEffect.js +39 -14
- package/node_modules/three/examples/jsm/effects/AsciiEffect.js +69 -22
- package/node_modules/three/examples/jsm/effects/OutlineEffect.js +61 -111
- package/node_modules/three/examples/jsm/effects/ParallaxBarrierEffect.js +48 -12
- package/node_modules/three/examples/jsm/effects/StereoEffect.js +37 -1
- package/node_modules/three/examples/jsm/environments/DebugEnvironment.js +50 -0
- package/node_modules/three/examples/jsm/environments/RoomEnvironment.js +82 -48
- package/node_modules/three/examples/jsm/exporters/DRACOExporter.js +59 -15
- package/node_modules/three/examples/jsm/exporters/EXRExporter.js +58 -19
- package/node_modules/three/examples/jsm/exporters/GLTFExporter.js +460 -174
- package/node_modules/three/examples/jsm/exporters/KTX2Exporter.js +80 -25
- package/node_modules/three/examples/jsm/exporters/OBJExporter.js +25 -1
- package/node_modules/three/examples/jsm/exporters/PLYExporter.js +51 -17
- package/node_modules/three/examples/jsm/exporters/STLExporter.js +27 -5
- package/node_modules/three/examples/jsm/exporters/USDZExporter.js +783 -268
- package/node_modules/three/examples/jsm/geometries/BoxLineGeometry.js +23 -0
- package/node_modules/three/examples/jsm/geometries/ConvexGeometry.js +19 -0
- package/node_modules/three/examples/jsm/geometries/DecalGeometry.js +94 -30
- package/node_modules/three/examples/jsm/geometries/ParametricFunctions.js +100 -0
- package/node_modules/three/examples/jsm/geometries/ParametricGeometry.js +38 -5
- package/node_modules/three/examples/jsm/geometries/RoundedBoxGeometry.js +68 -7
- package/node_modules/three/examples/jsm/geometries/TeapotGeometry.js +23 -38
- package/node_modules/three/examples/jsm/geometries/TextGeometry.js +48 -21
- package/node_modules/three/examples/jsm/gpgpu/BitonicSort.js +715 -0
- package/node_modules/three/examples/jsm/helpers/LightProbeHelper.js +79 -44
- package/node_modules/three/examples/jsm/helpers/LightProbeHelperGPU.js +102 -0
- package/node_modules/three/examples/jsm/helpers/OctreeHelper.js +36 -0
- package/node_modules/three/examples/jsm/helpers/PositionalAudioHelper.js +60 -0
- package/node_modules/three/examples/jsm/helpers/RapierHelper.js +59 -0
- package/node_modules/three/examples/jsm/helpers/RectAreaLightHelper.js +36 -3
- package/node_modules/three/examples/jsm/helpers/TextureHelper.js +28 -0
- package/node_modules/three/examples/jsm/helpers/TextureHelperGPU.js +214 -0
- package/node_modules/three/examples/jsm/helpers/VertexNormalsHelper.js +61 -2
- package/node_modules/three/examples/jsm/helpers/VertexTangentsHelper.js +47 -2
- package/node_modules/three/examples/jsm/helpers/ViewHelper.js +192 -65
- package/node_modules/three/examples/jsm/inspector/Inspector.js +427 -0
- package/node_modules/three/examples/jsm/inspector/RendererInspector.js +415 -0
- package/node_modules/three/examples/jsm/inspector/tabs/Console.js +204 -0
- package/node_modules/three/examples/jsm/inspector/tabs/Parameters.js +332 -0
- package/node_modules/three/examples/jsm/inspector/tabs/Performance.js +268 -0
- package/node_modules/three/examples/jsm/inspector/tabs/Viewer.js +166 -0
- package/node_modules/three/examples/jsm/inspector/ui/Graph.js +95 -0
- package/node_modules/three/examples/jsm/inspector/ui/Item.js +170 -0
- package/node_modules/three/examples/jsm/inspector/ui/List.js +75 -0
- package/node_modules/three/examples/jsm/inspector/ui/Profiler.js +170 -0
- package/node_modules/three/examples/jsm/inspector/ui/Style.js +654 -0
- package/node_modules/three/examples/jsm/inspector/ui/Tab.js +46 -0
- package/node_modules/three/examples/jsm/inspector/ui/Values.js +423 -0
- package/node_modules/three/examples/jsm/inspector/ui/utils.js +56 -0
- package/node_modules/three/examples/jsm/interactive/HTMLMesh.js +50 -21
- package/node_modules/three/examples/jsm/interactive/InteractiveGroup.js +170 -62
- package/node_modules/three/examples/jsm/interactive/SelectionBox.js +106 -9
- package/node_modules/three/examples/jsm/interactive/SelectionHelper.js +76 -30
- package/node_modules/three/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/node_modules/three/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/node_modules/three/examples/jsm/libs/demuxer_mp4.js +109 -0
- package/node_modules/three/examples/jsm/libs/draco/README.md +2 -2
- package/node_modules/three/examples/jsm/libs/fflate.module.js +694 -496
- package/node_modules/three/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/node_modules/three/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/node_modules/three/examples/jsm/libs/motion-controllers.module.js +1 -1
- package/node_modules/three/examples/jsm/libs/rhino3dm/rhino3dm.js +1 -8723
- package/node_modules/three/examples/jsm/libs/rhino3dm/rhino3dm.module.js +1 -8734
- package/node_modules/three/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/node_modules/three/examples/jsm/libs/tween.module.js +32 -14
- package/node_modules/three/examples/jsm/lighting/TiledLighting.js +42 -0
- package/node_modules/three/examples/jsm/lights/LightProbeGenerator.js +65 -14
- package/node_modules/three/examples/jsm/lights/RectAreaLightTexturesLib.js +127 -0
- package/node_modules/three/examples/jsm/lights/RectAreaLightUniformsLib.js +20 -59
- package/node_modules/three/examples/jsm/lines/Line2.js +41 -4
- package/node_modules/three/examples/jsm/lines/LineGeometry.js +80 -2
- package/node_modules/three/examples/jsm/lines/LineMaterial.js +100 -22
- package/node_modules/three/examples/jsm/lines/LineSegments2.js +69 -4
- package/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +65 -8
- package/node_modules/three/examples/jsm/lines/Wireframe.js +58 -6
- package/node_modules/three/examples/jsm/lines/WireframeGeometry2.js +27 -2
- package/node_modules/three/examples/jsm/lines/webgpu/Line2.js +46 -0
- package/node_modules/three/examples/jsm/lines/webgpu/LineSegments2.js +411 -0
- package/node_modules/three/examples/jsm/lines/webgpu/Wireframe.js +86 -0
- package/node_modules/three/examples/jsm/loaders/3DMLoader.js +86 -23
- package/node_modules/three/examples/jsm/loaders/3MFLoader.js +148 -5
- package/node_modules/three/examples/jsm/loaders/AMFLoader.js +32 -12
- package/node_modules/three/examples/jsm/loaders/BVHLoader.js +59 -12
- package/node_modules/three/examples/jsm/loaders/ColladaLoader.js +51 -12
- package/node_modules/three/examples/jsm/loaders/DDSLoader.js +68 -1
- package/node_modules/three/examples/jsm/loaders/DRACOLoader.js +149 -23
- package/node_modules/three/examples/jsm/loaders/EXRLoader.js +584 -109
- package/node_modules/three/examples/jsm/loaders/FBXLoader.js +165 -97
- package/node_modules/three/examples/jsm/loaders/FontLoader.js +83 -6
- package/node_modules/three/examples/jsm/loaders/GCodeLoader.js +37 -6
- package/node_modules/three/examples/jsm/loaders/GLTFLoader.js +337 -108
- package/node_modules/three/examples/jsm/loaders/HDRCubeTextureLoader.js +52 -3
- package/node_modules/three/examples/jsm/loaders/HDRLoader.js +486 -0
- package/node_modules/three/examples/jsm/loaders/IESLoader.js +42 -0
- package/node_modules/three/examples/jsm/loaders/KMZLoader.js +33 -0
- package/node_modules/three/examples/jsm/loaders/KTX2Loader.js +441 -138
- package/node_modules/three/examples/jsm/loaders/KTXLoader.js +31 -10
- package/node_modules/three/examples/jsm/loaders/LDrawLoader.js +194 -145
- package/node_modules/three/examples/jsm/loaders/LUT3dlLoader.js +47 -25
- package/node_modules/three/examples/jsm/loaders/LUTCubeLoader.js +46 -23
- package/node_modules/three/examples/jsm/loaders/LUTImageLoader.js +79 -52
- package/node_modules/three/examples/jsm/loaders/LWOLoader.js +47 -20
- package/node_modules/three/examples/jsm/loaders/LottieLoader.js +54 -1
- package/node_modules/three/examples/jsm/loaders/MD2Loader.js +37 -1
- package/node_modules/three/examples/jsm/loaders/MDDLoader.js +57 -12
- package/node_modules/three/examples/jsm/loaders/MTLLoader.js +61 -35
- package/node_modules/three/examples/jsm/loaders/MaterialXLoader.js +291 -39
- package/node_modules/three/examples/jsm/loaders/NRRDLoader.js +38 -6
- package/node_modules/three/examples/jsm/loaders/OBJLoader.js +54 -4
- package/node_modules/three/examples/jsm/loaders/PCDLoader.js +183 -32
- package/node_modules/three/examples/jsm/loaders/PDBLoader.js +44 -4
- package/node_modules/three/examples/jsm/loaders/PLYLoader.js +78 -44
- package/node_modules/three/examples/jsm/loaders/PVRLoader.js +25 -6
- package/node_modules/three/examples/jsm/loaders/RGBELoader.js +6 -438
- package/node_modules/three/examples/jsm/loaders/STLLoader.js +51 -40
- package/node_modules/three/examples/jsm/loaders/SVGLoader.js +118 -24
- package/node_modules/three/examples/jsm/loaders/TDSLoader.js +92 -72
- package/node_modules/three/examples/jsm/loaders/TGALoader.js +23 -0
- package/node_modules/three/examples/jsm/loaders/TIFFLoader.js +23 -0
- package/node_modules/three/examples/jsm/loaders/TTFLoader.js +50 -3
- package/node_modules/three/examples/jsm/loaders/USDLoader.js +219 -0
- package/node_modules/three/examples/jsm/loaders/USDZLoader.js +4 -810
- package/node_modules/three/examples/jsm/loaders/UltraHDRLoader.js +630 -0
- package/node_modules/three/examples/jsm/loaders/VOXLoader.js +67 -2
- package/node_modules/three/examples/jsm/loaders/VRMLLoader.js +57 -21
- package/node_modules/three/examples/jsm/loaders/VTKLoader.js +119 -6
- package/node_modules/three/examples/jsm/loaders/XYZLoader.js +39 -2
- package/node_modules/three/examples/jsm/loaders/lwo/IFFParser.js +81 -78
- package/node_modules/three/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/node_modules/three/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/node_modules/three/examples/jsm/materials/LDrawConditionalLineMaterial.js +183 -0
- package/node_modules/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +154 -0
- package/node_modules/three/examples/jsm/materials/MeshGouraudMaterial.js +9 -1
- package/node_modules/three/examples/jsm/materials/MeshPostProcessingMaterial.js +25 -2
- package/node_modules/three/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/node_modules/three/examples/jsm/math/Capsule.js +91 -14
- package/node_modules/three/examples/jsm/math/ColorConverter.js +22 -0
- package/node_modules/three/examples/jsm/math/ColorSpaces.js +147 -0
- package/node_modules/three/examples/jsm/math/ConvexHull.js +517 -93
- package/node_modules/three/examples/jsm/math/ImprovedNoise.js +32 -15
- package/node_modules/three/examples/jsm/math/Lut.js +113 -0
- package/node_modules/three/examples/jsm/math/MeshSurfaceSampler.js +78 -13
- package/node_modules/three/examples/jsm/math/OBB.js +141 -29
- package/node_modules/three/examples/jsm/math/Octree.js +177 -25
- package/node_modules/three/examples/jsm/math/SimplexNoise.js +68 -42
- package/node_modules/three/examples/jsm/misc/ConvexObjectBreaker.js +45 -25
- package/node_modules/three/examples/jsm/misc/GPUComputationRenderer.js +105 -45
- package/node_modules/three/examples/jsm/misc/Gyroscope.js +12 -0
- package/node_modules/three/examples/jsm/misc/MD2Character.js +117 -2
- package/node_modules/three/examples/jsm/misc/MD2CharacterComplex.js +175 -11
- package/node_modules/three/examples/jsm/misc/MorphAnimMesh.js +44 -0
- package/node_modules/three/examples/jsm/misc/MorphBlendMesh.js +103 -0
- package/node_modules/three/examples/jsm/misc/ProgressiveLightMap.js +101 -54
- package/node_modules/three/examples/jsm/misc/ProgressiveLightMapGPU.js +322 -0
- package/node_modules/three/examples/jsm/misc/RollerCoaster.js +57 -0
- package/node_modules/three/examples/jsm/misc/TubePainter.js +437 -40
- package/node_modules/three/examples/jsm/misc/Volume.js +123 -75
- package/node_modules/three/examples/jsm/misc/VolumeSlice.js +95 -48
- package/node_modules/three/examples/jsm/modifiers/CurveModifier.js +77 -47
- package/node_modules/three/examples/jsm/modifiers/CurveModifierGPU.js +256 -0
- package/node_modules/three/examples/jsm/modifiers/EdgeSplitModifier.js +20 -0
- package/node_modules/three/examples/jsm/modifiers/SimplifyModifier.js +26 -11
- package/node_modules/three/examples/jsm/modifiers/TessellateModifier.js +35 -2
- package/node_modules/three/examples/jsm/objects/GroundedSkybox.js +25 -6
- package/node_modules/three/examples/jsm/objects/Lensflare.js +96 -4
- package/node_modules/three/examples/jsm/objects/LensflareMesh.js +376 -0
- package/node_modules/three/examples/jsm/objects/MarchingCubes.js +90 -5
- package/node_modules/three/examples/jsm/objects/Reflector.js +76 -2
- package/node_modules/three/examples/jsm/objects/ReflectorForSSRPass.js +41 -0
- package/node_modules/three/examples/jsm/objects/Refractor.js +62 -0
- package/node_modules/three/examples/jsm/objects/ShadowMesh.js +54 -4
- package/node_modules/three/examples/jsm/objects/Sky.js +30 -12
- package/node_modules/three/examples/jsm/objects/SkyMesh.js +243 -0
- package/node_modules/three/examples/jsm/objects/Water.js +45 -5
- package/node_modules/three/examples/jsm/objects/Water2.js +44 -4
- package/node_modules/three/examples/jsm/objects/Water2Mesh.js +199 -0
- package/node_modules/three/examples/jsm/objects/WaterMesh.js +196 -0
- package/node_modules/three/examples/jsm/physics/AmmoPhysics.js +48 -0
- package/node_modules/three/examples/jsm/physics/JoltPhysics.js +330 -0
- package/node_modules/three/examples/jsm/physics/RapierPhysics.js +231 -19
- package/node_modules/three/examples/jsm/postprocessing/AfterimagePass.js +110 -29
- package/node_modules/three/examples/jsm/postprocessing/BloomPass.js +128 -26
- package/node_modules/three/examples/jsm/postprocessing/BokehPass.js +99 -22
- package/node_modules/three/examples/jsm/postprocessing/ClearPass.js +54 -3
- package/node_modules/three/examples/jsm/postprocessing/CubeTexturePass.js +82 -21
- package/node_modules/three/examples/jsm/postprocessing/DotScreenPass.js +59 -10
- package/node_modules/three/examples/jsm/postprocessing/EffectComposer.js +135 -3
- package/node_modules/three/examples/jsm/postprocessing/FXAAPass.js +40 -0
- package/node_modules/three/examples/jsm/postprocessing/FilmPass.js +54 -5
- package/node_modules/three/examples/jsm/postprocessing/GTAOPass.js +202 -57
- package/node_modules/three/examples/jsm/postprocessing/GlitchPass.js +86 -37
- package/node_modules/three/examples/jsm/postprocessing/HalftonePass.js +65 -10
- package/node_modules/three/examples/jsm/postprocessing/LUTPass.js +43 -79
- package/node_modules/three/examples/jsm/postprocessing/MaskPass.js +91 -0
- package/node_modules/three/examples/jsm/postprocessing/OutlinePass.js +277 -155
- package/node_modules/three/examples/jsm/postprocessing/OutputPass.js +58 -14
- package/node_modules/three/examples/jsm/postprocessing/Pass.js +100 -4
- package/node_modules/three/examples/jsm/postprocessing/RenderPass.js +85 -1
- package/node_modules/three/examples/jsm/postprocessing/RenderPixelatedPass.js +124 -45
- package/node_modules/three/examples/jsm/postprocessing/RenderTransitionPass.js +267 -0
- package/node_modules/three/examples/jsm/postprocessing/SAOPass.js +128 -56
- package/node_modules/three/examples/jsm/postprocessing/SMAAPass.js +106 -75
- package/node_modules/three/examples/jsm/postprocessing/SSAARenderPass.js +120 -35
- package/node_modules/three/examples/jsm/postprocessing/SSAOPass.js +174 -67
- package/node_modules/three/examples/jsm/postprocessing/SSRPass.js +268 -53
- package/node_modules/three/examples/jsm/postprocessing/SavePass.js +69 -16
- package/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +65 -7
- package/node_modules/three/examples/jsm/postprocessing/TAARenderPass.js +79 -24
- package/node_modules/three/examples/jsm/postprocessing/TexturePass.js +72 -8
- package/node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js +125 -46
- package/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js +122 -9
- package/node_modules/three/examples/jsm/renderers/CSS3DRenderer.js +133 -8
- package/node_modules/three/examples/jsm/renderers/Projector.js +20 -2
- package/node_modules/three/examples/jsm/renderers/SVGRenderer.js +134 -5
- package/node_modules/three/examples/jsm/shaders/ACESFilmicToneMappingShader.js +12 -5
- package/node_modules/three/examples/jsm/shaders/AfterimageShader.js +8 -3
- package/node_modules/three/examples/jsm/shaders/BasicShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/BleachBypassShader.js +11 -5
- package/node_modules/three/examples/jsm/shaders/BlendShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/BokehShader.js +9 -3
- package/node_modules/three/examples/jsm/shaders/BokehShader2.js +11 -4
- package/node_modules/three/examples/jsm/shaders/BrightnessContrastShader.js +10 -4
- package/node_modules/three/examples/jsm/shaders/ColorCorrectionShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/ColorifyShader.js +9 -3
- package/node_modules/three/examples/jsm/shaders/ConvolutionShader.js +9 -38
- package/node_modules/three/examples/jsm/shaders/CopyShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/DOFMipMapShader.js +10 -3
- package/node_modules/three/examples/jsm/shaders/DepthLimitedBlurShader.js +10 -1
- package/node_modules/three/examples/jsm/shaders/DigitalGlitch.js +10 -7
- package/node_modules/three/examples/jsm/shaders/DotScreenShader.js +8 -3
- package/node_modules/three/examples/jsm/shaders/ExposureShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/FXAAShader.js +243 -233
- package/node_modules/three/examples/jsm/shaders/FilmShader.js +13 -0
- package/node_modules/three/examples/jsm/shaders/FocusShader.js +8 -3
- package/node_modules/three/examples/jsm/shaders/FreiChenShader.js +10 -3
- package/node_modules/three/examples/jsm/shaders/GTAOShader.js +37 -40
- package/node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js +11 -2
- package/node_modules/three/examples/jsm/shaders/GodRaysShader.js +20 -8
- package/node_modules/three/examples/jsm/shaders/HalftoneShader.js +13 -4
- package/node_modules/three/examples/jsm/shaders/HorizontalBlurShader.js +12 -3
- package/node_modules/three/examples/jsm/shaders/HorizontalTiltShiftShader.js +9 -2
- package/node_modules/three/examples/jsm/shaders/HueSaturationShader.js +10 -3
- package/node_modules/three/examples/jsm/shaders/KaleidoShader.js +11 -4
- package/node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js +9 -7
- package/node_modules/three/examples/jsm/shaders/LuminosityShader.js +8 -2
- package/node_modules/three/examples/jsm/shaders/MirrorShader.js +10 -4
- package/node_modules/three/examples/jsm/shaders/NormalMapShader.js +7 -2
- package/node_modules/three/examples/jsm/shaders/OutputShader.js +24 -2
- package/node_modules/three/examples/jsm/shaders/PoissonDenoiseShader.js +24 -15
- package/node_modules/three/examples/jsm/shaders/RGBShiftShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/SAOShader.js +10 -1
- package/node_modules/three/examples/jsm/shaders/SMAAShader.js +24 -1
- package/node_modules/three/examples/jsm/shaders/SSAOShader.js +26 -5
- package/node_modules/three/examples/jsm/shaders/SSRShader.js +26 -1
- package/node_modules/three/examples/jsm/shaders/SepiaShader.js +8 -3
- package/node_modules/three/examples/jsm/shaders/SobelOperatorShader.js +9 -3
- package/node_modules/three/examples/jsm/shaders/SubsurfaceScatteringShader.js +13 -8
- package/node_modules/three/examples/jsm/shaders/TechnicolorShader.js +10 -4
- package/node_modules/three/examples/jsm/shaders/ToonShader.js +29 -6
- package/node_modules/three/examples/jsm/shaders/TriangleBlurShader.js +9 -4
- package/node_modules/three/examples/jsm/shaders/UnpackDepthRGBAShader.js +19 -4
- package/node_modules/three/examples/jsm/shaders/VelocityShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/VerticalBlurShader.js +9 -2
- package/node_modules/three/examples/jsm/shaders/VerticalTiltShiftShader.js +8 -1
- package/node_modules/three/examples/jsm/shaders/VignetteShader.js +8 -3
- package/node_modules/three/examples/jsm/shaders/VolumeShader.js +11 -2
- package/node_modules/three/examples/jsm/shaders/WaterRefractionShader.js +11 -0
- package/node_modules/three/examples/jsm/textures/FlakesTexture.js +14 -0
- package/node_modules/three/examples/jsm/transpiler/AST.js +392 -31
- package/node_modules/three/examples/jsm/transpiler/GLSLDecoder.js +366 -136
- package/node_modules/three/examples/jsm/transpiler/Linker.js +327 -0
- package/node_modules/three/examples/jsm/transpiler/ShaderToyDecoder.js +3 -3
- package/node_modules/three/examples/jsm/transpiler/TSLEncoder.js +336 -111
- package/node_modules/three/examples/jsm/transpiler/Transpiler.js +50 -1
- package/node_modules/three/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/node_modules/three/examples/jsm/transpiler/WGSLEncoder.js +812 -0
- package/node_modules/three/examples/jsm/tsl/display/AfterImageNode.js +244 -0
- package/node_modules/three/examples/jsm/tsl/display/AnaglyphPassNode.js +107 -0
- package/node_modules/three/examples/jsm/tsl/display/AnamorphicNode.js +282 -0
- package/node_modules/three/examples/jsm/tsl/display/BleachBypass.js +33 -0
- package/node_modules/three/examples/jsm/tsl/display/BloomNode.js +524 -0
- package/node_modules/three/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
- package/node_modules/three/examples/jsm/tsl/display/DenoiseNode.js +334 -0
- package/node_modules/three/examples/jsm/tsl/display/DepthOfFieldNode.js +554 -0
- package/node_modules/three/examples/jsm/tsl/display/DotScreenNode.js +104 -0
- package/node_modules/three/examples/jsm/tsl/display/FXAANode.js +365 -0
- package/node_modules/three/examples/jsm/tsl/display/FilmNode.js +101 -0
- package/node_modules/three/examples/jsm/tsl/display/GTAONode.js +570 -0
- package/node_modules/three/examples/jsm/tsl/display/GaussianBlurNode.js +380 -0
- package/node_modules/three/examples/jsm/tsl/display/LensflareNode.js +279 -0
- package/node_modules/three/examples/jsm/tsl/display/Lut3DNode.js +109 -0
- package/node_modules/three/examples/jsm/tsl/display/MotionBlur.js +33 -0
- package/node_modules/three/examples/jsm/tsl/display/OutlineNode.js +762 -0
- package/node_modules/three/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +89 -0
- package/node_modules/three/examples/jsm/tsl/display/PixelationPassNode.js +334 -0
- package/node_modules/three/examples/jsm/tsl/display/RGBShiftNode.js +96 -0
- package/node_modules/three/examples/jsm/tsl/display/SMAANode.js +768 -0
- package/node_modules/three/examples/jsm/tsl/display/SSAAPassNode.js +358 -0
- package/node_modules/three/examples/jsm/tsl/display/SSGINode.js +654 -0
- package/node_modules/three/examples/jsm/tsl/display/SSRNode.js +656 -0
- package/node_modules/three/examples/jsm/tsl/display/SSSNode.js +488 -0
- package/node_modules/three/examples/jsm/tsl/display/Sepia.js +24 -0
- package/node_modules/three/examples/jsm/tsl/display/SobelOperatorNode.js +168 -0
- package/node_modules/three/examples/jsm/tsl/display/StereoCompositePassNode.js +185 -0
- package/node_modules/three/examples/jsm/tsl/display/StereoPassNode.js +120 -0
- package/node_modules/three/examples/jsm/tsl/display/TRAANode.js +578 -0
- package/node_modules/three/examples/jsm/tsl/display/TransitionNode.js +141 -0
- package/node_modules/three/examples/jsm/tsl/display/boxBlur.js +65 -0
- package/node_modules/three/examples/jsm/tsl/display/hashBlur.js +54 -0
- package/node_modules/three/examples/jsm/tsl/lighting/TiledLightsNode.js +442 -0
- package/node_modules/three/examples/jsm/tsl/math/Bayer.js +34 -0
- package/node_modules/three/examples/jsm/tsl/shadows/TileShadowNode.js +456 -0
- package/node_modules/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +212 -0
- package/node_modules/three/examples/jsm/tsl/utils/Raymarching.js +70 -0
- package/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +109 -45
- package/node_modules/three/examples/jsm/utils/CameraUtils.js +15 -6
- package/node_modules/three/examples/jsm/utils/GeometryCompressionUtils.js +54 -146
- package/node_modules/three/examples/jsm/utils/GeometryUtils.js +32 -27
- package/node_modules/three/examples/jsm/utils/LDrawUtils.js +13 -4
- package/node_modules/three/examples/jsm/utils/SceneOptimizer.js +458 -0
- package/node_modules/three/examples/jsm/utils/SceneUtils.js +112 -3
- package/node_modules/three/examples/jsm/utils/ShadowMapViewer.js +51 -31
- package/node_modules/three/examples/jsm/utils/ShadowMapViewerGPU.js +233 -0
- package/node_modules/three/examples/jsm/utils/SkeletonUtils.js +145 -68
- package/node_modules/three/examples/jsm/utils/SortUtils.js +23 -8
- package/node_modules/three/examples/jsm/utils/UVsDebug.js +12 -4
- package/node_modules/three/examples/jsm/utils/{TextureUtils.js → WebGLTextureUtils.js} +19 -2
- package/node_modules/three/examples/jsm/utils/WebGPUTextureUtils.js +81 -0
- package/node_modules/three/examples/jsm/utils/WorkerPool.js +67 -2
- package/node_modules/three/examples/jsm/webxr/ARButton.js +19 -0
- package/node_modules/three/examples/jsm/webxr/OculusHandModel.js +87 -2
- package/node_modules/three/examples/jsm/webxr/OculusHandPointerModel.js +148 -22
- package/node_modules/three/examples/jsm/webxr/Text2D.js +20 -6
- package/node_modules/three/examples/jsm/webxr/VRButton.js +44 -5
- package/node_modules/three/examples/jsm/webxr/XRButton.js +23 -1
- package/node_modules/three/examples/jsm/webxr/XRControllerModelFactory.js +103 -4
- package/node_modules/three/examples/jsm/webxr/XREstimatedLight.js +35 -4
- package/node_modules/three/examples/jsm/webxr/XRHandMeshModel.js +37 -0
- package/node_modules/three/examples/jsm/webxr/XRHandModelFactory.js +101 -9
- package/node_modules/three/examples/jsm/webxr/XRHandPrimitiveModel.js +44 -0
- package/node_modules/three/examples/jsm/webxr/XRPlanes.js +18 -0
- package/node_modules/three/package.json +25 -20
- package/node_modules/three/src/Three.Core.js +185 -0
- package/node_modules/three/src/Three.Legacy.js +0 -1
- package/node_modules/three/src/Three.TSL.js +633 -0
- package/node_modules/three/src/Three.WebGPU.Nodes.js +26 -0
- package/node_modules/three/src/Three.WebGPU.js +28 -0
- package/node_modules/three/src/Three.js +1 -176
- package/node_modules/three/src/animation/AnimationAction.js +262 -30
- package/node_modules/three/src/animation/AnimationClip.js +164 -9
- package/node_modules/three/src/animation/AnimationMixer.js +99 -15
- package/node_modules/three/src/animation/AnimationObjectGroup.js +45 -21
- package/node_modules/three/src/animation/AnimationUtils.js +169 -19
- package/node_modules/three/src/animation/KeyframeTrack.js +151 -16
- package/node_modules/three/src/animation/PropertyBinding.js +91 -16
- package/node_modules/three/src/animation/PropertyMixer.js +72 -5
- package/node_modules/three/src/animation/tracks/BooleanKeyframeTrack.js +42 -6
- package/node_modules/three/src/animation/tracks/ColorKeyframeTrack.js +26 -5
- package/node_modules/three/src/animation/tracks/NumberKeyframeTrack.js +26 -2
- package/node_modules/three/src/animation/tracks/QuaternionKeyframeTrack.js +31 -3
- package/node_modules/three/src/animation/tracks/StringKeyframeTrack.js +42 -2
- package/node_modules/three/src/animation/tracks/VectorKeyframeTrack.js +26 -2
- package/node_modules/three/src/audio/Audio.js +388 -10
- package/node_modules/three/src/audio/AudioAnalyser.js +58 -1
- package/node_modules/three/src/audio/AudioContext.js +15 -0
- package/node_modules/three/src/audio/AudioListener.js +89 -10
- package/node_modules/three/src/audio/PositionalAudio.js +107 -0
- package/node_modules/three/src/cameras/ArrayCamera.js +37 -0
- package/node_modules/three/src/cameras/Camera.js +61 -0
- package/node_modules/three/src/cameras/CubeCamera.js +66 -0
- package/node_modules/three/src/cameras/OrthographicCamera.js +110 -1
- package/node_modules/three/src/cameras/PerspectiveCamera.js +174 -35
- package/node_modules/three/src/cameras/StereoCamera.js +48 -2
- package/node_modules/three/src/constants.js +1477 -18
- package/node_modules/three/src/core/BufferAttribute.js +417 -23
- package/node_modules/three/src/core/BufferGeometry.js +416 -49
- package/node_modules/three/src/core/Clock.js +62 -8
- package/node_modules/three/src/core/EventDispatcher.js +52 -8
- package/node_modules/three/src/core/GLBufferAttribute.js +113 -2
- package/node_modules/three/src/core/InstancedBufferAttribute.js +29 -0
- package/node_modules/three/src/core/InstancedBufferGeometry.js +20 -0
- package/node_modules/three/src/core/InstancedInterleavedBuffer.js +26 -0
- package/node_modules/three/src/core/InterleavedBuffer.js +141 -16
- package/node_modules/three/src/core/InterleavedBufferAttribute.js +200 -2
- package/node_modules/three/src/core/Layers.js +71 -10
- package/node_modules/three/src/core/Object3D.js +665 -54
- package/node_modules/three/src/core/Raycaster.js +160 -8
- package/node_modules/three/src/core/RenderTarget.js +297 -36
- package/node_modules/three/src/core/RenderTarget3D.js +48 -0
- package/node_modules/three/src/core/Timer.js +184 -0
- package/node_modules/three/src/core/Uniform.js +29 -0
- package/node_modules/three/src/core/UniformsGroup.js +84 -2
- package/node_modules/three/src/extras/Controls.js +120 -0
- package/node_modules/three/src/extras/DataUtils.js +50 -9
- package/node_modules/three/src/extras/Earcut.js +18 -779
- package/node_modules/three/src/extras/ImageUtils.js +22 -14
- package/node_modules/three/src/extras/PMREMGenerator.js +329 -64
- package/node_modules/three/src/extras/ShapeUtils.js +24 -2
- package/node_modules/three/src/extras/TextureUtils.js +293 -0
- package/node_modules/three/src/extras/core/Curve.js +156 -55
- package/node_modules/three/src/extras/core/CurvePath.js +63 -22
- package/node_modules/three/src/extras/core/Interpolations.js +34 -2
- package/node_modules/three/src/extras/core/Path.js +134 -1
- package/node_modules/three/src/extras/core/Shape.js +66 -3
- package/node_modules/three/src/extras/core/ShapePath.js +80 -4
- package/node_modules/three/src/extras/curves/ArcCurve.js +22 -0
- package/node_modules/three/src/extras/curves/CatmullRomCurve3.js +89 -18
- package/node_modules/three/src/extras/curves/CubicBezierCurve.js +67 -0
- package/node_modules/three/src/extras/curves/CubicBezierCurve3.js +50 -0
- package/node_modules/three/src/extras/curves/EllipseCurve.js +104 -2
- package/node_modules/three/src/extras/curves/LineCurve.js +36 -0
- package/node_modules/three/src/extras/curves/LineCurve3.js +36 -0
- package/node_modules/three/src/extras/curves/QuadraticBezierCurve.js +59 -0
- package/node_modules/three/src/extras/curves/QuadraticBezierCurve3.js +43 -0
- package/node_modules/three/src/extras/curves/SplineCurve.js +48 -0
- package/node_modules/three/src/extras/lib/earcut.js +685 -0
- package/node_modules/three/src/geometries/BoxGeometry.js +39 -0
- package/node_modules/three/src/geometries/CapsuleGeometry.js +196 -11
- package/node_modules/three/src/geometries/CircleGeometry.js +41 -0
- package/node_modules/three/src/geometries/ConeGeometry.js +39 -0
- package/node_modules/three/src/geometries/CylinderGeometry.js +51 -4
- package/node_modules/three/src/geometries/DodecahedronGeometry.js +33 -0
- package/node_modules/three/src/geometries/EdgesGeometry.js +30 -2
- package/node_modules/three/src/geometries/ExtrudeGeometry.js +146 -50
- package/node_modules/three/src/geometries/IcosahedronGeometry.js +33 -0
- package/node_modules/three/src/geometries/LatheGeometry.js +44 -3
- package/node_modules/three/src/geometries/OctahedronGeometry.js +33 -0
- package/node_modules/three/src/geometries/PlaneGeometry.js +35 -0
- package/node_modules/three/src/geometries/PolyhedronGeometry.js +29 -0
- package/node_modules/three/src/geometries/RingGeometry.js +37 -0
- package/node_modules/three/src/geometries/ShapeGeometry.js +38 -0
- package/node_modules/three/src/geometries/SphereGeometry.js +38 -0
- package/node_modules/three/src/geometries/TetrahedronGeometry.js +33 -0
- package/node_modules/three/src/geometries/TorusGeometry.js +36 -0
- package/node_modules/three/src/geometries/TorusKnotGeometry.js +39 -0
- package/node_modules/three/src/geometries/TubeGeometry.js +50 -0
- package/node_modules/three/src/geometries/WireframeGeometry.js +32 -0
- package/node_modules/three/src/helpers/ArrowHelper.js +62 -5
- package/node_modules/three/src/helpers/AxesHelper.js +28 -0
- package/node_modules/three/src/helpers/Box3Helper.js +28 -0
- package/node_modules/three/src/helpers/BoxHelper.js +43 -7
- package/node_modules/three/src/helpers/CameraHelper.js +100 -27
- package/node_modules/three/src/helpers/DirectionalLightHelper.js +52 -0
- package/node_modules/three/src/helpers/GridHelper.js +26 -0
- package/node_modules/three/src/helpers/HemisphereLightHelper.js +39 -0
- package/node_modules/three/src/helpers/PlaneHelper.js +33 -0
- package/node_modules/three/src/helpers/PointLightHelper.js +43 -0
- package/node_modules/three/src/helpers/PolarGridHelper.js +30 -0
- package/node_modules/three/src/helpers/SkeletonHelper.js +73 -7
- package/node_modules/three/src/helpers/SpotLightHelper.js +58 -1
- package/node_modules/three/src/lights/AmbientLight.js +25 -0
- package/node_modules/three/src/lights/DirectionalLight.js +57 -0
- package/node_modules/three/src/lights/DirectionalLightShadow.js +15 -0
- package/node_modules/three/src/lights/HemisphereLight.js +32 -0
- package/node_modules/three/src/lights/Light.js +37 -0
- package/node_modules/three/src/lights/LightProbe.js +43 -0
- package/node_modules/three/src/lights/LightShadow.js +198 -7
- package/node_modules/three/src/lights/PointLight.js +59 -0
- package/node_modules/three/src/lights/PointLightShadow.js +22 -1
- package/node_modules/three/src/lights/RectAreaLight.js +59 -0
- package/node_modules/three/src/lights/SpotLight.js +102 -0
- package/node_modules/three/src/lights/SpotLightShadow.js +33 -3
- package/node_modules/three/src/lights/webgpu/IESSpotLight.js +46 -0
- package/node_modules/three/src/lights/webgpu/ProjectorLight.js +46 -0
- package/node_modules/three/src/loaders/AnimationLoader.js +34 -2
- package/node_modules/three/src/loaders/AudioLoader.js +34 -2
- package/node_modules/three/src/loaders/BufferGeometryLoader.js +38 -13
- package/node_modules/three/src/loaders/Cache.js +47 -2
- package/node_modules/three/src/loaders/CompressedTextureLoader.js +36 -3
- package/node_modules/three/src/loaders/CubeTextureLoader.js +45 -0
- package/node_modules/three/src/loaders/DataTextureLoader.js +45 -8
- package/node_modules/three/src/loaders/FileLoader.js +90 -6
- package/node_modules/three/src/loaders/ImageBitmapLoader.js +108 -11
- package/node_modules/three/src/loaders/ImageLoader.js +85 -8
- package/node_modules/three/src/loaders/Loader.js +144 -0
- package/node_modules/three/src/loaders/LoaderUtils.js +18 -34
- package/node_modules/three/src/loaders/LoadingManager.js +187 -0
- package/node_modules/three/src/loaders/MaterialLoader.js +70 -4
- package/node_modules/three/src/loaders/ObjectLoader.js +146 -30
- package/node_modules/three/src/loaders/TextureLoader.js +33 -0
- package/node_modules/three/src/loaders/nodes/NodeLoader.js +194 -0
- package/node_modules/three/src/loaders/nodes/NodeMaterialLoader.js +108 -0
- package/node_modules/three/src/loaders/nodes/NodeObjectLoader.js +151 -0
- package/node_modules/three/src/materials/LineBasicMaterial.js +74 -1
- package/node_modules/three/src/materials/LineDashedMaterial.js +52 -1
- package/node_modules/three/src/materials/Material.js +504 -11
- package/node_modules/three/src/materials/MeshBasicMaterial.js +172 -3
- package/node_modules/three/src/materials/MeshDepthMaterial.js +94 -0
- package/node_modules/three/src/materials/MeshDistanceMaterial.js +76 -0
- package/node_modules/three/src/materials/MeshLambertMaterial.js +278 -1
- package/node_modules/three/src/materials/MeshMatcapMaterial.js +164 -0
- package/node_modules/three/src/materials/MeshNormalMaterial.js +114 -0
- package/node_modules/three/src/materials/MeshPhongMaterial.js +293 -1
- package/node_modules/three/src/materials/MeshPhysicalMaterial.js +316 -4
- package/node_modules/three/src/materials/MeshStandardMaterial.js +304 -3
- package/node_modules/three/src/materials/MeshToonMaterial.js +219 -0
- package/node_modules/three/src/materials/PointsMaterial.js +89 -0
- package/node_modules/three/src/materials/RawShaderMaterial.js +25 -0
- package/node_modules/three/src/materials/ShaderMaterial.js +215 -10
- package/node_modules/three/src/materials/ShadowMaterial.js +54 -0
- package/node_modules/three/src/materials/SpriteMaterial.js +82 -0
- package/node_modules/three/{examples/jsm/nodes/materials → src/materials/nodes}/Line2NodeMaterial.js +206 -100
- package/node_modules/three/src/materials/nodes/LineBasicNodeMaterial.js +46 -0
- package/node_modules/three/src/materials/nodes/LineDashedNodeMaterial.js +132 -0
- package/node_modules/three/src/materials/nodes/MeshBasicNodeMaterial.js +134 -0
- package/node_modules/three/src/materials/nodes/MeshLambertNodeMaterial.js +82 -0
- package/node_modules/three/src/materials/nodes/MeshMatcapNodeMaterial.js +77 -0
- package/node_modules/three/src/materials/nodes/MeshNormalNodeMaterial.js +67 -0
- package/node_modules/three/src/materials/nodes/MeshPhongNodeMaterial.js +141 -0
- package/node_modules/three/src/materials/nodes/MeshPhysicalNodeMaterial.js +518 -0
- package/node_modules/three/src/materials/nodes/MeshSSSNodeMaterial.js +175 -0
- package/node_modules/three/src/materials/nodes/MeshStandardNodeMaterial.js +186 -0
- package/node_modules/three/src/materials/nodes/MeshToonNodeMaterial.js +66 -0
- package/node_modules/three/src/materials/nodes/NodeMaterial.js +1310 -0
- package/node_modules/three/{examples/jsm/nodes/materials/Materials.js → src/materials/nodes/NodeMaterials.js} +7 -2
- package/node_modules/three/src/materials/nodes/PointsNodeMaterial.js +211 -0
- package/node_modules/three/src/materials/nodes/ShadowNodeMaterial.js +76 -0
- package/node_modules/three/src/materials/nodes/SpriteNodeMaterial.js +186 -0
- package/node_modules/three/src/materials/nodes/VolumeNodeMaterial.js +81 -0
- package/node_modules/three/src/materials/nodes/manager/NodeMaterialObserver.js +613 -0
- package/node_modules/three/src/math/Box2.js +181 -4
- package/node_modules/three/src/math/Box3.js +277 -6
- package/node_modules/three/src/math/Color.js +355 -11
- package/node_modules/three/src/math/ColorManagement.js +161 -85
- package/node_modules/three/src/math/Cylindrical.js +65 -6
- package/node_modules/three/src/math/Euler.js +139 -5
- package/node_modules/three/src/math/Frustum.js +108 -9
- package/node_modules/three/src/math/FrustumArray.js +258 -0
- package/node_modules/three/src/math/Interpolant.js +87 -8
- package/node_modules/three/src/math/Line3.js +223 -2
- package/node_modules/three/src/math/MathUtils.js +408 -20
- package/node_modules/three/src/math/Matrix2.js +124 -0
- package/node_modules/three/src/math/Matrix3.js +229 -4
- package/node_modules/three/src/math/Matrix4.js +416 -30
- package/node_modules/three/src/math/Plane.js +164 -2
- package/node_modules/three/src/math/Quaternion.js +345 -86
- package/node_modules/three/src/math/Ray.js +162 -0
- package/node_modules/three/src/math/Sphere.js +175 -0
- package/node_modules/three/src/math/Spherical.js +74 -13
- package/node_modules/three/src/math/SphericalHarmonics3.js +112 -14
- package/node_modules/three/src/math/Triangle.js +230 -2
- package/node_modules/three/src/math/Vector2.js +396 -10
- package/node_modules/three/src/math/Vector3.js +557 -20
- package/node_modules/three/src/math/Vector4.js +428 -9
- package/node_modules/three/src/math/interpolants/CubicInterpolant.js +10 -1
- package/node_modules/three/src/math/interpolants/DiscreteInterpolant.js +10 -2
- package/node_modules/three/src/math/interpolants/LinearInterpolant.js +13 -0
- package/node_modules/three/src/math/interpolants/QuaternionLinearInterpolant.js +10 -1
- package/node_modules/three/src/nodes/Nodes.js +148 -0
- package/node_modules/three/src/nodes/TSL.js +173 -0
- package/node_modules/three/src/nodes/accessors/AccessorsUtils.js +53 -0
- package/node_modules/three/src/nodes/accessors/Arrays.js +68 -0
- package/node_modules/three/src/nodes/accessors/BatchNode.js +163 -0
- package/node_modules/three/src/nodes/accessors/Bitangent.js +82 -0
- package/node_modules/three/src/nodes/accessors/BufferAttributeNode.js +340 -0
- package/node_modules/three/src/nodes/accessors/BufferNode.js +101 -0
- package/node_modules/three/src/nodes/accessors/BuiltinNode.js +63 -0
- package/node_modules/three/src/nodes/accessors/Camera.js +282 -0
- package/node_modules/three/src/nodes/accessors/ClippingNode.js +255 -0
- package/node_modules/three/src/nodes/accessors/CubeTextureNode.js +190 -0
- package/node_modules/three/src/nodes/accessors/InstanceNode.js +244 -0
- package/node_modules/three/src/nodes/accessors/InstancedMeshNode.js +50 -0
- package/node_modules/three/src/nodes/accessors/Lights.js +139 -0
- package/node_modules/three/src/nodes/accessors/MaterialNode.js +775 -0
- package/node_modules/three/src/nodes/accessors/MaterialProperties.js +59 -0
- package/node_modules/three/src/nodes/accessors/MaterialReferenceNode.js +85 -0
- package/node_modules/three/src/nodes/accessors/ModelNode.js +184 -0
- package/node_modules/three/src/nodes/accessors/ModelViewProjectionNode.js +13 -0
- package/node_modules/three/{examples/jsm → src}/nodes/accessors/MorphNode.js +122 -57
- package/node_modules/three/src/nodes/accessors/Normal.js +243 -0
- package/node_modules/three/src/nodes/accessors/Object3DNode.js +268 -0
- package/node_modules/three/src/nodes/accessors/PointUVNode.js +55 -0
- package/node_modules/three/src/nodes/accessors/Position.js +90 -0
- package/node_modules/three/src/nodes/accessors/ReferenceBaseNode.js +357 -0
- package/node_modules/three/src/nodes/accessors/ReferenceNode.js +424 -0
- package/node_modules/three/src/nodes/accessors/ReflectVector.js +36 -0
- package/node_modules/three/src/nodes/accessors/RendererReferenceNode.js +79 -0
- package/node_modules/three/src/nodes/accessors/SceneNode.js +145 -0
- package/node_modules/three/src/nodes/accessors/SkinningNode.js +327 -0
- package/node_modules/three/src/nodes/accessors/StorageBufferNode.js +416 -0
- package/node_modules/three/src/nodes/accessors/StorageTextureNode.js +264 -0
- package/node_modules/three/src/nodes/accessors/Tangent.js +70 -0
- package/node_modules/three/src/nodes/accessors/TangentUtils.js +46 -0
- package/node_modules/three/src/nodes/accessors/Texture3DNode.js +199 -0
- package/node_modules/three/{examples/jsm/nodes/accessors/TextureBicubicNode.js → src/nodes/accessors/TextureBicubic.js} +28 -30
- package/node_modules/three/src/nodes/accessors/TextureNode.js +927 -0
- package/node_modules/three/src/nodes/accessors/TextureSizeNode.js +77 -0
- package/node_modules/three/src/nodes/accessors/UV.js +11 -0
- package/node_modules/three/src/nodes/accessors/UniformArrayNode.js +348 -0
- package/node_modules/three/src/nodes/accessors/UserDataNode.js +77 -0
- package/node_modules/three/src/nodes/accessors/VelocityNode.js +224 -0
- package/node_modules/three/src/nodes/accessors/VertexColorNode.js +110 -0
- package/node_modules/three/src/nodes/code/CodeNode.js +181 -0
- package/node_modules/three/src/nodes/code/ExpressionNode.js +68 -0
- package/node_modules/three/src/nodes/code/FunctionCallNode.js +187 -0
- package/node_modules/three/src/nodes/code/FunctionNode.js +183 -0
- package/node_modules/three/{examples/jsm → src}/nodes/code/ScriptableNode.js +253 -15
- package/node_modules/three/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +95 -9
- package/node_modules/three/src/nodes/core/ArrayNode.js +155 -0
- package/node_modules/three/src/nodes/core/AssignNode.js +202 -0
- package/node_modules/three/src/nodes/core/AttributeNode.js +168 -0
- package/node_modules/three/src/nodes/core/BypassNode.js +93 -0
- package/node_modules/three/src/nodes/core/ConstNode.js +67 -0
- package/node_modules/three/src/nodes/core/ContextNode.js +184 -0
- package/node_modules/three/src/nodes/core/IndexNode.js +164 -0
- package/node_modules/three/src/nodes/core/InputNode.js +136 -0
- package/node_modules/three/src/nodes/core/InspectorNode.js +128 -0
- package/node_modules/three/src/nodes/core/IsolateNode.js +133 -0
- package/node_modules/three/src/nodes/core/LightingModel.js +77 -0
- package/node_modules/three/src/nodes/core/MRTNode.js +150 -0
- package/node_modules/three/src/nodes/core/Node.js +1083 -0
- package/node_modules/three/src/nodes/core/NodeAttribute.js +53 -0
- package/node_modules/three/src/nodes/core/NodeBuilder.js +3081 -0
- package/node_modules/three/src/nodes/core/NodeCache.js +75 -0
- package/node_modules/three/src/nodes/core/NodeCode.js +46 -0
- package/node_modules/three/src/nodes/core/NodeFrame.js +306 -0
- package/node_modules/three/src/nodes/core/NodeFunction.js +69 -0
- package/node_modules/three/src/nodes/core/NodeFunctionInput.js +61 -0
- package/node_modules/three/src/nodes/core/NodeParser.js +23 -0
- package/node_modules/three/src/nodes/core/NodeUniform.js +91 -0
- package/node_modules/three/src/nodes/core/NodeUtils.js +406 -0
- package/node_modules/three/src/nodes/core/NodeVar.js +60 -0
- package/node_modules/three/src/nodes/core/NodeVarying.js +63 -0
- package/node_modules/three/src/nodes/core/OutputStructNode.js +103 -0
- package/node_modules/three/src/nodes/core/ParameterNode.js +94 -0
- package/node_modules/three/src/nodes/core/PropertyNode.js +351 -0
- package/node_modules/three/src/nodes/core/StackNode.js +377 -0
- package/node_modules/three/src/nodes/core/StructNode.js +120 -0
- package/node_modules/three/src/nodes/core/StructType.js +13 -0
- package/node_modules/three/src/nodes/core/StructTypeNode.js +154 -0
- package/node_modules/three/src/nodes/core/SubBuildNode.js +89 -0
- package/node_modules/three/src/nodes/core/TempNode.js +88 -0
- package/node_modules/three/src/nodes/core/UniformGroupNode.js +137 -0
- package/node_modules/three/src/nodes/core/UniformNode.js +243 -0
- package/node_modules/three/src/nodes/core/VarNode.js +342 -0
- package/node_modules/three/src/nodes/core/VaryingNode.js +227 -0
- package/node_modules/three/src/nodes/core/constants.js +68 -0
- package/node_modules/three/src/nodes/display/BlendModes.js +235 -0
- package/node_modules/three/src/nodes/display/BumpMapNode.js +117 -0
- package/node_modules/three/src/nodes/display/ColorAdjustment.js +141 -0
- package/node_modules/three/src/nodes/display/ColorSpaceFunctions.js +54 -0
- package/node_modules/three/src/nodes/display/ColorSpaceNode.js +164 -0
- package/node_modules/three/src/nodes/display/FrontFacingNode.js +102 -0
- package/node_modules/three/src/nodes/display/NormalMapNode.js +118 -0
- package/node_modules/three/src/nodes/display/PassNode.js +946 -0
- package/node_modules/three/src/nodes/display/PosterizeNode.js +65 -0
- package/node_modules/three/src/nodes/display/RenderOutputNode.js +150 -0
- package/node_modules/three/src/nodes/display/ScreenNode.js +290 -0
- package/node_modules/three/src/nodes/display/ToneMappingFunctions.js +242 -0
- package/node_modules/three/src/nodes/display/ToneMappingNode.js +147 -0
- package/node_modules/three/src/nodes/display/ToonOutlinePassNode.js +191 -0
- package/node_modules/three/src/nodes/display/ViewportDepthNode.js +294 -0
- package/node_modules/three/src/nodes/display/ViewportDepthTextureNode.js +67 -0
- package/node_modules/three/src/nodes/display/ViewportSharedTextureNode.js +73 -0
- package/node_modules/three/src/nodes/display/ViewportTextureNode.js +228 -0
- package/node_modules/three/src/nodes/fog/Fog.js +114 -0
- package/node_modules/three/src/nodes/functions/BSDF/BRDF_GGX.js +55 -0
- package/node_modules/three/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +9 -9
- package/node_modules/three/src/nodes/functions/BSDF/DFGApprox.js +71 -0
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +2 -2
- package/node_modules/three/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/node_modules/three/src/nodes/functions/BSDF/LTC.js +175 -0
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/node_modules/three/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -4
- package/node_modules/three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
- package/node_modules/three/src/nodes/functions/BasicLightingModel.js +100 -0
- package/node_modules/three/src/nodes/functions/PhongLightingModel.js +99 -0
- package/node_modules/three/src/nodes/functions/PhysicalLightingModel.js +797 -0
- package/node_modules/three/src/nodes/functions/ShadowMaskModel.js +58 -0
- package/node_modules/three/src/nodes/functions/ToonLightingModel.js +70 -0
- package/node_modules/three/src/nodes/functions/VolumetricLightingModel.js +183 -0
- package/node_modules/three/src/nodes/functions/material/getAlphaHashThreshold.js +68 -0
- package/node_modules/three/src/nodes/functions/material/getGeometryRoughness.js +19 -0
- package/node_modules/three/src/nodes/functions/material/getParallaxCorrectNormal.js +37 -0
- package/node_modules/three/{examples/jsm → src}/nodes/functions/material/getRoughness.js +2 -2
- package/node_modules/three/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/node_modules/three/src/nodes/geometry/RangeNode.js +208 -0
- package/node_modules/three/src/nodes/gpgpu/AtomicFunctionNode.js +274 -0
- package/node_modules/three/src/nodes/gpgpu/BarrierNode.js +89 -0
- package/node_modules/three/src/nodes/gpgpu/ComputeBuiltinNode.js +228 -0
- package/node_modules/three/src/nodes/gpgpu/ComputeNode.js +284 -0
- package/node_modules/three/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
- package/node_modules/three/src/nodes/gpgpu/WorkgroupInfoNode.js +234 -0
- package/node_modules/three/src/nodes/lighting/AONode.js +45 -0
- package/node_modules/three/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +16 -8
- package/node_modules/three/src/nodes/lighting/AnalyticLightNode.js +256 -0
- package/node_modules/three/src/nodes/lighting/BasicEnvironmentNode.js +49 -0
- package/node_modules/three/src/nodes/lighting/BasicLightMapNode.js +49 -0
- package/node_modules/three/src/nodes/lighting/DirectionalLightNode.js +39 -0
- package/node_modules/three/src/nodes/lighting/EnvironmentNode.js +153 -0
- package/node_modules/three/src/nodes/lighting/HemisphereLightNode.js +87 -0
- package/node_modules/three/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +20 -10
- package/node_modules/three/src/nodes/lighting/IrradianceNode.js +44 -0
- package/node_modules/three/src/nodes/lighting/LightProbeNode.js +73 -0
- package/node_modules/three/src/nodes/lighting/LightUtils.js +25 -0
- package/node_modules/three/src/nodes/lighting/LightingContextNode.js +115 -0
- package/node_modules/three/src/nodes/lighting/LightingNode.js +36 -0
- package/node_modules/three/src/nodes/lighting/LightsNode.js +453 -0
- package/node_modules/three/src/nodes/lighting/PointLightNode.js +102 -0
- package/node_modules/three/src/nodes/lighting/PointShadowNode.js +312 -0
- package/node_modules/three/src/nodes/lighting/ProjectorLightNode.js +91 -0
- package/node_modules/three/src/nodes/lighting/RectAreaLightNode.js +133 -0
- package/node_modules/three/src/nodes/lighting/ShadowBaseNode.js +81 -0
- package/node_modules/three/src/nodes/lighting/ShadowFilterNode.js +276 -0
- package/node_modules/three/src/nodes/lighting/ShadowNode.js +811 -0
- package/node_modules/three/src/nodes/lighting/SpotLightNode.js +168 -0
- package/node_modules/three/src/nodes/materialx/MaterialXNodes.js +197 -0
- package/node_modules/three/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +43 -46
- package/node_modules/three/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +625 -564
- package/node_modules/three/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +3 -9
- package/node_modules/three/src/nodes/math/BitcastNode.js +156 -0
- package/node_modules/three/src/nodes/math/ConditionalNode.js +245 -0
- package/node_modules/three/src/nodes/math/Hash.js +21 -0
- package/node_modules/three/src/nodes/math/MathNode.js +1167 -0
- package/node_modules/three/src/nodes/math/MathUtils.js +54 -0
- package/node_modules/three/src/nodes/math/OperatorNode.js +751 -0
- package/node_modules/three/{examples/jsm → src}/nodes/math/TriNoise3D.js +34 -34
- package/node_modules/three/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +23 -7
- package/node_modules/three/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.js +11 -0
- package/node_modules/three/src/nodes/pmrem/PMREMNode.js +397 -0
- package/node_modules/three/src/nodes/pmrem/PMREMUtils.js +403 -0
- package/node_modules/three/src/nodes/procedural/Checker.js +22 -0
- package/node_modules/three/src/nodes/shapes/Shapes.js +33 -0
- package/node_modules/three/src/nodes/tsl/TSLBase.js +36 -0
- package/node_modules/three/src/nodes/tsl/TSLCore.js +1229 -0
- package/node_modules/three/src/nodes/utils/ArrayElementNode.js +77 -0
- package/node_modules/three/src/nodes/utils/ConvertNode.js +100 -0
- package/node_modules/three/src/nodes/utils/CubeMapNode.js +237 -0
- package/node_modules/three/src/nodes/utils/DebugNode.js +83 -0
- package/node_modules/three/src/nodes/utils/Discard.js +24 -0
- package/node_modules/three/src/nodes/utils/EquirectUV.js +27 -0
- package/node_modules/three/src/nodes/utils/EventNode.js +119 -0
- package/node_modules/three/src/nodes/utils/FlipNode.js +106 -0
- package/node_modules/three/src/nodes/utils/FunctionOverloadingNode.js +170 -0
- package/node_modules/three/src/nodes/utils/JoinNode.js +117 -0
- package/node_modules/three/src/nodes/utils/LoopNode.js +349 -0
- package/node_modules/three/src/nodes/utils/MatcapUV.js +22 -0
- package/node_modules/three/src/nodes/utils/MaxMipLevelNode.js +103 -0
- package/node_modules/three/src/nodes/utils/MemberNode.js +120 -0
- package/node_modules/three/src/nodes/utils/Oscillators.js +41 -0
- package/node_modules/three/src/nodes/utils/Packing.js +21 -0
- package/node_modules/three/src/nodes/utils/PostProcessingUtils.js +122 -0
- package/node_modules/three/src/nodes/utils/RTTNode.js +289 -0
- package/node_modules/three/src/nodes/utils/ReflectorNode.js +630 -0
- package/node_modules/three/src/nodes/utils/RemapNode.js +125 -0
- package/node_modules/three/{examples/jsm → src}/nodes/utils/RotateNode.js +48 -13
- package/node_modules/three/src/nodes/utils/SampleNode.js +91 -0
- package/node_modules/three/{examples/jsm → src}/nodes/utils/SetNode.js +50 -4
- package/node_modules/three/{examples/jsm → src}/nodes/utils/SplitNode.js +73 -6
- package/node_modules/three/src/nodes/utils/SpriteSheetUVNode.js +90 -0
- package/node_modules/three/src/nodes/utils/SpriteUtils.js +63 -0
- package/node_modules/three/src/nodes/utils/StorageArrayElementNode.js +143 -0
- package/node_modules/three/src/nodes/utils/Timer.js +26 -0
- package/node_modules/three/src/nodes/utils/TriplanarTextures.js +65 -0
- package/node_modules/three/src/nodes/utils/UVUtils.js +39 -0
- package/node_modules/three/src/nodes/utils/ViewportUtils.js +26 -0
- package/node_modules/three/src/objects/BatchedMesh.js +940 -305
- package/node_modules/three/src/objects/Bone.js +24 -0
- package/node_modules/three/src/objects/ClippingGroup.js +68 -0
- package/node_modules/three/src/objects/Group.js +24 -0
- package/node_modules/three/src/objects/InstancedMesh.js +182 -1
- package/node_modules/three/src/objects/LOD.js +120 -5
- package/node_modules/three/src/objects/Line.js +151 -44
- package/node_modules/three/src/objects/LineLoop.js +20 -0
- package/node_modules/three/src/objects/LineSegments.js +20 -1
- package/node_modules/three/src/objects/Mesh.js +91 -24
- package/node_modules/three/src/objects/Points.js +62 -0
- package/node_modules/three/src/objects/Skeleton.js +111 -5
- package/node_modules/three/src/objects/SkinnedMesh.js +102 -6
- package/node_modules/three/src/objects/Sprite.js +65 -1
- package/node_modules/three/src/renderers/WebGL3DRenderTarget.js +26 -0
- package/node_modules/three/src/renderers/WebGLArrayRenderTarget.js +26 -0
- package/node_modules/three/src/renderers/WebGLCubeRenderTarget.js +42 -15
- package/node_modules/three/src/renderers/WebGLRenderTarget.js +19 -0
- package/node_modules/three/src/renderers/WebGLRenderer.js +1222 -318
- package/node_modules/three/src/renderers/common/Animation.js +159 -0
- package/node_modules/three/{examples/jsm → src}/renderers/common/Attributes.js +45 -2
- package/node_modules/three/src/renderers/common/Backend.js +748 -0
- package/node_modules/three/src/renderers/common/Background.js +212 -0
- package/node_modules/three/src/renderers/common/BindGroup.js +61 -0
- package/node_modules/three/src/renderers/common/Binding.js +60 -0
- package/node_modules/three/src/renderers/common/Bindings.js +379 -0
- package/node_modules/three/src/renderers/common/Buffer.js +87 -0
- package/node_modules/three/src/renderers/common/BufferUtils.js +58 -0
- package/node_modules/three/src/renderers/common/BundleGroup.js +83 -0
- package/node_modules/three/src/renderers/common/CanvasTarget.js +341 -0
- package/node_modules/three/src/renderers/common/ChainMap.js +98 -0
- package/node_modules/three/src/renderers/common/ClippingContext.js +262 -0
- package/node_modules/three/src/renderers/common/Color4.js +77 -0
- package/node_modules/three/src/renderers/common/ComputePipeline.js +41 -0
- package/node_modules/three/{examples/jsm → src}/renderers/common/Constants.js +2 -1
- package/node_modules/three/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +43 -5
- package/node_modules/three/src/renderers/common/DataMap.js +90 -0
- package/node_modules/three/src/renderers/common/Geometries.js +370 -0
- package/node_modules/three/src/renderers/common/IndirectStorageBufferAttribute.js +38 -0
- package/node_modules/three/src/renderers/common/Info.js +172 -0
- package/node_modules/three/src/renderers/common/InspectorBase.js +146 -0
- package/node_modules/three/src/renderers/common/Lighting.js +73 -0
- package/node_modules/three/src/renderers/common/Pipeline.js +35 -0
- package/node_modules/three/{examples/jsm → src}/renderers/common/Pipelines.js +150 -7
- package/node_modules/three/src/renderers/common/PostProcessing.js +226 -0
- package/node_modules/three/src/renderers/common/ProgrammableStage.js +78 -0
- package/node_modules/three/src/renderers/common/QuadMesh.js +112 -0
- package/node_modules/three/src/renderers/common/RenderBundle.js +24 -0
- package/node_modules/three/src/renderers/common/RenderBundles.js +67 -0
- package/node_modules/three/src/renderers/common/RenderContext.js +265 -0
- package/node_modules/three/src/renderers/common/RenderContexts.js +116 -0
- package/node_modules/three/src/renderers/common/RenderList.js +404 -0
- package/node_modules/three/src/renderers/common/RenderLists.js +77 -0
- package/node_modules/three/src/renderers/common/RenderObject.js +903 -0
- package/node_modules/three/src/renderers/common/RenderObjects.js +202 -0
- package/node_modules/three/src/renderers/common/RenderPipeline.js +40 -0
- package/node_modules/three/src/renderers/common/Renderer.js +3290 -0
- package/node_modules/three/src/renderers/common/RendererUtils.js +200 -0
- package/node_modules/three/src/renderers/common/SampledTexture.js +152 -0
- package/node_modules/three/src/renderers/common/Sampler.js +165 -0
- package/node_modules/three/src/renderers/common/Storage3DTexture.js +100 -0
- package/node_modules/three/src/renderers/common/StorageArrayTexture.js +84 -0
- package/node_modules/three/src/renderers/common/StorageBuffer.js +41 -0
- package/node_modules/three/src/renderers/common/StorageBufferAttribute.js +46 -0
- package/node_modules/three/src/renderers/common/StorageInstancedBufferAttribute.js +46 -0
- package/node_modules/three/src/renderers/common/StorageTexture.js +86 -0
- package/node_modules/three/src/renderers/common/Textures.js +544 -0
- package/node_modules/three/src/renderers/common/TimestampQueryPool.js +161 -0
- package/node_modules/three/src/renderers/common/Uniform.js +367 -0
- package/node_modules/three/src/renderers/common/UniformBuffer.js +34 -0
- package/node_modules/three/src/renderers/common/UniformsGroup.js +487 -0
- package/node_modules/three/src/renderers/common/XRManager.js +1676 -0
- package/node_modules/three/src/renderers/common/XRRenderTarget.js +91 -0
- package/node_modules/three/src/renderers/common/extras/PMREMGenerator.js +1034 -0
- package/node_modules/three/src/renderers/common/nodes/NodeBuilderState.js +152 -0
- package/node_modules/three/src/renderers/common/nodes/NodeLibrary.js +196 -0
- package/node_modules/three/src/renderers/common/nodes/NodeSampledTexture.js +140 -0
- package/node_modules/three/src/renderers/common/nodes/NodeSampler.js +62 -0
- package/node_modules/three/src/renderers/common/nodes/NodeStorageBuffer.js +61 -0
- package/node_modules/three/src/renderers/common/nodes/NodeUniform.js +418 -0
- package/node_modules/three/src/renderers/common/nodes/NodeUniformBuffer.js +53 -0
- package/node_modules/three/src/renderers/common/nodes/NodeUniformsGroup.js +51 -0
- package/node_modules/three/src/renderers/common/nodes/Nodes.js +840 -0
- package/node_modules/three/src/renderers/shaders/DFGLUTData.js +64 -0
- package/node_modules/three/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +31 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +4 -33
- package/node_modules/three/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -22
- package/node_modules/three/src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +8 -0
- package/node_modules/three/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +2 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +3 -3
- package/node_modules/three/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +3 -3
- package/node_modules/three/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +8 -22
- package/node_modules/three/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +6 -0
- package/node_modules/three/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +55 -20
- package/node_modules/three/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +2 -2
- package/node_modules/three/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +3 -11
- package/node_modules/three/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +3 -17
- package/node_modules/three/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +3 -3
- package/node_modules/three/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
- package/node_modules/three/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/node_modules/three/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +12 -24
- package/node_modules/three/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- package/node_modules/three/src/renderers/shaders/ShaderChunk/packing.glsl.js +45 -13
- package/node_modules/three/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +59 -36
- package/node_modules/three/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +3 -0
- package/node_modules/three/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +3 -3
- package/node_modules/three/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +33 -2
- package/node_modules/three/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +47 -13
- package/node_modules/three/src/renderers/shaders/ShaderChunk.js +2 -2
- package/node_modules/three/src/renderers/shaders/ShaderLib/background.glsl.js +1 -1
- package/node_modules/three/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +3 -2
- package/node_modules/three/src/renderers/shaders/ShaderLib/depth.glsl.js +21 -2
- package/node_modules/three/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/linedashed.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshphong.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +5 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/points.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/node_modules/three/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/node_modules/three/src/renderers/shaders/ShaderLib.js +4 -2
- package/node_modules/three/src/renderers/shaders/UniformsLib.js +6 -4
- package/node_modules/three/src/renderers/shaders/UniformsUtils.js +31 -3
- package/node_modules/three/src/renderers/webgl/WebGLAttributes.js +46 -38
- package/node_modules/three/src/renderers/webgl/WebGLBackground.js +69 -5
- package/node_modules/three/src/renderers/webgl/WebGLBindingStates.js +14 -51
- package/node_modules/three/src/renderers/webgl/WebGLBufferRenderer.js +19 -22
- package/node_modules/three/src/renderers/webgl/WebGLCapabilities.js +39 -14
- package/node_modules/three/src/renderers/webgl/WebGLCubeUVMaps.js +10 -6
- package/node_modules/three/src/renderers/webgl/WebGLExtensions.js +8 -44
- package/node_modules/three/src/renderers/webgl/WebGLGeometries.js +0 -28
- package/node_modules/three/src/renderers/webgl/WebGLIndexedBufferRenderer.js +19 -21
- package/node_modules/three/src/renderers/webgl/WebGLInfo.js +3 -1
- package/node_modules/three/src/renderers/webgl/WebGLLights.js +21 -44
- package/node_modules/three/src/renderers/webgl/WebGLMaterials.js +33 -9
- package/node_modules/three/src/renderers/webgl/WebGLMorphtargets.js +78 -210
- package/node_modules/three/src/renderers/webgl/WebGLProgram.js +103 -121
- package/node_modules/three/src/renderers/webgl/WebGLPrograms.js +32 -26
- package/node_modules/three/src/renderers/webgl/WebGLProperties.js +7 -0
- package/node_modules/three/src/renderers/webgl/WebGLRenderStates.js +15 -9
- package/node_modules/three/src/renderers/webgl/WebGLShadowMap.js +41 -29
- package/node_modules/three/src/renderers/webgl/WebGLState.js +104 -100
- package/node_modules/three/src/renderers/webgl/WebGLTextures.js +567 -408
- package/node_modules/three/src/renderers/webgl/WebGLUniforms.js +12 -2
- package/node_modules/three/src/renderers/webgl/WebGLUniformsGroups.js +13 -11
- package/node_modules/three/src/renderers/webgl/WebGLUtils.js +11 -81
- package/node_modules/three/src/renderers/webgl-fallback/WebGLBackend.js +2612 -0
- package/node_modules/three/src/renderers/webgl-fallback/WebGLBufferRenderer.js +140 -0
- package/node_modules/three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +1577 -0
- package/node_modules/three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLAttributeUtils.js +76 -3
- package/node_modules/three/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +64 -0
- package/node_modules/three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLConstants.js +5 -3
- package/node_modules/three/src/renderers/webgl-fallback/utils/WebGLExtensions.js +83 -0
- package/node_modules/three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLState.js +427 -21
- package/node_modules/three/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +1309 -0
- package/node_modules/three/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +396 -0
- package/node_modules/three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +72 -43
- package/node_modules/three/src/renderers/webgpu/WebGPUBackend.js +2482 -0
- package/node_modules/three/src/renderers/webgpu/WebGPURenderer.Nodes.js +69 -0
- package/node_modules/three/src/renderers/webgpu/WebGPURenderer.js +106 -0
- package/node_modules/three/src/renderers/webgpu/nodes/BasicNodeLibrary.js +66 -0
- package/node_modules/three/src/renderers/webgpu/nodes/StandardNodeLibrary.js +100 -0
- package/node_modules/three/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +2247 -0
- package/node_modules/three/src/renderers/webgpu/nodes/WGSLNodeFunction.js +187 -0
- package/node_modules/three/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeParser.js +11 -0
- package/node_modules/three/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +449 -0
- package/node_modules/three/src/renderers/webgpu/utils/WebGPUBindingUtils.js +485 -0
- package/node_modules/three/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +24 -4
- package/node_modules/three/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +289 -72
- package/node_modules/three/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +160 -8
- package/node_modules/three/src/renderers/webgpu/utils/WebGPUTextureUtils.js +1576 -0
- package/node_modules/three/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +310 -0
- package/node_modules/three/src/renderers/webgpu/utils/WebGPUUtils.js +247 -0
- package/node_modules/three/src/renderers/webxr/WebXRController.js +87 -2
- package/node_modules/three/src/renderers/webxr/WebXRDepthSensing.js +63 -13
- package/node_modules/three/src/renderers/webxr/WebXRManager.js +323 -44
- package/node_modules/three/src/scenes/Fog.js +60 -0
- package/node_modules/three/src/scenes/FogExp2.js +51 -0
- package/node_modules/three/src/scenes/Scene.js +103 -1
- package/node_modules/three/src/textures/CanvasTexture.js +28 -0
- package/node_modules/three/src/textures/CompressedArrayTexture.js +71 -0
- package/node_modules/three/src/textures/CompressedCubeTexture.js +29 -0
- package/node_modules/three/src/textures/CompressedTexture.js +64 -6
- package/node_modules/three/src/textures/CubeTexture.js +52 -4
- package/node_modules/three/src/textures/Data3DTexture.js +79 -2
- package/node_modules/three/src/textures/DataArrayTexture.js +107 -0
- package/node_modules/three/src/textures/DataTexture.js +65 -0
- package/node_modules/three/src/textures/DepthTexture.js +59 -13
- package/node_modules/three/src/textures/ExternalTexture.js +56 -0
- package/node_modules/three/src/textures/FramebufferTexture.js +62 -0
- package/node_modules/three/src/textures/Source.js +106 -4
- package/node_modules/three/src/textures/Texture.js +490 -27
- package/node_modules/three/src/textures/VideoFrameTexture.js +72 -0
- package/node_modules/three/src/textures/VideoTexture.js +78 -6
- package/node_modules/three/src/utils.js +128 -3
- package/package.json +3 -2
- package/node_modules/three/examples/jsm/animation/MMDAnimationHelper.js +0 -1207
- package/node_modules/three/examples/jsm/animation/MMDPhysics.js +0 -1406
- package/node_modules/three/examples/jsm/cameras/CinematicCamera.js +0 -208
- package/node_modules/three/examples/jsm/effects/PeppersGhostEffect.js +0 -153
- package/node_modules/three/examples/jsm/exporters/MMDExporter.js +0 -217
- package/node_modules/three/examples/jsm/geometries/InstancedPointsGeometry.js +0 -174
- package/node_modules/three/examples/jsm/geometries/ParametricGeometries.js +0 -254
- package/node_modules/three/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/node_modules/three/examples/jsm/libs/mmdparser.module.js +0 -11530
- package/node_modules/three/examples/jsm/lights/IESSpotLight.js +0 -25
- package/node_modules/three/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/node_modules/three/examples/jsm/loaders/MMDLoader.js +0 -2276
- package/node_modules/three/examples/jsm/loaders/RGBMLoader.js +0 -1065
- package/node_modules/three/examples/jsm/loaders/TiltLoader.js +0 -520
- package/node_modules/three/examples/jsm/misc/Timer.js +0 -128
- package/node_modules/three/examples/jsm/nodes/Nodes.js +0 -193
- package/node_modules/three/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
- package/node_modules/three/examples/jsm/nodes/accessors/BufferAttributeNode.js +0 -127
- package/node_modules/three/examples/jsm/nodes/accessors/BufferNode.js +0 -30
- package/node_modules/three/examples/jsm/nodes/accessors/CameraNode.js +0 -119
- package/node_modules/three/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -61
- package/node_modules/three/examples/jsm/nodes/accessors/InstanceNode.js +0 -71
- package/node_modules/three/examples/jsm/nodes/accessors/InstancedPointsMaterialNode.js +0 -21
- package/node_modules/three/examples/jsm/nodes/accessors/MaterialNode.js +0 -314
- package/node_modules/three/examples/jsm/nodes/accessors/MaterialReferenceNode.js +0 -51
- package/node_modules/three/examples/jsm/nodes/accessors/ModelNode.js +0 -33
- package/node_modules/three/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +0 -39
- package/node_modules/three/examples/jsm/nodes/accessors/NormalNode.js +0 -96
- package/node_modules/three/examples/jsm/nodes/accessors/Object3DNode.js +0 -150
- package/node_modules/three/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
- package/node_modules/three/examples/jsm/nodes/accessors/PositionNode.js +0 -104
- package/node_modules/three/examples/jsm/nodes/accessors/ReferenceNode.js +0 -102
- package/node_modules/three/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
- package/node_modules/three/examples/jsm/nodes/accessors/SceneNode.js +0 -52
- package/node_modules/three/examples/jsm/nodes/accessors/SkinningNode.js +0 -103
- package/node_modules/three/examples/jsm/nodes/accessors/StorageBufferNode.js +0 -54
- package/node_modules/three/examples/jsm/nodes/accessors/TangentNode.js +0 -103
- package/node_modules/three/examples/jsm/nodes/accessors/TextureNode.js +0 -367
- package/node_modules/three/examples/jsm/nodes/accessors/TextureSizeNode.js +0 -35
- package/node_modules/three/examples/jsm/nodes/accessors/TextureStoreNode.js +0 -82
- package/node_modules/three/examples/jsm/nodes/accessors/UVNode.js +0 -47
- package/node_modules/three/examples/jsm/nodes/accessors/UserDataNode.js +0 -29
- package/node_modules/three/examples/jsm/nodes/accessors/VertexColorNode.js +0 -70
- package/node_modules/three/examples/jsm/nodes/code/CodeNode.js +0 -78
- package/node_modules/three/examples/jsm/nodes/code/ExpressionNode.js +0 -37
- package/node_modules/three/examples/jsm/nodes/code/FunctionCallNode.js +0 -96
- package/node_modules/three/examples/jsm/nodes/code/FunctionNode.js +0 -138
- package/node_modules/three/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
- package/node_modules/three/examples/jsm/nodes/core/AssignNode.js +0 -72
- package/node_modules/three/examples/jsm/nodes/core/AttributeNode.js +0 -108
- package/node_modules/three/examples/jsm/nodes/core/BypassNode.js +0 -45
- package/node_modules/three/examples/jsm/nodes/core/CacheNode.js +0 -49
- package/node_modules/three/examples/jsm/nodes/core/ConstNode.js +0 -32
- package/node_modules/three/examples/jsm/nodes/core/ContextNode.js +0 -61
- package/node_modules/three/examples/jsm/nodes/core/IndexNode.js +0 -66
- package/node_modules/three/examples/jsm/nodes/core/InputNode.js +0 -83
- package/node_modules/three/examples/jsm/nodes/core/LightingModel.js +0 -17
- package/node_modules/three/examples/jsm/nodes/core/Node.js +0 -483
- package/node_modules/three/examples/jsm/nodes/core/NodeAttribute.js +0 -15
- package/node_modules/three/examples/jsm/nodes/core/NodeBuilder.js +0 -1256
- package/node_modules/three/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/node_modules/three/examples/jsm/nodes/core/NodeCode.js +0 -15
- package/node_modules/three/examples/jsm/nodes/core/NodeFrame.js +0 -143
- package/node_modules/three/examples/jsm/nodes/core/NodeFunction.js +0 -22
- package/node_modules/three/examples/jsm/nodes/core/NodeFunctionInput.js +0 -17
- package/node_modules/three/examples/jsm/nodes/core/NodeKeywords.js +0 -80
- package/node_modules/three/examples/jsm/nodes/core/NodeParser.js +0 -11
- package/node_modules/three/examples/jsm/nodes/core/NodeUniform.js +0 -40
- package/node_modules/three/examples/jsm/nodes/core/NodeUtils.js +0 -210
- package/node_modules/three/examples/jsm/nodes/core/NodeVar.js +0 -14
- package/node_modules/three/examples/jsm/nodes/core/NodeVarying.js +0 -17
- package/node_modules/three/examples/jsm/nodes/core/OutputStructNode.js +0 -62
- package/node_modules/three/examples/jsm/nodes/core/ParameterNode.js +0 -33
- package/node_modules/three/examples/jsm/nodes/core/PropertyNode.js +0 -72
- package/node_modules/three/examples/jsm/nodes/core/StackNode.js +0 -89
- package/node_modules/three/examples/jsm/nodes/core/StructTypeNode.js +0 -24
- package/node_modules/three/examples/jsm/nodes/core/TempNode.js +0 -58
- package/node_modules/three/examples/jsm/nodes/core/UniformGroup.js +0 -13
- package/node_modules/three/examples/jsm/nodes/core/UniformGroupNode.js +0 -36
- package/node_modules/three/examples/jsm/nodes/core/UniformNode.js +0 -80
- package/node_modules/three/examples/jsm/nodes/core/VarNode.js +0 -60
- package/node_modules/three/examples/jsm/nodes/core/VaryingNode.js +0 -65
- package/node_modules/three/examples/jsm/nodes/core/constants.js +0 -28
- package/node_modules/three/examples/jsm/nodes/display/AfterImageNode.js +0 -148
- package/node_modules/three/examples/jsm/nodes/display/AnamorphicNode.js +0 -148
- package/node_modules/three/examples/jsm/nodes/display/BlendModeNode.js +0 -99
- package/node_modules/three/examples/jsm/nodes/display/BumpMapNode.js +0 -99
- package/node_modules/three/examples/jsm/nodes/display/ColorAdjustmentNode.js +0 -99
- package/node_modules/three/examples/jsm/nodes/display/ColorSpaceNode.js +0 -108
- package/node_modules/three/examples/jsm/nodes/display/FrontFacingNode.js +0 -27
- package/node_modules/three/examples/jsm/nodes/display/GaussianBlurNode.js +0 -190
- package/node_modules/three/examples/jsm/nodes/display/NormalMapNode.js +0 -108
- package/node_modules/three/examples/jsm/nodes/display/PassNode.js +0 -183
- package/node_modules/three/examples/jsm/nodes/display/PosterizeNode.js +0 -32
- package/node_modules/three/examples/jsm/nodes/display/ToneMappingNode.js +0 -184
- package/node_modules/three/examples/jsm/nodes/display/ViewportDepthNode.js +0 -97
- package/node_modules/three/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -31
- package/node_modules/three/examples/jsm/nodes/display/ViewportNode.js +0 -134
- package/node_modules/three/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -31
- package/node_modules/three/examples/jsm/nodes/display/ViewportTextureNode.js +0 -75
- package/node_modules/three/examples/jsm/nodes/fog/FogExp2Node.js +0 -35
- package/node_modules/three/examples/jsm/nodes/fog/FogNode.js +0 -38
- package/node_modules/three/examples/jsm/nodes/fog/FogRangeNode.js +0 -34
- package/node_modules/three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +0 -40
- package/node_modules/three/examples/jsm/nodes/functions/BSDF/DFGApprox.js +0 -30
- package/node_modules/three/examples/jsm/nodes/functions/PhongLightingModel.js +0 -67
- package/node_modules/three/examples/jsm/nodes/functions/PhysicalLightingModel.js +0 -393
- package/node_modules/three/examples/jsm/nodes/functions/material/getGeometryRoughness.js +0 -13
- package/node_modules/three/examples/jsm/nodes/geometry/RangeNode.js +0 -104
- package/node_modules/three/examples/jsm/nodes/gpgpu/ComputeNode.js +0 -85
- package/node_modules/three/examples/jsm/nodes/lighting/AONode.js +0 -27
- package/node_modules/three/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -241
- package/node_modules/three/examples/jsm/nodes/lighting/DirectionalLightNode.js +0 -40
- package/node_modules/three/examples/jsm/nodes/lighting/EnvironmentNode.js +0 -181
- package/node_modules/three/examples/jsm/nodes/lighting/HemisphereLightNode.js +0 -55
- package/node_modules/three/examples/jsm/nodes/lighting/LightNode.js +0 -57
- package/node_modules/three/examples/jsm/nodes/lighting/LightUtils.js +0 -17
- package/node_modules/three/examples/jsm/nodes/lighting/LightingContextNode.js +0 -66
- package/node_modules/three/examples/jsm/nodes/lighting/LightingNode.js +0 -21
- package/node_modules/three/examples/jsm/nodes/lighting/LightsNode.js +0 -188
- package/node_modules/three/examples/jsm/nodes/lighting/PointLightNode.js +0 -68
- package/node_modules/three/examples/jsm/nodes/lighting/SpotLightNode.js +0 -89
- package/node_modules/three/examples/jsm/nodes/loaders/NodeLoader.js +0 -108
- package/node_modules/three/examples/jsm/nodes/loaders/NodeMaterialLoader.js +0 -59
- package/node_modules/three/examples/jsm/nodes/loaders/NodeObjectLoader.js +0 -70
- package/node_modules/three/examples/jsm/nodes/materials/InstancedPointsNodeMaterial.js +0 -162
- package/node_modules/three/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -28
- package/node_modules/three/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +0 -54
- package/node_modules/three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/node_modules/three/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +0 -34
- package/node_modules/three/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -40
- package/node_modules/three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
- package/node_modules/three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +0 -155
- package/node_modules/three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.js +0 -84
- package/node_modules/three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +0 -80
- package/node_modules/three/examples/jsm/nodes/materials/NodeMaterial.js +0 -570
- package/node_modules/three/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -39
- package/node_modules/three/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -90
- package/node_modules/three/examples/jsm/nodes/materialx/MaterialXNodes.js +0 -68
- package/node_modules/three/examples/jsm/nodes/math/CondNode.js +0 -86
- package/node_modules/three/examples/jsm/nodes/math/HashNode.js +0 -34
- package/node_modules/three/examples/jsm/nodes/math/MathNode.js +0 -371
- package/node_modules/three/examples/jsm/nodes/math/MathUtils.js +0 -15
- package/node_modules/three/examples/jsm/nodes/math/OperatorNode.js +0 -274
- package/node_modules/three/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
- package/node_modules/three/examples/jsm/nodes/shadernode/ShaderNode.js +0 -634
- package/node_modules/three/examples/jsm/nodes/utils/ArrayElementNode.js +0 -41
- package/node_modules/three/examples/jsm/nodes/utils/ConvertNode.js +0 -65
- package/node_modules/three/examples/jsm/nodes/utils/DiscardNode.js +0 -27
- package/node_modules/three/examples/jsm/nodes/utils/EquirectUVNode.js +0 -33
- package/node_modules/three/examples/jsm/nodes/utils/FunctionOverloadingNode.js +0 -95
- package/node_modules/three/examples/jsm/nodes/utils/JoinNode.js +0 -61
- package/node_modules/three/examples/jsm/nodes/utils/LoopNode.js +0 -198
- package/node_modules/three/examples/jsm/nodes/utils/MatcapUVNode.js +0 -30
- package/node_modules/three/examples/jsm/nodes/utils/MaxMipLevelNode.js +0 -46
- package/node_modules/three/examples/jsm/nodes/utils/OscNode.js +0 -81
- package/node_modules/three/examples/jsm/nodes/utils/PackingNode.js +0 -55
- package/node_modules/three/examples/jsm/nodes/utils/ReflectorNode.js +0 -227
- package/node_modules/three/examples/jsm/nodes/utils/RemapNode.js +0 -42
- package/node_modules/three/examples/jsm/nodes/utils/RotateUVNode.js +0 -35
- package/node_modules/three/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +0 -37
- package/node_modules/three/examples/jsm/nodes/utils/SpriteSheetUVNode.js +0 -41
- package/node_modules/three/examples/jsm/nodes/utils/TimerNode.js +0 -94
- package/node_modules/three/examples/jsm/nodes/utils/TriplanarTexturesNode.js +0 -62
- package/node_modules/three/examples/jsm/objects/InstancedPoints.js +0 -21
- package/node_modules/three/examples/jsm/objects/QuadMesh.js +0 -66
- package/node_modules/three/examples/jsm/renderers/common/Animation.js +0 -47
- package/node_modules/three/examples/jsm/renderers/common/Backend.js +0 -195
- package/node_modules/three/examples/jsm/renderers/common/Background.js +0 -134
- package/node_modules/three/examples/jsm/renderers/common/Binding.js +0 -25
- package/node_modules/three/examples/jsm/renderers/common/Bindings.js +0 -173
- package/node_modules/three/examples/jsm/renderers/common/Buffer.js +0 -38
- package/node_modules/three/examples/jsm/renderers/common/BufferUtils.js +0 -33
- package/node_modules/three/examples/jsm/renderers/common/ChainMap.js +0 -89
- package/node_modules/three/examples/jsm/renderers/common/Color4.js +0 -37
- package/node_modules/three/examples/jsm/renderers/common/ComputePipeline.js +0 -17
- package/node_modules/three/examples/jsm/renderers/common/DataMap.js +0 -54
- package/node_modules/three/examples/jsm/renderers/common/Geometries.js +0 -215
- package/node_modules/three/examples/jsm/renderers/common/Info.js +0 -107
- package/node_modules/three/examples/jsm/renderers/common/Pipeline.js +0 -13
- package/node_modules/three/examples/jsm/renderers/common/PostProcessing.js +0 -25
- package/node_modules/three/examples/jsm/renderers/common/ProgrammableStage.js +0 -20
- package/node_modules/three/examples/jsm/renderers/common/RenderContext.js +0 -41
- package/node_modules/three/examples/jsm/renderers/common/RenderContexts.js +0 -74
- package/node_modules/three/examples/jsm/renderers/common/RenderList.js +0 -186
- package/node_modules/three/examples/jsm/renderers/common/RenderLists.js +0 -38
- package/node_modules/three/examples/jsm/renderers/common/RenderObject.js +0 -178
- package/node_modules/three/examples/jsm/renderers/common/RenderObjects.js +0 -91
- package/node_modules/three/examples/jsm/renderers/common/RenderPipeline.js +0 -16
- package/node_modules/three/examples/jsm/renderers/common/Renderer.js +0 -1247
- package/node_modules/three/examples/jsm/renderers/common/SampledTexture.js +0 -83
- package/node_modules/three/examples/jsm/renderers/common/Sampler.js +0 -18
- package/node_modules/three/examples/jsm/renderers/common/StorageBuffer.js +0 -17
- package/node_modules/three/examples/jsm/renderers/common/StorageBufferAttribute.js +0 -17
- package/node_modules/three/examples/jsm/renderers/common/StorageTexture.js +0 -20
- package/node_modules/three/examples/jsm/renderers/common/Textures.js +0 -354
- package/node_modules/three/examples/jsm/renderers/common/Uniform.js +0 -140
- package/node_modules/three/examples/jsm/renderers/common/UniformBuffer.js +0 -15
- package/node_modules/three/examples/jsm/renderers/common/UniformsGroup.js +0 -299
- package/node_modules/three/examples/jsm/renderers/common/nodes/NodeBuilderState.js +0 -44
- package/node_modules/three/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +0 -49
- package/node_modules/three/examples/jsm/renderers/common/nodes/NodeSampler.js +0 -15
- package/node_modules/three/examples/jsm/renderers/common/nodes/NodeUniform.js +0 -135
- package/node_modules/three/examples/jsm/renderers/common/nodes/NodeUniformsGroup.js +0 -44
- package/node_modules/three/examples/jsm/renderers/common/nodes/Nodes.js +0 -495
- package/node_modules/three/examples/jsm/renderers/webgl/WebGLBackend.js +0 -1362
- package/node_modules/three/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +0 -679
- package/node_modules/three/examples/jsm/renderers/webgl/utils/WebGLCapabilities.js +0 -36
- package/node_modules/three/examples/jsm/renderers/webgl/utils/WebGLExtensions.js +0 -36
- package/node_modules/three/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +0 -647
- package/node_modules/three/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +0 -320
- package/node_modules/three/examples/jsm/renderers/webgl-legacy/nodes/SlotNode.js +0 -26
- package/node_modules/three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +0 -794
- package/node_modules/three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +0 -51
- package/node_modules/three/examples/jsm/renderers/webgpu/WebGPUBackend.js +0 -1321
- package/node_modules/three/examples/jsm/renderers/webgpu/WebGPURenderer.js +0 -53
- package/node_modules/three/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +0 -1103
- package/node_modules/three/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- package/node_modules/three/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +0 -287
- package/node_modules/three/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +0 -244
- package/node_modules/three/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +0 -1040
- package/node_modules/three/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +0 -93
- package/node_modules/three/examples/jsm/shaders/MMDToonShader.js +0 -134
- package/node_modules/three/examples/jsm/utils/GPUStatsPanel.js +0 -128
- package/node_modules/three/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/node_modules/three/src/renderers/WebGL1Renderer.js +0 -7
- package/node_modules/three/src/renderers/WebGLMultipleRenderTargets.js +0 -82
- package/node_modules/three/src/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js +0 -10
- /package/node_modules/three/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
|
@@ -0,0 +1,1576 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GPUTextureFormat, GPUAddressMode, GPUFilterMode, GPUTextureDimension, GPUFeatureName, GPUTextureViewDimension
|
|
3
|
+
} from './WebGPUConstants.js';
|
|
4
|
+
import { ColorManagement } from '../../../math/ColorManagement.js';
|
|
5
|
+
|
|
6
|
+
import WebGPUTexturePassUtils from './WebGPUTexturePassUtils.js';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
ByteType, ShortType,
|
|
10
|
+
NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter,
|
|
11
|
+
RepeatWrapping, MirroredRepeatWrapping,
|
|
12
|
+
RGB_ETC2_Format, RGBA_ETC2_EAC_Format,
|
|
13
|
+
RGBAFormat, RGBFormat, RedFormat, RGFormat, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, UnsignedByteType, FloatType, HalfFloatType, SRGBTransfer, DepthFormat, DepthStencilFormat,
|
|
14
|
+
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,
|
|
15
|
+
RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, UnsignedIntType, UnsignedShortType, UnsignedInt248Type, UnsignedInt5999Type,
|
|
16
|
+
NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare, IntType, RedIntegerFormat, RGIntegerFormat, RGBAIntegerFormat,
|
|
17
|
+
UnsignedInt101111Type, RGBA_BPTC_Format, RGB_ETC1_Format, RGB_S3TC_DXT1_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format
|
|
18
|
+
} from '../../../constants.js';
|
|
19
|
+
import { CubeTexture } from '../../../textures/CubeTexture.js';
|
|
20
|
+
import { Texture } from '../../../textures/Texture.js';
|
|
21
|
+
import { warn, error } from '../../../utils.js';
|
|
22
|
+
|
|
23
|
+
const _compareToWebGPU = {
|
|
24
|
+
[ NeverCompare ]: 'never',
|
|
25
|
+
[ LessCompare ]: 'less',
|
|
26
|
+
[ EqualCompare ]: 'equal',
|
|
27
|
+
[ LessEqualCompare ]: 'less-equal',
|
|
28
|
+
[ GreaterCompare ]: 'greater',
|
|
29
|
+
[ GreaterEqualCompare ]: 'greater-equal',
|
|
30
|
+
[ AlwaysCompare ]: 'always',
|
|
31
|
+
[ NotEqualCompare ]: 'not-equal'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const _flipMap = [ 0, 1, 3, 2, 4, 5 ];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A WebGPU backend utility module for managing textures.
|
|
38
|
+
*
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
class WebGPUTextureUtils {
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Constructs a new utility object.
|
|
45
|
+
*
|
|
46
|
+
* @param {WebGPUBackend} backend - The WebGPU backend.
|
|
47
|
+
*/
|
|
48
|
+
constructor( backend ) {
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A reference to the WebGPU backend.
|
|
52
|
+
*
|
|
53
|
+
* @type {WebGPUBackend}
|
|
54
|
+
*/
|
|
55
|
+
this.backend = backend;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A reference to the pass utils.
|
|
59
|
+
*
|
|
60
|
+
* @type {?WebGPUTexturePassUtils}
|
|
61
|
+
* @default null
|
|
62
|
+
*/
|
|
63
|
+
this._passUtils = null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A dictionary for managing default textures. The key
|
|
67
|
+
* is the texture format, the value the texture object.
|
|
68
|
+
*
|
|
69
|
+
* @type {Object<string,Texture>}
|
|
70
|
+
*/
|
|
71
|
+
this.defaultTexture = {};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A dictionary for managing default cube textures. The key
|
|
75
|
+
* is the texture format, the value the texture object.
|
|
76
|
+
*
|
|
77
|
+
* @type {Object<string,CubeTexture>}
|
|
78
|
+
*/
|
|
79
|
+
this.defaultCubeTexture = {};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A default video frame.
|
|
83
|
+
*
|
|
84
|
+
* @type {?VideoFrame}
|
|
85
|
+
* @default null
|
|
86
|
+
*/
|
|
87
|
+
this.defaultVideoFrame = null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A cache of shared texture samplers.
|
|
91
|
+
*
|
|
92
|
+
* @type {Map<string, Object>}
|
|
93
|
+
*/
|
|
94
|
+
this._samplerCache = new Map();
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Creates a GPU sampler for the given texture.
|
|
100
|
+
*
|
|
101
|
+
* @param {Texture} texture - The texture to create the sampler for.
|
|
102
|
+
* @return {string} The current sampler key.
|
|
103
|
+
*/
|
|
104
|
+
updateSampler( texture ) {
|
|
105
|
+
|
|
106
|
+
const backend = this.backend;
|
|
107
|
+
|
|
108
|
+
const samplerKey = texture.minFilter + '-' + texture.magFilter + '-' +
|
|
109
|
+
texture.wrapS + '-' + texture.wrapT + '-' + ( texture.wrapR || '0' ) + '-' +
|
|
110
|
+
texture.anisotropy + '-' + ( texture.compareFunction || 0 );
|
|
111
|
+
|
|
112
|
+
let samplerData = this._samplerCache.get( samplerKey );
|
|
113
|
+
|
|
114
|
+
if ( samplerData === undefined ) {
|
|
115
|
+
|
|
116
|
+
const samplerDescriptorGPU = {
|
|
117
|
+
addressModeU: this._convertAddressMode( texture.wrapS ),
|
|
118
|
+
addressModeV: this._convertAddressMode( texture.wrapT ),
|
|
119
|
+
addressModeW: this._convertAddressMode( texture.wrapR ),
|
|
120
|
+
magFilter: this._convertFilterMode( texture.magFilter ),
|
|
121
|
+
minFilter: this._convertFilterMode( texture.minFilter ),
|
|
122
|
+
mipmapFilter: this._convertFilterMode( texture.minFilter ),
|
|
123
|
+
maxAnisotropy: 1
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// anisotropy can only be used when all filter modes are set to linear.
|
|
127
|
+
|
|
128
|
+
if ( samplerDescriptorGPU.magFilter === GPUFilterMode.Linear && samplerDescriptorGPU.minFilter === GPUFilterMode.Linear && samplerDescriptorGPU.mipmapFilter === GPUFilterMode.Linear ) {
|
|
129
|
+
|
|
130
|
+
samplerDescriptorGPU.maxAnisotropy = texture.anisotropy;
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if ( texture.isDepthTexture && texture.compareFunction !== null ) {
|
|
135
|
+
|
|
136
|
+
samplerDescriptorGPU.compare = _compareToWebGPU[ texture.compareFunction ];
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const sampler = backend.device.createSampler( samplerDescriptorGPU );
|
|
141
|
+
|
|
142
|
+
samplerData = { sampler, usedTimes: 0 };
|
|
143
|
+
|
|
144
|
+
this._samplerCache.set( samplerKey, samplerData );
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const textureData = backend.get( texture );
|
|
149
|
+
|
|
150
|
+
if ( textureData.sampler !== samplerData.sampler ) {
|
|
151
|
+
|
|
152
|
+
// check if previous sampler is unused so it can be deleted
|
|
153
|
+
|
|
154
|
+
if ( textureData.sampler !== undefined ) {
|
|
155
|
+
|
|
156
|
+
const oldSamplerData = this._samplerCache.get( textureData.samplerKey );
|
|
157
|
+
oldSamplerData.usedTimes --;
|
|
158
|
+
|
|
159
|
+
if ( oldSamplerData.usedTimes === 0 ) {
|
|
160
|
+
|
|
161
|
+
this._samplerCache.delete( textureData.samplerKey );
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// update to new sampler data
|
|
168
|
+
|
|
169
|
+
textureData.samplerKey = samplerKey;
|
|
170
|
+
textureData.sampler = samplerData.sampler;
|
|
171
|
+
|
|
172
|
+
samplerData.usedTimes ++;
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return samplerKey;
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Creates a default texture for the given texture that can be used
|
|
182
|
+
* as a placeholder until the actual texture is ready for usage.
|
|
183
|
+
*
|
|
184
|
+
* @param {Texture} texture - The texture to create a default texture for.
|
|
185
|
+
*/
|
|
186
|
+
createDefaultTexture( texture ) {
|
|
187
|
+
|
|
188
|
+
let textureGPU;
|
|
189
|
+
|
|
190
|
+
const format = getFormat( texture );
|
|
191
|
+
|
|
192
|
+
if ( texture.isCubeTexture ) {
|
|
193
|
+
|
|
194
|
+
textureGPU = this._getDefaultCubeTextureGPU( format );
|
|
195
|
+
|
|
196
|
+
} else {
|
|
197
|
+
|
|
198
|
+
textureGPU = this._getDefaultTextureGPU( format );
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
this.backend.get( texture ).texture = textureGPU;
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Defines a texture on the GPU for the given texture object.
|
|
208
|
+
*
|
|
209
|
+
* @param {Texture} texture - The texture.
|
|
210
|
+
* @param {Object} [options={}] - Optional configuration parameter.
|
|
211
|
+
*/
|
|
212
|
+
createTexture( texture, options = {} ) {
|
|
213
|
+
|
|
214
|
+
const backend = this.backend;
|
|
215
|
+
const textureData = backend.get( texture );
|
|
216
|
+
|
|
217
|
+
if ( textureData.initialized ) {
|
|
218
|
+
|
|
219
|
+
throw new Error( 'WebGPUTextureUtils: Texture already initialized.' );
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if ( texture.isExternalTexture ) {
|
|
224
|
+
|
|
225
|
+
textureData.texture = texture.sourceTexture;
|
|
226
|
+
textureData.initialized = true;
|
|
227
|
+
|
|
228
|
+
return;
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if ( options.needsMipmaps === undefined ) options.needsMipmaps = false;
|
|
233
|
+
if ( options.levels === undefined ) options.levels = 1;
|
|
234
|
+
if ( options.depth === undefined ) options.depth = 1;
|
|
235
|
+
|
|
236
|
+
const { width, height, depth, levels } = options;
|
|
237
|
+
|
|
238
|
+
if ( texture.isFramebufferTexture ) {
|
|
239
|
+
|
|
240
|
+
if ( options.renderTarget ) {
|
|
241
|
+
|
|
242
|
+
options.format = this.backend.utils.getCurrentColorFormat( options.renderTarget );
|
|
243
|
+
|
|
244
|
+
} else {
|
|
245
|
+
|
|
246
|
+
options.format = this.backend.utils.getPreferredCanvasFormat();
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const dimension = this._getDimension( texture );
|
|
253
|
+
const format = texture.internalFormat || options.format || getFormat( texture, backend.device );
|
|
254
|
+
|
|
255
|
+
textureData.format = format;
|
|
256
|
+
|
|
257
|
+
const { samples, primarySamples, isMSAA } = backend.utils.getTextureSampleData( texture );
|
|
258
|
+
|
|
259
|
+
let usage = GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC;
|
|
260
|
+
|
|
261
|
+
if ( texture.isStorageTexture === true ) {
|
|
262
|
+
|
|
263
|
+
usage |= GPUTextureUsage.STORAGE_BINDING;
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if ( texture.isCompressedTexture !== true && texture.isCompressedArrayTexture !== true && format !== GPUTextureFormat.RGB9E5UFloat ) {
|
|
268
|
+
|
|
269
|
+
usage |= GPUTextureUsage.RENDER_ATTACHMENT;
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const textureDescriptorGPU = {
|
|
274
|
+
label: texture.name,
|
|
275
|
+
size: {
|
|
276
|
+
width: width,
|
|
277
|
+
height: height,
|
|
278
|
+
depthOrArrayLayers: depth,
|
|
279
|
+
},
|
|
280
|
+
mipLevelCount: levels,
|
|
281
|
+
sampleCount: primarySamples,
|
|
282
|
+
dimension: dimension,
|
|
283
|
+
format: format,
|
|
284
|
+
usage: usage
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// texture creation
|
|
288
|
+
|
|
289
|
+
if ( format === undefined ) {
|
|
290
|
+
|
|
291
|
+
warn( 'WebGPURenderer: Texture format not supported.' );
|
|
292
|
+
|
|
293
|
+
this.createDefaultTexture( texture );
|
|
294
|
+
return;
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if ( texture.isCubeTexture ) {
|
|
299
|
+
|
|
300
|
+
textureDescriptorGPU.textureBindingViewDimension = GPUTextureViewDimension.Cube;
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
textureData.texture = backend.device.createTexture( textureDescriptorGPU );
|
|
305
|
+
|
|
306
|
+
if ( isMSAA ) {
|
|
307
|
+
|
|
308
|
+
const msaaTextureDescriptorGPU = Object.assign( {}, textureDescriptorGPU );
|
|
309
|
+
|
|
310
|
+
msaaTextureDescriptorGPU.label = msaaTextureDescriptorGPU.label + '-msaa';
|
|
311
|
+
msaaTextureDescriptorGPU.sampleCount = samples;
|
|
312
|
+
msaaTextureDescriptorGPU.mipLevelCount = 1; // See https://www.w3.org/TR/webgpu/#texture-creation
|
|
313
|
+
|
|
314
|
+
textureData.msaaTexture = backend.device.createTexture( msaaTextureDescriptorGPU );
|
|
315
|
+
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
textureData.initialized = true;
|
|
319
|
+
|
|
320
|
+
textureData.textureDescriptorGPU = textureDescriptorGPU;
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Destroys the GPU data for the given texture object.
|
|
326
|
+
*
|
|
327
|
+
* @param {Texture} texture - The texture.
|
|
328
|
+
* @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not.
|
|
329
|
+
*/
|
|
330
|
+
destroyTexture( texture, isDefaultTexture = false ) {
|
|
331
|
+
|
|
332
|
+
const backend = this.backend;
|
|
333
|
+
const textureData = backend.get( texture );
|
|
334
|
+
|
|
335
|
+
if ( textureData.texture !== undefined && isDefaultTexture === false ) textureData.texture.destroy();
|
|
336
|
+
|
|
337
|
+
if ( textureData.msaaTexture !== undefined ) textureData.msaaTexture.destroy();
|
|
338
|
+
|
|
339
|
+
backend.delete( texture );
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Generates mipmaps for the given texture.
|
|
345
|
+
*
|
|
346
|
+
* @param {Texture} texture - The texture.
|
|
347
|
+
* @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps.
|
|
348
|
+
*/
|
|
349
|
+
generateMipmaps( texture, encoder = null ) {
|
|
350
|
+
|
|
351
|
+
const textureData = this.backend.get( texture );
|
|
352
|
+
|
|
353
|
+
if ( texture.isCubeTexture ) {
|
|
354
|
+
|
|
355
|
+
for ( let i = 0; i < 6; i ++ ) {
|
|
356
|
+
|
|
357
|
+
this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i, encoder );
|
|
358
|
+
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
} else {
|
|
362
|
+
|
|
363
|
+
const depth = texture.image.depth || 1;
|
|
364
|
+
|
|
365
|
+
for ( let i = 0; i < depth; i ++ ) {
|
|
366
|
+
|
|
367
|
+
this._generateMipmaps( textureData.texture, textureData.textureDescriptorGPU, i, encoder );
|
|
368
|
+
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Returns the color buffer representing the color
|
|
377
|
+
* attachment of the default framebuffer.
|
|
378
|
+
*
|
|
379
|
+
* @return {GPUTexture} The color buffer.
|
|
380
|
+
*/
|
|
381
|
+
getColorBuffer() {
|
|
382
|
+
|
|
383
|
+
const backend = this.backend;
|
|
384
|
+
const canvasTarget = backend.renderer.getCanvasTarget();
|
|
385
|
+
const { width, height } = backend.getDrawingBufferSize();
|
|
386
|
+
const samples = backend.renderer.currentSamples;
|
|
387
|
+
|
|
388
|
+
const colorTexture = canvasTarget.colorTexture;
|
|
389
|
+
const colorTextureData = backend.get( colorTexture );
|
|
390
|
+
|
|
391
|
+
if ( colorTexture.width === width && colorTexture.height === height && colorTexture.samples === samples ) {
|
|
392
|
+
|
|
393
|
+
return colorTextureData.texture;
|
|
394
|
+
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// recreate
|
|
398
|
+
|
|
399
|
+
let colorBuffer = colorTextureData.texture;
|
|
400
|
+
|
|
401
|
+
if ( colorBuffer ) colorBuffer.destroy();
|
|
402
|
+
|
|
403
|
+
colorBuffer = backend.device.createTexture( {
|
|
404
|
+
label: 'colorBuffer',
|
|
405
|
+
size: {
|
|
406
|
+
width: width,
|
|
407
|
+
height: height,
|
|
408
|
+
depthOrArrayLayers: 1
|
|
409
|
+
},
|
|
410
|
+
sampleCount: backend.utils.getSampleCount( backend.renderer.currentSamples ),
|
|
411
|
+
format: backend.utils.getPreferredCanvasFormat(),
|
|
412
|
+
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC
|
|
413
|
+
} );
|
|
414
|
+
|
|
415
|
+
//
|
|
416
|
+
|
|
417
|
+
colorTexture.source.width = width;
|
|
418
|
+
colorTexture.source.height = height;
|
|
419
|
+
colorTexture.samples = samples;
|
|
420
|
+
|
|
421
|
+
colorTextureData.texture = colorBuffer;
|
|
422
|
+
|
|
423
|
+
return colorBuffer;
|
|
424
|
+
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Returns the depth buffer representing the depth
|
|
429
|
+
* attachment of the default framebuffer.
|
|
430
|
+
*
|
|
431
|
+
* @param {boolean} [depth=true] - Whether depth is enabled or not.
|
|
432
|
+
* @param {boolean} [stencil=false] - Whether stencil is enabled or not.
|
|
433
|
+
* @return {GPUTexture} The depth buffer.
|
|
434
|
+
*/
|
|
435
|
+
getDepthBuffer( depth = true, stencil = false ) {
|
|
436
|
+
|
|
437
|
+
const backend = this.backend;
|
|
438
|
+
const canvasTarget = backend.renderer.getCanvasTarget();
|
|
439
|
+
const { width, height } = backend.getDrawingBufferSize();
|
|
440
|
+
const samples = backend.renderer.currentSamples;
|
|
441
|
+
|
|
442
|
+
const depthTexture = canvasTarget.depthTexture;
|
|
443
|
+
|
|
444
|
+
if ( depthTexture.width === width &&
|
|
445
|
+
depthTexture.height === height &&
|
|
446
|
+
depthTexture.samples === samples &&
|
|
447
|
+
depthTexture.depth === depth &&
|
|
448
|
+
depthTexture.stencil === stencil ) {
|
|
449
|
+
|
|
450
|
+
return backend.get( depthTexture ).texture;
|
|
451
|
+
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
//
|
|
455
|
+
|
|
456
|
+
const depthTextureGPU = backend.get( depthTexture ).texture;
|
|
457
|
+
|
|
458
|
+
let format, type;
|
|
459
|
+
|
|
460
|
+
if ( stencil ) {
|
|
461
|
+
|
|
462
|
+
format = DepthStencilFormat;
|
|
463
|
+
type = UnsignedInt248Type;
|
|
464
|
+
|
|
465
|
+
} else if ( depth ) {
|
|
466
|
+
|
|
467
|
+
format = DepthFormat;
|
|
468
|
+
type = UnsignedIntType;
|
|
469
|
+
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if ( depthTextureGPU !== undefined ) {
|
|
473
|
+
|
|
474
|
+
if ( depthTexture.image.width === width && depthTexture.image.height === height && depthTexture.format === format && depthTexture.type === type && depthTexture.samples === samples ) {
|
|
475
|
+
|
|
476
|
+
return depthTextureGPU;
|
|
477
|
+
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
this.destroyTexture( depthTexture );
|
|
481
|
+
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// recreate
|
|
485
|
+
|
|
486
|
+
depthTexture.name = 'depthBuffer';
|
|
487
|
+
depthTexture.format = format;
|
|
488
|
+
depthTexture.type = type;
|
|
489
|
+
depthTexture.image.width = width;
|
|
490
|
+
depthTexture.image.height = height;
|
|
491
|
+
depthTexture.samples = samples;
|
|
492
|
+
|
|
493
|
+
this.createTexture( depthTexture, { width, height } );
|
|
494
|
+
|
|
495
|
+
return backend.get( depthTexture ).texture;
|
|
496
|
+
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Uploads the updated texture data to the GPU.
|
|
501
|
+
*
|
|
502
|
+
* @param {Texture} texture - The texture.
|
|
503
|
+
* @param {Object} [options={}] - Optional configuration parameter.
|
|
504
|
+
*/
|
|
505
|
+
updateTexture( texture, options ) {
|
|
506
|
+
|
|
507
|
+
const textureData = this.backend.get( texture );
|
|
508
|
+
const mipmaps = texture.mipmaps;
|
|
509
|
+
|
|
510
|
+
const { textureDescriptorGPU } = textureData;
|
|
511
|
+
|
|
512
|
+
if ( texture.isRenderTargetTexture || ( textureDescriptorGPU === undefined /* unsupported texture format */ ) )
|
|
513
|
+
return;
|
|
514
|
+
|
|
515
|
+
// transfer texture data
|
|
516
|
+
|
|
517
|
+
if ( texture.isDataTexture ) {
|
|
518
|
+
|
|
519
|
+
if ( mipmaps.length > 0 ) {
|
|
520
|
+
|
|
521
|
+
for ( let i = 0, il = mipmaps.length; i < il; i ++ ) {
|
|
522
|
+
|
|
523
|
+
const mipmap = mipmaps[ i ];
|
|
524
|
+
|
|
525
|
+
this._copyBufferToTexture( mipmap, textureData.texture, textureDescriptorGPU, 0, texture.flipY, 0, i );
|
|
526
|
+
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
} else {
|
|
531
|
+
|
|
532
|
+
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, texture.flipY );
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
} else if ( texture.isArrayTexture || texture.isDataArrayTexture || texture.isData3DTexture ) {
|
|
537
|
+
|
|
538
|
+
for ( let i = 0; i < options.image.depth; i ++ ) {
|
|
539
|
+
|
|
540
|
+
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, i, texture.flipY, i );
|
|
541
|
+
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
} else if ( texture.isCompressedTexture || texture.isCompressedArrayTexture ) {
|
|
545
|
+
|
|
546
|
+
this._copyCompressedBufferToTexture( texture.mipmaps, textureData.texture, textureDescriptorGPU );
|
|
547
|
+
|
|
548
|
+
} else if ( texture.isCubeTexture ) {
|
|
549
|
+
|
|
550
|
+
this._copyCubeMapToTexture( texture, textureData.texture, textureDescriptorGPU );
|
|
551
|
+
|
|
552
|
+
} else {
|
|
553
|
+
|
|
554
|
+
if ( mipmaps.length > 0 ) {
|
|
555
|
+
|
|
556
|
+
for ( let i = 0, il = mipmaps.length; i < il; i ++ ) {
|
|
557
|
+
|
|
558
|
+
const mipmap = mipmaps[ i ];
|
|
559
|
+
|
|
560
|
+
this._copyImageToTexture( mipmap, textureData.texture, textureDescriptorGPU, 0, texture.flipY, texture.premultiplyAlpha, i );
|
|
561
|
+
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
} else {
|
|
566
|
+
|
|
567
|
+
this._copyImageToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, texture.flipY, texture.premultiplyAlpha );
|
|
568
|
+
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
//
|
|
574
|
+
|
|
575
|
+
textureData.version = texture.version;
|
|
576
|
+
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Returns texture data as a typed array.
|
|
581
|
+
*
|
|
582
|
+
* @async
|
|
583
|
+
* @param {Texture} texture - The texture to copy.
|
|
584
|
+
* @param {number} x - The x coordinate of the copy origin.
|
|
585
|
+
* @param {number} y - The y coordinate of the copy origin.
|
|
586
|
+
* @param {number} width - The width of the copy.
|
|
587
|
+
* @param {number} height - The height of the copy.
|
|
588
|
+
* @param {number} faceIndex - The face index.
|
|
589
|
+
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
|
|
590
|
+
*/
|
|
591
|
+
async copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {
|
|
592
|
+
|
|
593
|
+
const device = this.backend.device;
|
|
594
|
+
|
|
595
|
+
const textureData = this.backend.get( texture );
|
|
596
|
+
const textureGPU = textureData.texture;
|
|
597
|
+
const format = textureData.textureDescriptorGPU.format;
|
|
598
|
+
const bytesPerTexel = this._getBytesPerTexel( format );
|
|
599
|
+
|
|
600
|
+
let bytesPerRow = width * bytesPerTexel;
|
|
601
|
+
bytesPerRow = Math.ceil( bytesPerRow / 256 ) * 256; // Align to 256 bytes
|
|
602
|
+
|
|
603
|
+
const readBuffer = device.createBuffer(
|
|
604
|
+
{
|
|
605
|
+
size: ( ( height - 1 ) * bytesPerRow ) + ( width * bytesPerTexel ), // see https://github.com/mrdoob/three.js/issues/31658#issuecomment-3229442010
|
|
606
|
+
usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ
|
|
607
|
+
}
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
const encoder = device.createCommandEncoder();
|
|
611
|
+
|
|
612
|
+
encoder.copyTextureToBuffer(
|
|
613
|
+
{
|
|
614
|
+
texture: textureGPU,
|
|
615
|
+
origin: { x, y, z: faceIndex },
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
buffer: readBuffer,
|
|
619
|
+
bytesPerRow: bytesPerRow
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
width: width,
|
|
623
|
+
height: height
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
);
|
|
627
|
+
|
|
628
|
+
const typedArrayType = this._getTypedArrayType( format );
|
|
629
|
+
|
|
630
|
+
device.queue.submit( [ encoder.finish() ] );
|
|
631
|
+
|
|
632
|
+
await readBuffer.mapAsync( GPUMapMode.READ );
|
|
633
|
+
|
|
634
|
+
const buffer = readBuffer.getMappedRange();
|
|
635
|
+
|
|
636
|
+
return new typedArrayType( buffer );
|
|
637
|
+
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Frees all internal resources.
|
|
642
|
+
*/
|
|
643
|
+
dispose() {
|
|
644
|
+
|
|
645
|
+
this._samplerCache.clear();
|
|
646
|
+
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Returns the default GPU texture for the given format.
|
|
651
|
+
*
|
|
652
|
+
* @private
|
|
653
|
+
* @param {string} format - The GPU format.
|
|
654
|
+
* @return {GPUTexture} The GPU texture.
|
|
655
|
+
*/
|
|
656
|
+
_getDefaultTextureGPU( format ) {
|
|
657
|
+
|
|
658
|
+
let defaultTexture = this.defaultTexture[ format ];
|
|
659
|
+
|
|
660
|
+
if ( defaultTexture === undefined ) {
|
|
661
|
+
|
|
662
|
+
const texture = new Texture();
|
|
663
|
+
texture.minFilter = NearestFilter;
|
|
664
|
+
texture.magFilter = NearestFilter;
|
|
665
|
+
|
|
666
|
+
this.createTexture( texture, { width: 1, height: 1, format } );
|
|
667
|
+
|
|
668
|
+
this.defaultTexture[ format ] = defaultTexture = texture;
|
|
669
|
+
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
return this.backend.get( defaultTexture ).texture;
|
|
673
|
+
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Returns the default GPU cube texture for the given format.
|
|
678
|
+
*
|
|
679
|
+
* @private
|
|
680
|
+
* @param {string} format - The GPU format.
|
|
681
|
+
* @return {GPUTexture} The GPU texture.
|
|
682
|
+
*/
|
|
683
|
+
_getDefaultCubeTextureGPU( format ) {
|
|
684
|
+
|
|
685
|
+
let defaultCubeTexture = this.defaultTexture[ format ];
|
|
686
|
+
|
|
687
|
+
if ( defaultCubeTexture === undefined ) {
|
|
688
|
+
|
|
689
|
+
const texture = new CubeTexture();
|
|
690
|
+
texture.minFilter = NearestFilter;
|
|
691
|
+
texture.magFilter = NearestFilter;
|
|
692
|
+
|
|
693
|
+
this.createTexture( texture, { width: 1, height: 1, depth: 6 } );
|
|
694
|
+
|
|
695
|
+
this.defaultCubeTexture[ format ] = defaultCubeTexture = texture;
|
|
696
|
+
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return this.backend.get( defaultCubeTexture ).texture;
|
|
700
|
+
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Uploads cube texture image data to the GPU memory.
|
|
705
|
+
*
|
|
706
|
+
* @private
|
|
707
|
+
* @param {CubeTexture} texture - The cube texture.
|
|
708
|
+
* @param {GPUTexture} textureGPU - The GPU texture.
|
|
709
|
+
* @param {Object} textureDescriptorGPU - The GPU texture descriptor.
|
|
710
|
+
*/
|
|
711
|
+
_copyCubeMapToTexture( texture, textureGPU, textureDescriptorGPU ) {
|
|
712
|
+
|
|
713
|
+
const images = texture.images;
|
|
714
|
+
const mipmaps = texture.mipmaps;
|
|
715
|
+
|
|
716
|
+
for ( let i = 0; i < 6; i ++ ) {
|
|
717
|
+
|
|
718
|
+
const image = images[ i ];
|
|
719
|
+
|
|
720
|
+
const flipIndex = texture.flipY === true ? _flipMap[ i ] : i;
|
|
721
|
+
|
|
722
|
+
if ( image.isDataTexture ) {
|
|
723
|
+
|
|
724
|
+
this._copyBufferToTexture( image.image, textureGPU, textureDescriptorGPU, flipIndex, texture.flipY );
|
|
725
|
+
|
|
726
|
+
} else {
|
|
727
|
+
|
|
728
|
+
this._copyImageToTexture( image, textureGPU, textureDescriptorGPU, flipIndex, texture.flipY, texture.premultiplyAlpha );
|
|
729
|
+
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
for ( let j = 0; j < mipmaps.length; j ++ ) {
|
|
733
|
+
|
|
734
|
+
const mipmap = mipmaps[ j ];
|
|
735
|
+
const image = mipmap.images[ i ];
|
|
736
|
+
|
|
737
|
+
if ( image.isDataTexture ) {
|
|
738
|
+
|
|
739
|
+
this._copyBufferToTexture( image.image, textureGPU, textureDescriptorGPU, flipIndex, texture.flipY, 0, j + 1 );
|
|
740
|
+
|
|
741
|
+
} else {
|
|
742
|
+
|
|
743
|
+
this._copyImageToTexture( image, textureGPU, textureDescriptorGPU, flipIndex, texture.flipY, texture.premultiplyAlpha, j + 1 );
|
|
744
|
+
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Uploads texture image data to the GPU memory.
|
|
756
|
+
*
|
|
757
|
+
* @private
|
|
758
|
+
* @param {HTMLImageElement|ImageBitmap|HTMLCanvasElement} image - The image data.
|
|
759
|
+
* @param {GPUTexture} textureGPU - The GPU texture.
|
|
760
|
+
* @param {Object} textureDescriptorGPU - The GPU texture descriptor.
|
|
761
|
+
* @param {number} originDepth - The origin depth.
|
|
762
|
+
* @param {boolean} flipY - Whether to flip texture data along their vertical axis or not.
|
|
763
|
+
* @param {boolean} premultiplyAlpha - Whether the texture should have its RGB channels premultiplied by the alpha channel or not.
|
|
764
|
+
* @param {number} [mipLevel=0] - The mip level where the data should be copied to.
|
|
765
|
+
*/
|
|
766
|
+
_copyImageToTexture( image, textureGPU, textureDescriptorGPU, originDepth, flipY, premultiplyAlpha, mipLevel = 0 ) {
|
|
767
|
+
|
|
768
|
+
const device = this.backend.device;
|
|
769
|
+
|
|
770
|
+
const width = ( mipLevel > 0 ) ? image.width : textureDescriptorGPU.size.width;
|
|
771
|
+
const height = ( mipLevel > 0 ) ? image.height : textureDescriptorGPU.size.height;
|
|
772
|
+
|
|
773
|
+
device.queue.copyExternalImageToTexture(
|
|
774
|
+
{
|
|
775
|
+
source: image,
|
|
776
|
+
flipY: flipY
|
|
777
|
+
}, {
|
|
778
|
+
texture: textureGPU,
|
|
779
|
+
mipLevel: mipLevel,
|
|
780
|
+
origin: { x: 0, y: 0, z: originDepth },
|
|
781
|
+
premultipliedAlpha: premultiplyAlpha
|
|
782
|
+
}, {
|
|
783
|
+
width: width,
|
|
784
|
+
height: height,
|
|
785
|
+
depthOrArrayLayers: 1
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Returns the pass utils singleton.
|
|
793
|
+
*
|
|
794
|
+
* @private
|
|
795
|
+
* @return {WebGPUTexturePassUtils} The utils instance.
|
|
796
|
+
*/
|
|
797
|
+
_getPassUtils() {
|
|
798
|
+
|
|
799
|
+
let passUtils = this._passUtils;
|
|
800
|
+
|
|
801
|
+
if ( passUtils === null ) {
|
|
802
|
+
|
|
803
|
+
this._passUtils = passUtils = new WebGPUTexturePassUtils( this.backend.device );
|
|
804
|
+
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
return passUtils;
|
|
808
|
+
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Generates mipmaps for the given GPU texture.
|
|
813
|
+
*
|
|
814
|
+
* @private
|
|
815
|
+
* @param {GPUTexture} textureGPU - The GPU texture object.
|
|
816
|
+
* @param {Object} textureDescriptorGPU - The texture descriptor.
|
|
817
|
+
* @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view.
|
|
818
|
+
* @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps.
|
|
819
|
+
*/
|
|
820
|
+
_generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer = 0, encoder = null ) {
|
|
821
|
+
|
|
822
|
+
this._getPassUtils().generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer, encoder );
|
|
823
|
+
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Flip the contents of the given GPU texture along its vertical axis.
|
|
828
|
+
*
|
|
829
|
+
* @private
|
|
830
|
+
* @param {GPUTexture} textureGPU - The GPU texture object.
|
|
831
|
+
* @param {Object} textureDescriptorGPU - The texture descriptor.
|
|
832
|
+
* @param {number} [originDepth=0] - The origin depth.
|
|
833
|
+
*/
|
|
834
|
+
_flipY( textureGPU, textureDescriptorGPU, originDepth = 0 ) {
|
|
835
|
+
|
|
836
|
+
this._getPassUtils().flipY( textureGPU, textureDescriptorGPU, originDepth );
|
|
837
|
+
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Uploads texture buffer data to the GPU memory.
|
|
842
|
+
*
|
|
843
|
+
* @private
|
|
844
|
+
* @param {Object} image - An object defining the image buffer data.
|
|
845
|
+
* @param {GPUTexture} textureGPU - The GPU texture.
|
|
846
|
+
* @param {Object} textureDescriptorGPU - The GPU texture descriptor.
|
|
847
|
+
* @param {number} originDepth - The origin depth.
|
|
848
|
+
* @param {boolean} flipY - Whether to flip texture data along their vertical axis or not.
|
|
849
|
+
* @param {number} [depth=0] - The depth offset when copying array or 3D texture data.
|
|
850
|
+
* @param {number} [mipLevel=0] - The mip level where the data should be copied to.
|
|
851
|
+
*/
|
|
852
|
+
_copyBufferToTexture( image, textureGPU, textureDescriptorGPU, originDepth, flipY, depth = 0, mipLevel = 0 ) {
|
|
853
|
+
|
|
854
|
+
// @TODO: Consider to use GPUCommandEncoder.copyBufferToTexture()
|
|
855
|
+
// @TODO: Consider to support valid buffer layouts with other formats like RGB
|
|
856
|
+
|
|
857
|
+
const device = this.backend.device;
|
|
858
|
+
|
|
859
|
+
const data = image.data;
|
|
860
|
+
|
|
861
|
+
const bytesPerTexel = this._getBytesPerTexel( textureDescriptorGPU.format );
|
|
862
|
+
const bytesPerRow = image.width * bytesPerTexel;
|
|
863
|
+
|
|
864
|
+
device.queue.writeTexture(
|
|
865
|
+
{
|
|
866
|
+
texture: textureGPU,
|
|
867
|
+
mipLevel: mipLevel,
|
|
868
|
+
origin: { x: 0, y: 0, z: originDepth }
|
|
869
|
+
},
|
|
870
|
+
data,
|
|
871
|
+
{
|
|
872
|
+
offset: image.width * image.height * bytesPerTexel * depth,
|
|
873
|
+
bytesPerRow
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
width: image.width,
|
|
877
|
+
height: image.height,
|
|
878
|
+
depthOrArrayLayers: 1
|
|
879
|
+
} );
|
|
880
|
+
|
|
881
|
+
if ( flipY === true ) {
|
|
882
|
+
|
|
883
|
+
this._flipY( textureGPU, textureDescriptorGPU, originDepth );
|
|
884
|
+
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Uploads compressed texture data to the GPU memory.
|
|
891
|
+
*
|
|
892
|
+
* @private
|
|
893
|
+
* @param {Array<Object>} mipmaps - An array with mipmap data.
|
|
894
|
+
* @param {GPUTexture} textureGPU - The GPU texture.
|
|
895
|
+
* @param {Object} textureDescriptorGPU - The GPU texture descriptor.
|
|
896
|
+
*/
|
|
897
|
+
_copyCompressedBufferToTexture( mipmaps, textureGPU, textureDescriptorGPU ) {
|
|
898
|
+
|
|
899
|
+
// @TODO: Consider to use GPUCommandEncoder.copyBufferToTexture()
|
|
900
|
+
|
|
901
|
+
const device = this.backend.device;
|
|
902
|
+
|
|
903
|
+
const blockData = this._getBlockData( textureDescriptorGPU.format );
|
|
904
|
+
const isArrayTexture = textureDescriptorGPU.size.depthOrArrayLayers > 1;
|
|
905
|
+
|
|
906
|
+
for ( let i = 0; i < mipmaps.length; i ++ ) {
|
|
907
|
+
|
|
908
|
+
const mipmap = mipmaps[ i ];
|
|
909
|
+
|
|
910
|
+
const width = mipmap.width;
|
|
911
|
+
const height = mipmap.height;
|
|
912
|
+
const depth = isArrayTexture ? textureDescriptorGPU.size.depthOrArrayLayers : 1;
|
|
913
|
+
|
|
914
|
+
const bytesPerRow = Math.ceil( width / blockData.width ) * blockData.byteLength;
|
|
915
|
+
const bytesPerImage = bytesPerRow * Math.ceil( height / blockData.height );
|
|
916
|
+
|
|
917
|
+
for ( let j = 0; j < depth; j ++ ) {
|
|
918
|
+
|
|
919
|
+
device.queue.writeTexture(
|
|
920
|
+
{
|
|
921
|
+
texture: textureGPU,
|
|
922
|
+
mipLevel: i,
|
|
923
|
+
origin: { x: 0, y: 0, z: j }
|
|
924
|
+
},
|
|
925
|
+
mipmap.data,
|
|
926
|
+
{
|
|
927
|
+
offset: j * bytesPerImage,
|
|
928
|
+
bytesPerRow,
|
|
929
|
+
rowsPerImage: Math.ceil( height / blockData.height )
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
width: Math.ceil( width / blockData.width ) * blockData.width,
|
|
933
|
+
height: Math.ceil( height / blockData.height ) * blockData.height,
|
|
934
|
+
depthOrArrayLayers: 1
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* This method is only relevant for compressed texture formats. It returns a block
|
|
946
|
+
* data descriptor for the given GPU compressed texture format.
|
|
947
|
+
*
|
|
948
|
+
* @private
|
|
949
|
+
* @param {string} format - The GPU compressed texture format.
|
|
950
|
+
* @return {Object} The block data descriptor.
|
|
951
|
+
*/
|
|
952
|
+
_getBlockData( format ) {
|
|
953
|
+
|
|
954
|
+
if ( format === GPUTextureFormat.BC1RGBAUnorm || format === GPUTextureFormat.BC1RGBAUnormSRGB ) return { byteLength: 8, width: 4, height: 4 }; // DXT1
|
|
955
|
+
if ( format === GPUTextureFormat.BC2RGBAUnorm || format === GPUTextureFormat.BC2RGBAUnormSRGB ) return { byteLength: 16, width: 4, height: 4 }; // DXT3
|
|
956
|
+
if ( format === GPUTextureFormat.BC3RGBAUnorm || format === GPUTextureFormat.BC3RGBAUnormSRGB ) return { byteLength: 16, width: 4, height: 4 }; // DXT5
|
|
957
|
+
if ( format === GPUTextureFormat.BC4RUnorm || format === GPUTextureFormat.BC4RSnorm ) return { byteLength: 8, width: 4, height: 4 }; // RGTC1
|
|
958
|
+
if ( format === GPUTextureFormat.BC5RGUnorm || format === GPUTextureFormat.BC5RGSnorm ) return { byteLength: 16, width: 4, height: 4 }; // RGTC2
|
|
959
|
+
if ( format === GPUTextureFormat.BC6HRGBUFloat || format === GPUTextureFormat.BC6HRGBFloat ) return { byteLength: 16, width: 4, height: 4 }; // BPTC (float)
|
|
960
|
+
if ( format === GPUTextureFormat.BC7RGBAUnorm || format === GPUTextureFormat.BC7RGBAUnormSRGB ) return { byteLength: 16, width: 4, height: 4 }; // BPTC (unorm)
|
|
961
|
+
|
|
962
|
+
if ( format === GPUTextureFormat.ETC2RGB8Unorm || format === GPUTextureFormat.ETC2RGB8UnormSRGB ) return { byteLength: 8, width: 4, height: 4 };
|
|
963
|
+
if ( format === GPUTextureFormat.ETC2RGB8A1Unorm || format === GPUTextureFormat.ETC2RGB8A1UnormSRGB ) return { byteLength: 8, width: 4, height: 4 };
|
|
964
|
+
if ( format === GPUTextureFormat.ETC2RGBA8Unorm || format === GPUTextureFormat.ETC2RGBA8UnormSRGB ) return { byteLength: 16, width: 4, height: 4 };
|
|
965
|
+
if ( format === GPUTextureFormat.EACR11Unorm ) return { byteLength: 8, width: 4, height: 4 };
|
|
966
|
+
if ( format === GPUTextureFormat.EACR11Snorm ) return { byteLength: 8, width: 4, height: 4 };
|
|
967
|
+
if ( format === GPUTextureFormat.EACRG11Unorm ) return { byteLength: 16, width: 4, height: 4 };
|
|
968
|
+
if ( format === GPUTextureFormat.EACRG11Snorm ) return { byteLength: 16, width: 4, height: 4 };
|
|
969
|
+
|
|
970
|
+
if ( format === GPUTextureFormat.ASTC4x4Unorm || format === GPUTextureFormat.ASTC4x4UnormSRGB ) return { byteLength: 16, width: 4, height: 4 };
|
|
971
|
+
if ( format === GPUTextureFormat.ASTC5x4Unorm || format === GPUTextureFormat.ASTC5x4UnormSRGB ) return { byteLength: 16, width: 5, height: 4 };
|
|
972
|
+
if ( format === GPUTextureFormat.ASTC5x5Unorm || format === GPUTextureFormat.ASTC5x5UnormSRGB ) return { byteLength: 16, width: 5, height: 5 };
|
|
973
|
+
if ( format === GPUTextureFormat.ASTC6x5Unorm || format === GPUTextureFormat.ASTC6x5UnormSRGB ) return { byteLength: 16, width: 6, height: 5 };
|
|
974
|
+
if ( format === GPUTextureFormat.ASTC6x6Unorm || format === GPUTextureFormat.ASTC6x6UnormSRGB ) return { byteLength: 16, width: 6, height: 6 };
|
|
975
|
+
if ( format === GPUTextureFormat.ASTC8x5Unorm || format === GPUTextureFormat.ASTC8x5UnormSRGB ) return { byteLength: 16, width: 8, height: 5 };
|
|
976
|
+
if ( format === GPUTextureFormat.ASTC8x6Unorm || format === GPUTextureFormat.ASTC8x6UnormSRGB ) return { byteLength: 16, width: 8, height: 6 };
|
|
977
|
+
if ( format === GPUTextureFormat.ASTC8x8Unorm || format === GPUTextureFormat.ASTC8x8UnormSRGB ) return { byteLength: 16, width: 8, height: 8 };
|
|
978
|
+
if ( format === GPUTextureFormat.ASTC10x5Unorm || format === GPUTextureFormat.ASTC10x5UnormSRGB ) return { byteLength: 16, width: 10, height: 5 };
|
|
979
|
+
if ( format === GPUTextureFormat.ASTC10x6Unorm || format === GPUTextureFormat.ASTC10x6UnormSRGB ) return { byteLength: 16, width: 10, height: 6 };
|
|
980
|
+
if ( format === GPUTextureFormat.ASTC10x8Unorm || format === GPUTextureFormat.ASTC10x8UnormSRGB ) return { byteLength: 16, width: 10, height: 8 };
|
|
981
|
+
if ( format === GPUTextureFormat.ASTC10x10Unorm || format === GPUTextureFormat.ASTC10x10UnormSRGB ) return { byteLength: 16, width: 10, height: 10 };
|
|
982
|
+
if ( format === GPUTextureFormat.ASTC12x10Unorm || format === GPUTextureFormat.ASTC12x10UnormSRGB ) return { byteLength: 16, width: 12, height: 10 };
|
|
983
|
+
if ( format === GPUTextureFormat.ASTC12x12Unorm || format === GPUTextureFormat.ASTC12x12UnormSRGB ) return { byteLength: 16, width: 12, height: 12 };
|
|
984
|
+
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Converts the three.js uv wrapping constants to GPU address mode constants.
|
|
989
|
+
*
|
|
990
|
+
* @private
|
|
991
|
+
* @param {number} value - The three.js constant defining a uv wrapping mode.
|
|
992
|
+
* @return {string} The GPU address mode.
|
|
993
|
+
*/
|
|
994
|
+
_convertAddressMode( value ) {
|
|
995
|
+
|
|
996
|
+
let addressMode = GPUAddressMode.ClampToEdge;
|
|
997
|
+
|
|
998
|
+
if ( value === RepeatWrapping ) {
|
|
999
|
+
|
|
1000
|
+
addressMode = GPUAddressMode.Repeat;
|
|
1001
|
+
|
|
1002
|
+
} else if ( value === MirroredRepeatWrapping ) {
|
|
1003
|
+
|
|
1004
|
+
addressMode = GPUAddressMode.MirrorRepeat;
|
|
1005
|
+
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return addressMode;
|
|
1009
|
+
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Converts the three.js filter constants to GPU filter constants.
|
|
1014
|
+
*
|
|
1015
|
+
* @private
|
|
1016
|
+
* @param {number} value - The three.js constant defining a filter mode.
|
|
1017
|
+
* @return {string} The GPU filter mode.
|
|
1018
|
+
*/
|
|
1019
|
+
_convertFilterMode( value ) {
|
|
1020
|
+
|
|
1021
|
+
let filterMode = GPUFilterMode.Linear;
|
|
1022
|
+
|
|
1023
|
+
if ( value === NearestFilter || value === NearestMipmapNearestFilter || value === NearestMipmapLinearFilter ) {
|
|
1024
|
+
|
|
1025
|
+
filterMode = GPUFilterMode.Nearest;
|
|
1026
|
+
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
return filterMode;
|
|
1030
|
+
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Returns the bytes-per-texel value for the given GPU texture format.
|
|
1035
|
+
*
|
|
1036
|
+
* @private
|
|
1037
|
+
* @param {string} format - The GPU texture format.
|
|
1038
|
+
* @return {number} The bytes-per-texel.
|
|
1039
|
+
*/
|
|
1040
|
+
_getBytesPerTexel( format ) {
|
|
1041
|
+
|
|
1042
|
+
// 8-bit formats
|
|
1043
|
+
if ( format === GPUTextureFormat.R8Unorm ||
|
|
1044
|
+
format === GPUTextureFormat.R8Snorm ||
|
|
1045
|
+
format === GPUTextureFormat.R8Uint ||
|
|
1046
|
+
format === GPUTextureFormat.R8Sint ) return 1;
|
|
1047
|
+
|
|
1048
|
+
// 16-bit formats
|
|
1049
|
+
if ( format === GPUTextureFormat.R16Uint ||
|
|
1050
|
+
format === GPUTextureFormat.R16Sint ||
|
|
1051
|
+
format === GPUTextureFormat.R16Float ||
|
|
1052
|
+
format === GPUTextureFormat.RG8Unorm ||
|
|
1053
|
+
format === GPUTextureFormat.RG8Snorm ||
|
|
1054
|
+
format === GPUTextureFormat.RG8Uint ||
|
|
1055
|
+
format === GPUTextureFormat.RG8Sint ) return 2;
|
|
1056
|
+
|
|
1057
|
+
// 32-bit formats
|
|
1058
|
+
if ( format === GPUTextureFormat.R32Uint ||
|
|
1059
|
+
format === GPUTextureFormat.R32Sint ||
|
|
1060
|
+
format === GPUTextureFormat.R32Float ||
|
|
1061
|
+
format === GPUTextureFormat.RG16Uint ||
|
|
1062
|
+
format === GPUTextureFormat.RG16Sint ||
|
|
1063
|
+
format === GPUTextureFormat.RG16Float ||
|
|
1064
|
+
format === GPUTextureFormat.RGBA8Unorm ||
|
|
1065
|
+
format === GPUTextureFormat.RGBA8UnormSRGB ||
|
|
1066
|
+
format === GPUTextureFormat.RGBA8Snorm ||
|
|
1067
|
+
format === GPUTextureFormat.RGBA8Uint ||
|
|
1068
|
+
format === GPUTextureFormat.RGBA8Sint ||
|
|
1069
|
+
format === GPUTextureFormat.BGRA8Unorm ||
|
|
1070
|
+
format === GPUTextureFormat.BGRA8UnormSRGB ||
|
|
1071
|
+
// Packed 32-bit formats
|
|
1072
|
+
format === GPUTextureFormat.RGB9E5UFloat ||
|
|
1073
|
+
format === GPUTextureFormat.RGB10A2Unorm ||
|
|
1074
|
+
format === GPUTextureFormat.RG11B10UFloat ||
|
|
1075
|
+
format === GPUTextureFormat.Depth32Float ||
|
|
1076
|
+
format === GPUTextureFormat.Depth24Plus ||
|
|
1077
|
+
format === GPUTextureFormat.Depth24PlusStencil8 ||
|
|
1078
|
+
format === GPUTextureFormat.Depth32FloatStencil8 ) return 4;
|
|
1079
|
+
|
|
1080
|
+
// 64-bit formats
|
|
1081
|
+
if ( format === GPUTextureFormat.RG32Uint ||
|
|
1082
|
+
format === GPUTextureFormat.RG32Sint ||
|
|
1083
|
+
format === GPUTextureFormat.RG32Float ||
|
|
1084
|
+
format === GPUTextureFormat.RGBA16Uint ||
|
|
1085
|
+
format === GPUTextureFormat.RGBA16Sint ||
|
|
1086
|
+
format === GPUTextureFormat.RGBA16Float ) return 8;
|
|
1087
|
+
|
|
1088
|
+
// 128-bit formats
|
|
1089
|
+
if ( format === GPUTextureFormat.RGBA32Uint ||
|
|
1090
|
+
format === GPUTextureFormat.RGBA32Sint ||
|
|
1091
|
+
format === GPUTextureFormat.RGBA32Float ) return 16;
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Returns the corresponding typed array type for the given GPU texture format.
|
|
1098
|
+
*
|
|
1099
|
+
* @private
|
|
1100
|
+
* @param {string} format - The GPU texture format.
|
|
1101
|
+
* @return {TypedArray.constructor} The typed array type.
|
|
1102
|
+
*/
|
|
1103
|
+
_getTypedArrayType( format ) {
|
|
1104
|
+
|
|
1105
|
+
if ( format === GPUTextureFormat.R8Uint ) return Uint8Array;
|
|
1106
|
+
if ( format === GPUTextureFormat.R8Sint ) return Int8Array;
|
|
1107
|
+
if ( format === GPUTextureFormat.R8Unorm ) return Uint8Array;
|
|
1108
|
+
if ( format === GPUTextureFormat.R8Snorm ) return Int8Array;
|
|
1109
|
+
if ( format === GPUTextureFormat.RG8Uint ) return Uint8Array;
|
|
1110
|
+
if ( format === GPUTextureFormat.RG8Sint ) return Int8Array;
|
|
1111
|
+
if ( format === GPUTextureFormat.RG8Unorm ) return Uint8Array;
|
|
1112
|
+
if ( format === GPUTextureFormat.RG8Snorm ) return Int8Array;
|
|
1113
|
+
if ( format === GPUTextureFormat.RGBA8Uint ) return Uint8Array;
|
|
1114
|
+
if ( format === GPUTextureFormat.RGBA8Sint ) return Int8Array;
|
|
1115
|
+
if ( format === GPUTextureFormat.RGBA8Unorm || format === GPUTextureFormat.RGBA8UnormSRGB ) return Uint8Array;
|
|
1116
|
+
if ( format === GPUTextureFormat.RGBA8Snorm ) return Int8Array;
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
if ( format === GPUTextureFormat.R16Uint ) return Uint16Array;
|
|
1120
|
+
if ( format === GPUTextureFormat.R16Sint ) return Int16Array;
|
|
1121
|
+
if ( format === GPUTextureFormat.RG16Uint ) return Uint16Array;
|
|
1122
|
+
if ( format === GPUTextureFormat.RG16Sint ) return Int16Array;
|
|
1123
|
+
if ( format === GPUTextureFormat.RGBA16Uint ) return Uint16Array;
|
|
1124
|
+
if ( format === GPUTextureFormat.RGBA16Sint ) return Int16Array;
|
|
1125
|
+
if ( format === GPUTextureFormat.R16Float ) return Uint16Array;
|
|
1126
|
+
if ( format === GPUTextureFormat.RG16Float ) return Uint16Array;
|
|
1127
|
+
if ( format === GPUTextureFormat.RGBA16Float ) return Uint16Array;
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
if ( format === GPUTextureFormat.R32Uint ) return Uint32Array;
|
|
1131
|
+
if ( format === GPUTextureFormat.R32Sint ) return Int32Array;
|
|
1132
|
+
if ( format === GPUTextureFormat.R32Float ) return Float32Array;
|
|
1133
|
+
if ( format === GPUTextureFormat.RG32Uint ) return Uint32Array;
|
|
1134
|
+
if ( format === GPUTextureFormat.RG32Sint ) return Int32Array;
|
|
1135
|
+
if ( format === GPUTextureFormat.RG32Float ) return Float32Array;
|
|
1136
|
+
if ( format === GPUTextureFormat.RGBA32Uint ) return Uint32Array;
|
|
1137
|
+
if ( format === GPUTextureFormat.RGBA32Sint ) return Int32Array;
|
|
1138
|
+
if ( format === GPUTextureFormat.RGBA32Float ) return Float32Array;
|
|
1139
|
+
|
|
1140
|
+
if ( format === GPUTextureFormat.BGRA8Unorm || format === GPUTextureFormat.BGRA8UnormSRGB ) return Uint8Array;
|
|
1141
|
+
if ( format === GPUTextureFormat.RGB10A2Unorm ) return Uint32Array;
|
|
1142
|
+
if ( format === GPUTextureFormat.RGB9E5UFloat ) return Uint32Array;
|
|
1143
|
+
if ( format === GPUTextureFormat.RG11B10UFloat ) return Uint32Array;
|
|
1144
|
+
|
|
1145
|
+
if ( format === GPUTextureFormat.Depth32Float ) return Float32Array;
|
|
1146
|
+
if ( format === GPUTextureFormat.Depth24Plus ) return Uint32Array;
|
|
1147
|
+
if ( format === GPUTextureFormat.Depth24PlusStencil8 ) return Uint32Array;
|
|
1148
|
+
if ( format === GPUTextureFormat.Depth32FloatStencil8 ) return Float32Array;
|
|
1149
|
+
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Returns the GPU dimensions for the given texture.
|
|
1154
|
+
*
|
|
1155
|
+
* @private
|
|
1156
|
+
* @param {Texture} texture - The texture.
|
|
1157
|
+
* @return {string} The GPU dimension.
|
|
1158
|
+
*/
|
|
1159
|
+
_getDimension( texture ) {
|
|
1160
|
+
|
|
1161
|
+
let dimension;
|
|
1162
|
+
|
|
1163
|
+
if ( texture.is3DTexture || texture.isData3DTexture ) {
|
|
1164
|
+
|
|
1165
|
+
dimension = GPUTextureDimension.ThreeD;
|
|
1166
|
+
|
|
1167
|
+
} else {
|
|
1168
|
+
|
|
1169
|
+
dimension = GPUTextureDimension.TwoD;
|
|
1170
|
+
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
return dimension;
|
|
1174
|
+
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Returns the GPU format for the given texture.
|
|
1181
|
+
*
|
|
1182
|
+
* @param {Texture} texture - The texture.
|
|
1183
|
+
* @param {?GPUDevice} [device=null] - The GPU device which is used for feature detection.
|
|
1184
|
+
* It is not necessary to apply the device for most formats.
|
|
1185
|
+
* @return {string} The GPU format.
|
|
1186
|
+
*/
|
|
1187
|
+
export function getFormat( texture, device = null ) {
|
|
1188
|
+
|
|
1189
|
+
const format = texture.format;
|
|
1190
|
+
const type = texture.type;
|
|
1191
|
+
const colorSpace = texture.colorSpace;
|
|
1192
|
+
const transfer = ColorManagement.getTransfer( colorSpace );
|
|
1193
|
+
|
|
1194
|
+
let formatGPU;
|
|
1195
|
+
|
|
1196
|
+
if ( texture.isCompressedTexture === true || texture.isCompressedArrayTexture === true ) {
|
|
1197
|
+
|
|
1198
|
+
switch ( format ) {
|
|
1199
|
+
|
|
1200
|
+
case RGB_S3TC_DXT1_Format:
|
|
1201
|
+
case RGBA_S3TC_DXT1_Format:
|
|
1202
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
|
|
1203
|
+
break;
|
|
1204
|
+
|
|
1205
|
+
case RGBA_S3TC_DXT3_Format:
|
|
1206
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
|
|
1207
|
+
break;
|
|
1208
|
+
|
|
1209
|
+
case RGBA_S3TC_DXT5_Format:
|
|
1210
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.BC3RGBAUnormSRGB : GPUTextureFormat.BC3RGBAUnorm;
|
|
1211
|
+
break;
|
|
1212
|
+
|
|
1213
|
+
case RED_RGTC1_Format:
|
|
1214
|
+
formatGPU = GPUTextureFormat.BC4RUnorm;
|
|
1215
|
+
break;
|
|
1216
|
+
|
|
1217
|
+
case SIGNED_RED_RGTC1_Format:
|
|
1218
|
+
formatGPU = GPUTextureFormat.BC4RSnorm;
|
|
1219
|
+
break;
|
|
1220
|
+
|
|
1221
|
+
case RED_GREEN_RGTC2_Format:
|
|
1222
|
+
formatGPU = GPUTextureFormat.BC5RGUnorm;
|
|
1223
|
+
break;
|
|
1224
|
+
|
|
1225
|
+
case SIGNED_RED_GREEN_RGTC2_Format:
|
|
1226
|
+
formatGPU = GPUTextureFormat.BC5RGSnorm;
|
|
1227
|
+
break;
|
|
1228
|
+
|
|
1229
|
+
case RGBA_BPTC_Format:
|
|
1230
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.BC7RGBAUnormSRGB : GPUTextureFormat.BC7RGBAUnorm;
|
|
1231
|
+
break;
|
|
1232
|
+
|
|
1233
|
+
case RGB_ETC2_Format:
|
|
1234
|
+
case RGB_ETC1_Format:
|
|
1235
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ETC2RGB8UnormSRGB : GPUTextureFormat.ETC2RGB8Unorm;
|
|
1236
|
+
break;
|
|
1237
|
+
|
|
1238
|
+
case RGBA_ETC2_EAC_Format:
|
|
1239
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ETC2RGBA8UnormSRGB : GPUTextureFormat.ETC2RGBA8Unorm;
|
|
1240
|
+
break;
|
|
1241
|
+
|
|
1242
|
+
case RGBA_ASTC_4x4_Format:
|
|
1243
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC4x4UnormSRGB : GPUTextureFormat.ASTC4x4Unorm;
|
|
1244
|
+
break;
|
|
1245
|
+
|
|
1246
|
+
case RGBA_ASTC_5x4_Format:
|
|
1247
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC5x4UnormSRGB : GPUTextureFormat.ASTC5x4Unorm;
|
|
1248
|
+
break;
|
|
1249
|
+
|
|
1250
|
+
case RGBA_ASTC_5x5_Format:
|
|
1251
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC5x5UnormSRGB : GPUTextureFormat.ASTC5x5Unorm;
|
|
1252
|
+
break;
|
|
1253
|
+
|
|
1254
|
+
case RGBA_ASTC_6x5_Format:
|
|
1255
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC6x5UnormSRGB : GPUTextureFormat.ASTC6x5Unorm;
|
|
1256
|
+
break;
|
|
1257
|
+
|
|
1258
|
+
case RGBA_ASTC_6x6_Format:
|
|
1259
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC6x6UnormSRGB : GPUTextureFormat.ASTC6x6Unorm;
|
|
1260
|
+
break;
|
|
1261
|
+
|
|
1262
|
+
case RGBA_ASTC_8x5_Format:
|
|
1263
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC8x5UnormSRGB : GPUTextureFormat.ASTC8x5Unorm;
|
|
1264
|
+
break;
|
|
1265
|
+
|
|
1266
|
+
case RGBA_ASTC_8x6_Format:
|
|
1267
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC8x6UnormSRGB : GPUTextureFormat.ASTC8x6Unorm;
|
|
1268
|
+
break;
|
|
1269
|
+
|
|
1270
|
+
case RGBA_ASTC_8x8_Format:
|
|
1271
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC8x8UnormSRGB : GPUTextureFormat.ASTC8x8Unorm;
|
|
1272
|
+
break;
|
|
1273
|
+
|
|
1274
|
+
case RGBA_ASTC_10x5_Format:
|
|
1275
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC10x5UnormSRGB : GPUTextureFormat.ASTC10x5Unorm;
|
|
1276
|
+
break;
|
|
1277
|
+
|
|
1278
|
+
case RGBA_ASTC_10x6_Format:
|
|
1279
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC10x6UnormSRGB : GPUTextureFormat.ASTC10x6Unorm;
|
|
1280
|
+
break;
|
|
1281
|
+
|
|
1282
|
+
case RGBA_ASTC_10x8_Format:
|
|
1283
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC10x8UnormSRGB : GPUTextureFormat.ASTC10x8Unorm;
|
|
1284
|
+
break;
|
|
1285
|
+
|
|
1286
|
+
case RGBA_ASTC_10x10_Format:
|
|
1287
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC10x10UnormSRGB : GPUTextureFormat.ASTC10x10Unorm;
|
|
1288
|
+
break;
|
|
1289
|
+
|
|
1290
|
+
case RGBA_ASTC_12x10_Format:
|
|
1291
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC12x10UnormSRGB : GPUTextureFormat.ASTC12x10Unorm;
|
|
1292
|
+
break;
|
|
1293
|
+
|
|
1294
|
+
case RGBA_ASTC_12x12_Format:
|
|
1295
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.ASTC12x12UnormSRGB : GPUTextureFormat.ASTC12x12Unorm;
|
|
1296
|
+
break;
|
|
1297
|
+
|
|
1298
|
+
case RGBAFormat:
|
|
1299
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
|
1300
|
+
break;
|
|
1301
|
+
|
|
1302
|
+
default:
|
|
1303
|
+
error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
1304
|
+
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
} else {
|
|
1308
|
+
|
|
1309
|
+
switch ( format ) {
|
|
1310
|
+
|
|
1311
|
+
case RGBAFormat:
|
|
1312
|
+
|
|
1313
|
+
switch ( type ) {
|
|
1314
|
+
|
|
1315
|
+
case ByteType:
|
|
1316
|
+
formatGPU = GPUTextureFormat.RGBA8Snorm;
|
|
1317
|
+
break;
|
|
1318
|
+
|
|
1319
|
+
case ShortType:
|
|
1320
|
+
formatGPU = GPUTextureFormat.RGBA16Sint;
|
|
1321
|
+
break;
|
|
1322
|
+
|
|
1323
|
+
case UnsignedShortType:
|
|
1324
|
+
formatGPU = GPUTextureFormat.RGBA16Uint;
|
|
1325
|
+
break;
|
|
1326
|
+
case UnsignedIntType:
|
|
1327
|
+
formatGPU = GPUTextureFormat.RGBA32Uint;
|
|
1328
|
+
break;
|
|
1329
|
+
|
|
1330
|
+
case IntType:
|
|
1331
|
+
formatGPU = GPUTextureFormat.RGBA32Sint;
|
|
1332
|
+
break;
|
|
1333
|
+
|
|
1334
|
+
case UnsignedByteType:
|
|
1335
|
+
formatGPU = ( transfer === SRGBTransfer ) ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
|
1336
|
+
break;
|
|
1337
|
+
|
|
1338
|
+
case HalfFloatType:
|
|
1339
|
+
formatGPU = GPUTextureFormat.RGBA16Float;
|
|
1340
|
+
break;
|
|
1341
|
+
|
|
1342
|
+
case FloatType:
|
|
1343
|
+
formatGPU = GPUTextureFormat.RGBA32Float;
|
|
1344
|
+
break;
|
|
1345
|
+
|
|
1346
|
+
default:
|
|
1347
|
+
error( 'WebGPURenderer: Unsupported texture type with RGBAFormat.', type );
|
|
1348
|
+
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
break;
|
|
1352
|
+
|
|
1353
|
+
case RGBFormat:
|
|
1354
|
+
|
|
1355
|
+
switch ( type ) {
|
|
1356
|
+
|
|
1357
|
+
case UnsignedInt5999Type:
|
|
1358
|
+
formatGPU = GPUTextureFormat.RGB9E5UFloat;
|
|
1359
|
+
break;
|
|
1360
|
+
|
|
1361
|
+
case UnsignedInt101111Type:
|
|
1362
|
+
formatGPU = GPUTextureFormat.RG11B10UFloat;
|
|
1363
|
+
break;
|
|
1364
|
+
|
|
1365
|
+
default:
|
|
1366
|
+
error( 'WebGPURenderer: Unsupported texture type with RGBFormat.', type );
|
|
1367
|
+
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
break;
|
|
1371
|
+
|
|
1372
|
+
case RedFormat:
|
|
1373
|
+
|
|
1374
|
+
switch ( type ) {
|
|
1375
|
+
|
|
1376
|
+
case ByteType:
|
|
1377
|
+
formatGPU = GPUTextureFormat.R8Snorm;
|
|
1378
|
+
break;
|
|
1379
|
+
|
|
1380
|
+
case ShortType:
|
|
1381
|
+
formatGPU = GPUTextureFormat.R16Sint;
|
|
1382
|
+
break;
|
|
1383
|
+
|
|
1384
|
+
case UnsignedShortType:
|
|
1385
|
+
formatGPU = GPUTextureFormat.R16Uint;
|
|
1386
|
+
break;
|
|
1387
|
+
|
|
1388
|
+
case UnsignedIntType:
|
|
1389
|
+
formatGPU = GPUTextureFormat.R32Uint;
|
|
1390
|
+
break;
|
|
1391
|
+
|
|
1392
|
+
case IntType:
|
|
1393
|
+
formatGPU = GPUTextureFormat.R32Sint;
|
|
1394
|
+
break;
|
|
1395
|
+
|
|
1396
|
+
case UnsignedByteType:
|
|
1397
|
+
formatGPU = GPUTextureFormat.R8Unorm;
|
|
1398
|
+
break;
|
|
1399
|
+
|
|
1400
|
+
case HalfFloatType:
|
|
1401
|
+
formatGPU = GPUTextureFormat.R16Float;
|
|
1402
|
+
break;
|
|
1403
|
+
|
|
1404
|
+
case FloatType:
|
|
1405
|
+
formatGPU = GPUTextureFormat.R32Float;
|
|
1406
|
+
break;
|
|
1407
|
+
|
|
1408
|
+
default:
|
|
1409
|
+
error( 'WebGPURenderer: Unsupported texture type with RedFormat.', type );
|
|
1410
|
+
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
break;
|
|
1414
|
+
|
|
1415
|
+
case RGFormat:
|
|
1416
|
+
|
|
1417
|
+
switch ( type ) {
|
|
1418
|
+
|
|
1419
|
+
case ByteType:
|
|
1420
|
+
formatGPU = GPUTextureFormat.RG8Snorm;
|
|
1421
|
+
break;
|
|
1422
|
+
|
|
1423
|
+
case ShortType:
|
|
1424
|
+
formatGPU = GPUTextureFormat.RG16Sint;
|
|
1425
|
+
break;
|
|
1426
|
+
|
|
1427
|
+
case UnsignedShortType:
|
|
1428
|
+
formatGPU = GPUTextureFormat.RG16Uint;
|
|
1429
|
+
break;
|
|
1430
|
+
|
|
1431
|
+
case UnsignedIntType:
|
|
1432
|
+
formatGPU = GPUTextureFormat.RG32Uint;
|
|
1433
|
+
break;
|
|
1434
|
+
|
|
1435
|
+
case IntType:
|
|
1436
|
+
formatGPU = GPUTextureFormat.RG32Sint;
|
|
1437
|
+
break;
|
|
1438
|
+
|
|
1439
|
+
case UnsignedByteType:
|
|
1440
|
+
formatGPU = GPUTextureFormat.RG8Unorm;
|
|
1441
|
+
break;
|
|
1442
|
+
|
|
1443
|
+
case HalfFloatType:
|
|
1444
|
+
formatGPU = GPUTextureFormat.RG16Float;
|
|
1445
|
+
break;
|
|
1446
|
+
|
|
1447
|
+
case FloatType:
|
|
1448
|
+
formatGPU = GPUTextureFormat.RG32Float;
|
|
1449
|
+
break;
|
|
1450
|
+
|
|
1451
|
+
default:
|
|
1452
|
+
error( 'WebGPURenderer: Unsupported texture type with RGFormat.', type );
|
|
1453
|
+
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
break;
|
|
1457
|
+
|
|
1458
|
+
case DepthFormat:
|
|
1459
|
+
|
|
1460
|
+
switch ( type ) {
|
|
1461
|
+
|
|
1462
|
+
case UnsignedShortType:
|
|
1463
|
+
formatGPU = GPUTextureFormat.Depth16Unorm;
|
|
1464
|
+
break;
|
|
1465
|
+
|
|
1466
|
+
case UnsignedIntType:
|
|
1467
|
+
formatGPU = GPUTextureFormat.Depth24Plus;
|
|
1468
|
+
break;
|
|
1469
|
+
|
|
1470
|
+
case FloatType:
|
|
1471
|
+
formatGPU = GPUTextureFormat.Depth32Float;
|
|
1472
|
+
break;
|
|
1473
|
+
|
|
1474
|
+
default:
|
|
1475
|
+
error( 'WebGPURenderer: Unsupported texture type with DepthFormat.', type );
|
|
1476
|
+
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
break;
|
|
1480
|
+
|
|
1481
|
+
case DepthStencilFormat:
|
|
1482
|
+
|
|
1483
|
+
switch ( type ) {
|
|
1484
|
+
|
|
1485
|
+
case UnsignedInt248Type:
|
|
1486
|
+
formatGPU = GPUTextureFormat.Depth24PlusStencil8;
|
|
1487
|
+
break;
|
|
1488
|
+
|
|
1489
|
+
case FloatType:
|
|
1490
|
+
|
|
1491
|
+
if ( device && device.features.has( GPUFeatureName.Depth32FloatStencil8 ) === false ) {
|
|
1492
|
+
|
|
1493
|
+
error( 'WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.' );
|
|
1494
|
+
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
formatGPU = GPUTextureFormat.Depth32FloatStencil8;
|
|
1498
|
+
|
|
1499
|
+
break;
|
|
1500
|
+
|
|
1501
|
+
default:
|
|
1502
|
+
error( 'WebGPURenderer: Unsupported texture type with DepthStencilFormat.', type );
|
|
1503
|
+
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
break;
|
|
1507
|
+
|
|
1508
|
+
case RedIntegerFormat:
|
|
1509
|
+
|
|
1510
|
+
switch ( type ) {
|
|
1511
|
+
|
|
1512
|
+
case IntType:
|
|
1513
|
+
formatGPU = GPUTextureFormat.R32Sint;
|
|
1514
|
+
break;
|
|
1515
|
+
|
|
1516
|
+
case UnsignedIntType:
|
|
1517
|
+
formatGPU = GPUTextureFormat.R32Uint;
|
|
1518
|
+
break;
|
|
1519
|
+
|
|
1520
|
+
default:
|
|
1521
|
+
error( 'WebGPURenderer: Unsupported texture type with RedIntegerFormat.', type );
|
|
1522
|
+
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
break;
|
|
1526
|
+
|
|
1527
|
+
case RGIntegerFormat:
|
|
1528
|
+
|
|
1529
|
+
switch ( type ) {
|
|
1530
|
+
|
|
1531
|
+
case IntType:
|
|
1532
|
+
formatGPU = GPUTextureFormat.RG32Sint;
|
|
1533
|
+
break;
|
|
1534
|
+
|
|
1535
|
+
case UnsignedIntType:
|
|
1536
|
+
formatGPU = GPUTextureFormat.RG32Uint;
|
|
1537
|
+
break;
|
|
1538
|
+
|
|
1539
|
+
default:
|
|
1540
|
+
error( 'WebGPURenderer: Unsupported texture type with RGIntegerFormat.', type );
|
|
1541
|
+
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
break;
|
|
1545
|
+
|
|
1546
|
+
case RGBAIntegerFormat:
|
|
1547
|
+
|
|
1548
|
+
switch ( type ) {
|
|
1549
|
+
|
|
1550
|
+
case IntType:
|
|
1551
|
+
formatGPU = GPUTextureFormat.RGBA32Sint;
|
|
1552
|
+
break;
|
|
1553
|
+
|
|
1554
|
+
case UnsignedIntType:
|
|
1555
|
+
formatGPU = GPUTextureFormat.RGBA32Uint;
|
|
1556
|
+
break;
|
|
1557
|
+
|
|
1558
|
+
default:
|
|
1559
|
+
error( 'WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.', type );
|
|
1560
|
+
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
break;
|
|
1564
|
+
|
|
1565
|
+
default:
|
|
1566
|
+
error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
1567
|
+
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
return formatGPU;
|
|
1573
|
+
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
export default WebGPUTextureUtils;
|