rhodonite 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -19
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
- package/dist/esm/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esm/foundation/components/Light/LightComponent.js +1 -1
- package/dist/esm/foundation/components/Mesh/MeshComponent.js +1 -1
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.js +1 -1
- package/dist/esm/foundation/components/Shape/ShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
- package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
- package/dist/esm/foundation/components/Trigger/TriggerComponent.js +1 -1
- package/dist/esm/foundation/components/Vrm/VrmComponent.js +1 -1
- package/dist/esm/foundation/constraints/VrmAimConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRotationConstraint.js +1 -1
- package/dist/esm/foundation/core/Component.js +1 -1
- package/dist/esm/foundation/core/ComponentRepository.js +1 -1
- package/dist/esm/foundation/core/Entity.js +1 -1
- package/dist/esm/foundation/core/EntityRepository.js +1 -1
- package/dist/esm/foundation/geometry/ComplexVertexAttribute.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.js +1 -1
- package/dist/esm/foundation/geometry/Primitive.js +1 -1
- package/dist/esm/foundation/gizmos/AABBGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/CapsuleColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esm/foundation/gizmos/Gizmo.js +1 -1
- package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esm/foundation/gizmos/LightGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LocatorGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/RotationGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ShapeGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
- package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
- package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -0
- package/dist/esm/foundation/importer/AnimationAssigner.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/ModelConverter.js +1 -1
- package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
- package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
- package/dist/esm/foundation/importer/VrmImporter.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +18 -18
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
- package/dist/esm/foundation/math/MathClassUtil.js +1 -1
- package/dist/esm/foundation/math/Quaternion.js +1 -1
- package/dist/esm/foundation/math/Transform3D.js +1 -1
- package/dist/esm/foundation/math/shapes/MathSphere.js +1 -1
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/cache/Cache.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/CapsuleCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/SphereCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/VRMSpringBone.js +1 -1
- package/dist/esm/foundation/renderer/Frame.js +1 -1
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -0
- package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.d.ts +37 -3
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/foundation/textures/Texture.js +1 -1
- package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
- package/dist/esm/foundation/textures/VideoTexture.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +47 -28
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +0 -3
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +35 -0
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +140 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +175 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +18 -0
- package/dist/esm/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +9 -9
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.js +3 -3
- package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +78 -59
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +30 -0
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +133 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +169 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +19 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.js +107 -1
- package/dist/esmdev/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esmdev/foundation/components/Camera/CameraComponent.js +118 -46
- package/dist/esmdev/foundation/components/CameraController/CameraControllerComponent.js +8 -8
- package/dist/esmdev/foundation/components/CharacterController/CharacterAnimationController.js +74 -74
- package/dist/esmdev/foundation/components/CharacterController/CharacterControllerComponent.js +39 -39
- package/dist/esmdev/foundation/components/Constraint/ConstraintComponent.js +4 -4
- package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esmdev/foundation/components/Light/LightComponent.js +126 -121
- package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +50 -50
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +96 -92
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +73 -73
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +251 -251
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +375 -343
- package/dist/esmdev/foundation/components/Shape/ShapeComponent.js +31 -31
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +9 -9
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.js +337 -205
- package/dist/esmdev/foundation/components/Transform/TransformComponent.js +93 -93
- package/dist/esmdev/foundation/components/Trigger/TriggerComponent.js +61 -61
- package/dist/esmdev/foundation/components/Vrm/VrmComponent.js +44 -44
- package/dist/esmdev/foundation/constraints/VrmAimConstraint.js +11 -11
- package/dist/esmdev/foundation/constraints/VrmRollConstraint.js +16 -16
- package/dist/esmdev/foundation/constraints/VrmRotationConstraint.js +10 -10
- package/dist/esmdev/foundation/core/Component.js +32 -32
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.js +42 -42
- package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
- package/dist/esmdev/foundation/core/Config.js +9 -9
- package/dist/esmdev/foundation/core/Entity.js +9 -9
- package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +17 -17
- package/dist/esmdev/foundation/core/MemoryManager.js +25 -25
- package/dist/esmdev/foundation/core/RnObject.js +37 -37
- package/dist/esmdev/foundation/definitions/Blend.js +3 -3
- package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
- package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
- package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
- package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
- package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
- package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +112 -112
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
- package/dist/esmdev/foundation/geometry/Frustum.js +41 -41
- package/dist/esmdev/foundation/geometry/Mesh.js +218 -218
- package/dist/esmdev/foundation/geometry/Primitive.js +133 -133
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +17 -20
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +24 -26
- package/dist/esmdev/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esmdev/foundation/gizmos/Gizmo.js +43 -21
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +38 -40
- package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +26 -30
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +26 -29
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +217 -219
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +135 -137
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +44 -47
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +25 -27
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +132 -134
- package/dist/esmdev/foundation/helpers/BloomHelper.js +34 -34
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +119 -119
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +61 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +127 -0
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +33 -33
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +131 -131
- package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
- package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
- package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +27 -27
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +138 -138
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +19 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +68 -53
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +26 -26
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.js +115 -115
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +38 -38
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +4 -4
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +16 -17
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +17 -18
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
- package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
- package/dist/esmdev/foundation/math/AABB.js +132 -132
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedScalar.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +20 -20
- package/dist/esmdev/foundation/math/AnimatedVector2.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector3.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector4.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +55 -55
- package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esmdev/foundation/math/MathClassUtil.js +4 -4
- package/dist/esmdev/foundation/math/Quaternion.js +20 -20
- package/dist/esmdev/foundation/math/Transform3D.js +83 -83
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +9 -9
- package/dist/esmdev/foundation/memory/Accessor.js +370 -370
- package/dist/esmdev/foundation/memory/Buffer.js +40 -40
- package/dist/esmdev/foundation/memory/BufferView.js +33 -33
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +10 -10
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +27 -27
- package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
- package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
- package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +13 -13
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +203 -203
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +241 -241
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +42 -42
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +27 -27
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +10 -10
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +51 -51
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +12 -12
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.js +102 -99
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +66 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +275 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +153 -153
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +6 -6
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +535 -428
- package/dist/esmdev/foundation/system/Engine.d.ts +37 -3
- package/dist/esmdev/foundation/system/Engine.js +266 -224
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
- package/dist/esmdev/foundation/textures/AbstractTexture.js +50 -50
- package/dist/esmdev/foundation/textures/CubeTexture.js +32 -32
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +25 -25
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +37 -37
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +19 -19
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.js +83 -83
- package/dist/esmdev/foundation/textures/TextureArray.js +8 -8
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.js +24 -24
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.js +2 -2
- package/dist/esmdev/webgl/MultiDrawRepository.js +30 -30
- package/dist/esmdev/webgl/WebGLContextWrapper.js +164 -164
- package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
- package/dist/esmdev/webgl/WebGLResourceRepository.js +306 -306
- package/dist/esmdev/webgl/WebGLStereoUtil.js +42 -42
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +296 -261
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +4 -4
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +14 -14
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +21 -21
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +23 -23
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +23 -23
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +27 -27
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +94 -94
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +198 -198
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +37 -37
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +597 -597
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +170 -133
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +12 -0
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +153 -153
- package/package.json +1 -1
|
@@ -11,9 +11,9 @@ var OutUnionShader = class extends RaymarchingShaderPart {
|
|
|
11
11
|
*/
|
|
12
12
|
constructor(shaderFunctionName, distanceCorrectionUniformNames = [], distanceScaleGlobalNames = []) {
|
|
13
13
|
super();
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
14
|
+
this.Jr = shaderFunctionName;
|
|
15
|
+
this.it = [...distanceCorrectionUniformNames];
|
|
16
|
+
this.jt = [...distanceScaleGlobalNames];
|
|
17
17
|
}
|
|
18
18
|
getVertexShaderDefinitions(_engine) {
|
|
19
19
|
return "";
|
|
@@ -24,12 +24,12 @@ var OutUnionShader = class extends RaymarchingShaderPart {
|
|
|
24
24
|
getPixelShaderDefinitions(engine) {
|
|
25
25
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
26
26
|
return `
|
|
27
|
-
fn ${this.
|
|
27
|
+
fn ${this.Jr}(value: f32, objectId: f32) {
|
|
28
28
|
var distanceScale = 1.0;
|
|
29
|
-
${this.
|
|
29
|
+
${this.it.map(
|
|
30
30
|
(name) => ` distanceScale = min(distanceScale, rnRaymarchDistanceScale(get_${name}(uniformDrawParameters.materialSid, 0u)));
|
|
31
31
|
`
|
|
32
|
-
).join("")}${this.
|
|
32
|
+
).join("")}${this.jt.map(
|
|
33
33
|
(name) => ` distanceScale = min(distanceScale, ${name});
|
|
34
34
|
`
|
|
35
35
|
).join("")} distanceScale = clamp(distanceScale, 0.0001, 1.0);
|
|
@@ -42,13 +42,13 @@ ${this.at.map(
|
|
|
42
42
|
`;
|
|
43
43
|
}
|
|
44
44
|
return `
|
|
45
|
-
void ${this.
|
|
45
|
+
void ${this.Jr}(in float value, in float objectId) {
|
|
46
46
|
${this.getMaterialSIDForWebGL()}
|
|
47
47
|
float distanceScale = 1.0;
|
|
48
|
-
${this.
|
|
48
|
+
${this.it.map(
|
|
49
49
|
(name) => ` distanceScale = min(distanceScale, rnRaymarchDistanceScale(get_${name}(materialSID, 0u)));
|
|
50
50
|
`
|
|
51
|
-
).join("")}${this.
|
|
51
|
+
).join("")}${this.jt.map(
|
|
52
52
|
(name) => ` distanceScale = min(distanceScale, ${name});
|
|
53
53
|
`
|
|
54
54
|
).join("")} distanceScale = clamp(distanceScale, 0.0001, 1.0);
|
|
@@ -4,12 +4,12 @@ import { RaymarchingShaderPart } from "../RaymarchingShaderPart.js";
|
|
|
4
4
|
var RaymarchObjectIdUniformShader = class extends RaymarchingShaderPart {
|
|
5
5
|
constructor(shaderFunctionName) {
|
|
6
6
|
super();
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
7
|
+
this.NF = "";
|
|
8
|
+
this.Jr = "";
|
|
9
|
+
this.Jr = shaderFunctionName;
|
|
10
10
|
}
|
|
11
11
|
setVariableName(name) {
|
|
12
|
-
this.
|
|
12
|
+
this.NF = name;
|
|
13
13
|
}
|
|
14
14
|
getVertexShaderDefinitions(_engine) {
|
|
15
15
|
return "";
|
|
@@ -20,15 +20,15 @@ var RaymarchObjectIdUniformShader = class extends RaymarchingShaderPart {
|
|
|
20
20
|
getPixelShaderDefinitions(engine) {
|
|
21
21
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
22
22
|
return `
|
|
23
|
-
fn ${this.
|
|
24
|
-
*outValue = get_${this.
|
|
23
|
+
fn ${this.Jr}(outValue: ptr<function, f32>) {
|
|
24
|
+
*outValue = get_${this.NF}(uniformDrawParameters.materialSid, 0u);
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
return `
|
|
29
|
-
void ${this.
|
|
29
|
+
void ${this.Jr}(out float outValue) {
|
|
30
30
|
${this.getMaterialSIDForWebGL()}
|
|
31
|
-
outValue = get_${this.
|
|
31
|
+
outValue = get_${this.NF}(materialSID, 0u);
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
}
|
|
@@ -8,12 +8,12 @@ var SdApplyTransformShader = class extends RaymarchingShaderPart {
|
|
|
8
8
|
*/
|
|
9
9
|
constructor(shaderFunctionName, scaleGlobalName) {
|
|
10
10
|
super();
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
11
|
+
this.Jr = shaderFunctionName;
|
|
12
|
+
this.lt = scaleGlobalName;
|
|
13
13
|
}
|
|
14
14
|
/** Name of the global that holds this node's smallest axis scale. */
|
|
15
15
|
get scaleGlobalName() {
|
|
16
|
-
return this.
|
|
16
|
+
return this.lt;
|
|
17
17
|
}
|
|
18
18
|
getVertexShaderDefinitions(_engine) {
|
|
19
19
|
return "";
|
|
@@ -24,9 +24,9 @@ var SdApplyTransformShader = class extends RaymarchingShaderPart {
|
|
|
24
24
|
getPixelShaderDefinitions(engine) {
|
|
25
25
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
26
26
|
return `
|
|
27
|
-
var<private> ${this.
|
|
28
|
-
fn ${this.
|
|
29
|
-
${this.
|
|
27
|
+
var<private> ${this.lt}: f32 = 1.0;
|
|
28
|
+
fn ${this.Jr}(position: vec3f, translation: vec3f, xyzEulerAngles: vec3f, scale: vec3f, outTransformedPosition: ptr<function, vec3f>) {
|
|
29
|
+
${this.lt} = clamp(min(abs(scale.x), min(abs(scale.y), abs(scale.z))), 0.0001, 1.0);
|
|
30
30
|
let transform = createTransformMatrix(translation, xyzEulerAngles, scale);
|
|
31
31
|
let inv = inverseTransform(transform);
|
|
32
32
|
*outTransformedPosition = (inv * vec4f(position, 1.0)).xyz;
|
|
@@ -34,9 +34,9 @@ fn ${this.Br}(position: vec3f, translation: vec3f, xyzEulerAngles: vec3f, scale:
|
|
|
34
34
|
`;
|
|
35
35
|
}
|
|
36
36
|
return `
|
|
37
|
-
float ${this.
|
|
38
|
-
void ${this.
|
|
39
|
-
${this.
|
|
37
|
+
float ${this.lt} = 1.0;
|
|
38
|
+
void ${this.Jr}(in vec3 position, in vec3 translation, in vec3 xyzEulerAngles, in vec3 scale, out vec3 outTransformedPosition) {
|
|
39
|
+
${this.lt} = clamp(min(abs(scale.x), min(abs(scale.y), abs(scale.z))), 0.0001, 1.0);
|
|
40
40
|
mat4 transform = createTransformMatrix(translation, xyzEulerAngles, scale);
|
|
41
41
|
mat4 inv = inverseTransform(transform);
|
|
42
42
|
outTransformedPosition = (inv * vec4(position, 1.0)).xyz;
|
|
@@ -7,12 +7,12 @@ var SdApplyWorldMatrixShader = class extends RaymarchingShaderPart {
|
|
|
7
7
|
*/
|
|
8
8
|
constructor(shaderFunctionName) {
|
|
9
9
|
super();
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
10
|
+
this.NF = "";
|
|
11
|
+
this.Jr = "";
|
|
12
|
+
this.Jr = shaderFunctionName;
|
|
13
13
|
}
|
|
14
14
|
setVariableName(name) {
|
|
15
|
-
this.
|
|
15
|
+
this.NF = name;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Gets the vertex shader function definitions.
|
|
@@ -44,8 +44,8 @@ var SdApplyWorldMatrixShader = class extends RaymarchingShaderPart {
|
|
|
44
44
|
getPixelShaderDefinitions(engine) {
|
|
45
45
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
46
46
|
return `
|
|
47
|
-
fn ${this.
|
|
48
|
-
let transform = get_${this.
|
|
47
|
+
fn ${this.Jr}(position: vec3f, outTransformedPosition: ptr<function, vec3f>) {
|
|
48
|
+
let transform = get_${this.NF}(uniformDrawParameters.materialSid, 0u);
|
|
49
49
|
let inv = inverseMat4(transform);
|
|
50
50
|
let tp = (inv * vec4f(position, 1.0)).xyz;
|
|
51
51
|
*outTransformedPosition = tp;
|
|
@@ -53,9 +53,9 @@ fn ${this.Br}(position: vec3f, outTransformedPosition: ptr<function, vec3f>) {
|
|
|
53
53
|
`;
|
|
54
54
|
}
|
|
55
55
|
return `
|
|
56
|
-
void ${this.
|
|
56
|
+
void ${this.Jr}(in vec3 position, out vec3 outTransformedPosition) {
|
|
57
57
|
${this.getMaterialSIDForWebGL()}
|
|
58
|
-
mat4 transform = get_${this.
|
|
58
|
+
mat4 transform = get_${this.NF}(materialSID, 0u);
|
|
59
59
|
mat4 inv = inverse(transform);
|
|
60
60
|
vec3 tp = (inv * vec4(position, 1.0)).xyz;
|
|
61
61
|
outTransformedPosition = tp;
|
|
@@ -5,21 +5,21 @@ import { StandardShaderPart } from "../StandardShaderPart.js";
|
|
|
5
5
|
var Texture2DShader = class extends StandardShaderPart {
|
|
6
6
|
constructor(__functionName) {
|
|
7
7
|
super();
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
8
|
+
this.KF = __functionName;
|
|
9
|
+
this.NF = "";
|
|
10
|
+
this.OF = true;
|
|
11
11
|
}
|
|
12
12
|
setVariableName(name) {
|
|
13
|
-
this.
|
|
13
|
+
this.NF = name;
|
|
14
14
|
}
|
|
15
15
|
setSrgbFlag(sRGB) {
|
|
16
|
-
this.
|
|
16
|
+
this.OF = sRGB;
|
|
17
17
|
}
|
|
18
18
|
getVertexShaderDefinitions(engine) {
|
|
19
19
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
20
|
-
const { textureName, samplerName } = getTextureAndSamplerNames(this.
|
|
20
|
+
const { textureName, samplerName } = getTextureAndSamplerNames(this.NF);
|
|
21
21
|
return `
|
|
22
|
-
fn ${this.
|
|
22
|
+
fn ${this.KF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, rgba: ptr<function, vec4<f32>>, rgb: ptr<function, vec3<f32>>, r: ptr<function, f32>, g: ptr<function, f32>, b: ptr<function, f32>, a: ptr<function, f32>, uvOut: ptr<function, vec2f>) {
|
|
23
23
|
let materialSID = uniformDrawParameters.materialSid;
|
|
24
24
|
let ${textureName}TexUv = uvTransform(scale, offset, rotation, uv);
|
|
25
25
|
var lodFloat = lod;
|
|
@@ -27,7 +27,7 @@ fn ${this.bF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, r
|
|
|
27
27
|
lodFloat = 0.0;
|
|
28
28
|
}
|
|
29
29
|
var rgbaValue = textureSampleLevel(${textureName}, ${samplerName}, ${textureName}TexUv, lodFloat);
|
|
30
|
-
${this.
|
|
30
|
+
${this.OF ? "rgbaValue = vec4f(srgbToLinear(rgbaValue.rgb), rgbaValue.a);" : ""}
|
|
31
31
|
*rgba = rgbaValue;
|
|
32
32
|
*rgb = rgbaValue.rgb;
|
|
33
33
|
*r = rgbaValue.r;
|
|
@@ -39,32 +39,32 @@ fn ${this.bF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, r
|
|
|
39
39
|
`;
|
|
40
40
|
}
|
|
41
41
|
return `
|
|
42
|
-
void ${this.
|
|
42
|
+
void ${this.KF}(vec2 uv, vec2 scale, vec2 offset, float rotation, float lod, out vec4 rgba, out vec3 rgb, out float r, out float g, out float b, out float a, out vec2 uvOut) {
|
|
43
43
|
${this.getMaterialSIDForWebGL()}
|
|
44
|
-
vec2 ${this.
|
|
44
|
+
vec2 ${this.NF}TexUv = uvTransform(scale, offset, rotation, uv);
|
|
45
45
|
float lodFloat = lod;
|
|
46
46
|
vec4 rgbaValue;
|
|
47
47
|
if (lodFloat < 0.0) {
|
|
48
|
-
rgbaValue = texture(u_${this.
|
|
48
|
+
rgbaValue = texture(u_${this.NF}, ${this.NF}TexUv);
|
|
49
49
|
} else {
|
|
50
|
-
rgbaValue = textureLod(u_${this.
|
|
50
|
+
rgbaValue = textureLod(u_${this.NF}, ${this.NF}TexUv, lodFloat);
|
|
51
51
|
}
|
|
52
|
-
${this.
|
|
52
|
+
${this.OF ? "rgbaValue.rgb = srgbToLinear(rgbaValue.rgb);" : ""}
|
|
53
53
|
rgba = rgbaValue;
|
|
54
54
|
rgb = rgbaValue.rgb;
|
|
55
55
|
r = rgbaValue.r;
|
|
56
56
|
g = rgbaValue.g;
|
|
57
57
|
b = rgbaValue.b;
|
|
58
58
|
a = rgbaValue.a;
|
|
59
|
-
uvOut = ${this.
|
|
59
|
+
uvOut = ${this.NF}TexUv;
|
|
60
60
|
}
|
|
61
61
|
`;
|
|
62
62
|
}
|
|
63
63
|
getPixelShaderDefinitions(engine) {
|
|
64
64
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
65
|
-
const { textureName, samplerName } = getTextureAndSamplerNames(this.
|
|
65
|
+
const { textureName, samplerName } = getTextureAndSamplerNames(this.NF);
|
|
66
66
|
return `
|
|
67
|
-
fn ${this.
|
|
67
|
+
fn ${this.KF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, rgba: ptr<function, vec4<f32>>, rgb: ptr<function, vec3<f32>>, r: ptr<function, f32>, g: ptr<function, f32>, b: ptr<function, f32>, a: ptr<function, f32>, uvOut: ptr<function, vec2f>) {
|
|
68
68
|
let materialSID = uniformDrawParameters.materialSid;
|
|
69
69
|
let ${textureName}TexUv = uvTransform(scale, offset, rotation, uv);
|
|
70
70
|
var lodFloat = lod;
|
|
@@ -80,7 +80,7 @@ fn ${this.bF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, r
|
|
|
80
80
|
rgbaValue = textureSampleLevel(${textureName}, ${samplerName}, ${textureName}TexUv, lodFloat);
|
|
81
81
|
}
|
|
82
82
|
#endif
|
|
83
|
-
${this.
|
|
83
|
+
${this.OF ? "rgbaValue = vec4f(srgbToLinear(rgbaValue.rgb), rgbaValue.a);" : ""}
|
|
84
84
|
*rgba = rgbaValue;
|
|
85
85
|
*rgb = rgbaValue.rgb;
|
|
86
86
|
*r = rgbaValue.r;
|
|
@@ -92,24 +92,24 @@ fn ${this.bF}(uv: vec2f, scale: vec2f, offset: vec2f, rotation: f32, lod: f32, r
|
|
|
92
92
|
`;
|
|
93
93
|
}
|
|
94
94
|
return `
|
|
95
|
-
void ${this.
|
|
95
|
+
void ${this.KF}(vec2 uv, vec2 scale, vec2 offset, float rotation, float lod, out vec4 rgba, out vec3 rgb, out float r, out float g, out float b, out float a, out vec2 uvOut) {
|
|
96
96
|
${this.getMaterialSIDForWebGL()}
|
|
97
|
-
vec2 ${this.
|
|
97
|
+
vec2 ${this.NF}TexUv = uvTransform(scale, offset, rotation, uv);
|
|
98
98
|
float lodFloat = lod;
|
|
99
99
|
vec4 rgbaValue;
|
|
100
100
|
if (lodFloat < 0.0) {
|
|
101
|
-
rgbaValue = texture(u_${this.
|
|
101
|
+
rgbaValue = texture(u_${this.NF}, ${this.NF}TexUv);
|
|
102
102
|
} else {
|
|
103
|
-
rgbaValue = textureLod(u_${this.
|
|
103
|
+
rgbaValue = textureLod(u_${this.NF}, ${this.NF}TexUv, lodFloat);
|
|
104
104
|
}
|
|
105
|
-
${this.
|
|
105
|
+
${this.OF ? "rgbaValue.rgb = srgbToLinear(rgbaValue.rgb);" : ""}
|
|
106
106
|
rgba = rgbaValue;
|
|
107
107
|
rgb = rgbaValue.rgb;
|
|
108
108
|
r = rgbaValue.r;
|
|
109
109
|
g = rgbaValue.g;
|
|
110
110
|
b = rgbaValue.b;
|
|
111
111
|
a = rgbaValue.a;
|
|
112
|
-
uvOut = ${this.
|
|
112
|
+
uvOut = ${this.NF}TexUv;
|
|
113
113
|
}
|
|
114
114
|
`;
|
|
115
115
|
}
|
|
@@ -4,55 +4,55 @@ import { StandardShaderPart } from "../StandardShaderPart.js";
|
|
|
4
4
|
var UniformDataShader = class extends StandardShaderPart {
|
|
5
5
|
constructor(__functionName, __compositionType, __componentType) {
|
|
6
6
|
super();
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
7
|
+
this.KF = __functionName;
|
|
8
|
+
this.et = __compositionType;
|
|
9
|
+
this.gt = __componentType;
|
|
10
|
+
this.NF = "";
|
|
11
|
+
this.PF = "";
|
|
12
12
|
}
|
|
13
13
|
setVariableName(name) {
|
|
14
|
-
this.
|
|
14
|
+
this.NF = name;
|
|
15
15
|
}
|
|
16
16
|
setDefaultValue(value) {
|
|
17
|
-
this.
|
|
17
|
+
this.PF = value.toString();
|
|
18
18
|
}
|
|
19
19
|
getVertexShaderDefinitions(engine) {
|
|
20
20
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
21
21
|
return `
|
|
22
|
-
// #param ${this.
|
|
23
|
-
this.
|
|
24
|
-
)}; // initialValue=${this.
|
|
25
|
-
fn ${this.
|
|
26
|
-
*outValue = get_${this.
|
|
22
|
+
// #param ${this.NF}: ${this.et.toWGSLType(
|
|
23
|
+
this.gt
|
|
24
|
+
)}; // initialValue=${this.PF}
|
|
25
|
+
fn ${this.KF}(outValue: ptr<function, ${this.et.toWGSLType(this.gt)}>) {
|
|
26
|
+
*outValue = get_${this.NF}(uniformDrawParameters.materialSid, 0u);
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
30
|
return `
|
|
31
|
-
uniform ${this.
|
|
32
|
-
void ${this.
|
|
31
|
+
uniform ${this.et.getGlslStr(this.gt)} u_${this.NF}; // initialValue=${this.PF}
|
|
32
|
+
void ${this.KF}(out ${this.et.getGlslStr(this.gt)} outValue) {
|
|
33
33
|
${this.getMaterialSIDForWebGL()}
|
|
34
34
|
|
|
35
|
-
outValue = get_${this.
|
|
35
|
+
outValue = get_${this.NF}(materialSID, 0u);
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
38
|
}
|
|
39
39
|
getPixelShaderDefinitions(engine) {
|
|
40
40
|
if (engine.engineState.currentProcessApproach === ProcessApproach.WebGPU) {
|
|
41
41
|
return `
|
|
42
|
-
// #param ${this.
|
|
43
|
-
this.
|
|
44
|
-
)}; // initialValue=${this.
|
|
45
|
-
fn ${this.
|
|
46
|
-
*outValue = get_${this.
|
|
42
|
+
// #param ${this.NF}: ${this.et.toWGSLType(
|
|
43
|
+
this.gt
|
|
44
|
+
)}; // initialValue=${this.PF}
|
|
45
|
+
fn ${this.KF}(outValue: ptr<function, ${this.et.toWGSLType(this.gt)}>) {
|
|
46
|
+
*outValue = get_${this.NF}(uniformDrawParameters.materialSid, 0u);
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
49
|
}
|
|
50
50
|
return `
|
|
51
|
-
uniform ${this.
|
|
52
|
-
void ${this.
|
|
51
|
+
uniform ${this.et.getGlslStr(this.gt)} u_${this.NF}; // initialValue=${this.PF}
|
|
52
|
+
void ${this.KF}(out ${this.et.getGlslStr(this.gt)} outValue) {
|
|
53
53
|
${this.getMaterialSIDForWebGL()}
|
|
54
54
|
|
|
55
|
-
outValue = get_${this.
|
|
55
|
+
outValue = get_${this.NF}(materialSID, 0u);
|
|
56
56
|
}
|
|
57
57
|
`;
|
|
58
58
|
}
|
|
@@ -61,7 +61,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
61
61
|
if (typeof MSC_TRANSCODER === "undefined") {
|
|
62
62
|
Logger.default.error("Failed to call MSC_TRANSCODER() function. Please check to import msc_basis_transcoder.js.");
|
|
63
63
|
}
|
|
64
|
-
this.
|
|
64
|
+
this.SF = this.VF();
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Gets the singleton instance of KTX2TextureLoader.
|
|
@@ -69,10 +69,10 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
69
69
|
* @returns The singleton KTX2TextureLoader instance
|
|
70
70
|
*/
|
|
71
71
|
static getInstance() {
|
|
72
|
-
if (!this.
|
|
73
|
-
this.
|
|
72
|
+
if (!this.dj) {
|
|
73
|
+
this.dj = new _KTX2TextureLoader();
|
|
74
74
|
}
|
|
75
|
-
return this.
|
|
75
|
+
return this.dj;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Transcodes a KTX2 texture from the provided byte array.
|
|
@@ -91,7 +91,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
93
|
transcode(engine, uint8Array) {
|
|
94
|
-
const ktx2Container = this.
|
|
94
|
+
const ktx2Container = this.WF(uint8Array);
|
|
95
95
|
if (ktx2Container.pixelDepth > 0) {
|
|
96
96
|
throw new Error("Only 2D textures are currently supported");
|
|
97
97
|
}
|
|
@@ -102,17 +102,17 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
102
102
|
throw new Error("Cube textures are not currently supported");
|
|
103
103
|
}
|
|
104
104
|
if (ktx2Container.supercompressionScheme === KHR_SUPERCOMPRESSION_ZSTD) {
|
|
105
|
-
if (_KTX2TextureLoader.
|
|
106
|
-
_KTX2TextureLoader.
|
|
105
|
+
if (_KTX2TextureLoader.QF == null) {
|
|
106
|
+
_KTX2TextureLoader.QF = new ZSTDDecoder();
|
|
107
107
|
}
|
|
108
|
-
return _KTX2TextureLoader.
|
|
109
|
-
return this.
|
|
110
|
-
return this.
|
|
108
|
+
return _KTX2TextureLoader.QF.init().then(() => {
|
|
109
|
+
return this.SF.then(() => {
|
|
110
|
+
return this.UF(engine, ktx2Container);
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
return this.
|
|
115
|
-
return this.
|
|
114
|
+
return this.SF.then(() => {
|
|
115
|
+
return this.UF(engine, ktx2Container);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -124,14 +124,14 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
124
124
|
* @returns A promise that resolves when the transcoder is ready
|
|
125
125
|
* @private
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
VF() {
|
|
128
128
|
return new Promise((resolve) => {
|
|
129
|
-
if (_KTX2TextureLoader.
|
|
129
|
+
if (_KTX2TextureLoader.RF) {
|
|
130
130
|
resolve();
|
|
131
131
|
}
|
|
132
132
|
MSC_TRANSCODER().then((transcoderModule) => {
|
|
133
133
|
transcoderModule.initTranscoders();
|
|
134
|
-
_KTX2TextureLoader.
|
|
134
|
+
_KTX2TextureLoader.RF = transcoderModule;
|
|
135
135
|
resolve();
|
|
136
136
|
});
|
|
137
137
|
});
|
|
@@ -147,7 +147,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
147
147
|
* @returns An object containing the transcoding target string and compression type
|
|
148
148
|
* @private
|
|
149
149
|
*/
|
|
150
|
-
|
|
150
|
+
XF(engine, hasAlpha) {
|
|
151
151
|
const webGLResourceRepository = engine.webglResourceRepository;
|
|
152
152
|
const glw = webGLResourceRepository.currentWebGLContextWrapper;
|
|
153
153
|
const astc = glw.webgl2ExtCTAstc || glw.webgl1ExtCTAstc;
|
|
@@ -208,7 +208,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
208
208
|
* @returns An object containing the transcoding target string and compression type
|
|
209
209
|
* @private
|
|
210
210
|
*/
|
|
211
|
-
|
|
211
|
+
YF(engine, hasAlpha) {
|
|
212
212
|
const webGpuResourceRepository = engine.webGpuResourceRepository;
|
|
213
213
|
const adapter = webGpuResourceRepository.getWebGpuDeviceWrapper().gpuAdapter;
|
|
214
214
|
const astc = adapter.features.has("texture-compression-astc");
|
|
@@ -252,7 +252,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
252
252
|
* @returns The parsed KTX2 container with all metadata and texture data
|
|
253
253
|
* @private
|
|
254
254
|
*/
|
|
255
|
-
|
|
255
|
+
WF(uint8Array) {
|
|
256
256
|
return read(uint8Array);
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
@@ -269,7 +269,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
269
269
|
* @returns The transcoded texture data with all mipmap levels
|
|
270
270
|
* @private
|
|
271
271
|
*/
|
|
272
|
-
|
|
272
|
+
UF(engine, ktx2Container) {
|
|
273
273
|
var _a;
|
|
274
274
|
const width = ktx2Container.pixelWidth;
|
|
275
275
|
const height = ktx2Container.pixelHeight;
|
|
@@ -277,12 +277,12 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
277
277
|
const imageDescs = (_a = ktx2Container.globalData) == null ? void 0 : _a.imageDescs;
|
|
278
278
|
const dfd = ktx2Container.dataFormatDescriptor[0];
|
|
279
279
|
const compressedTextureFormat = dfd.colorModel === KHR_DF_MODEL_UASTC ? CompressedTextureFormat.UASTC4x4 : CompressedTextureFormat.ETC1S;
|
|
280
|
-
const hasAlpha = this.
|
|
280
|
+
const hasAlpha = this.ZF(dfd, compressedTextureFormat);
|
|
281
281
|
const isVideo = false;
|
|
282
|
-
const transcoderModule = _KTX2TextureLoader.
|
|
282
|
+
const transcoderModule = _KTX2TextureLoader.RF;
|
|
283
283
|
const transcoder = compressedTextureFormat === CompressedTextureFormat.UASTC4x4 ? new transcoderModule.UastcImageTranscoder() : new transcoderModule.BasisLzEtc1sImageTranscoder();
|
|
284
284
|
const textureFormat = compressedTextureFormat === CompressedTextureFormat.UASTC4x4 ? transcoderModule.TextureFormat.UASTC4x4 : transcoderModule.TextureFormat.ETC1S;
|
|
285
|
-
const { transcodeTargetStr, compressionTextureType } = engine.engineState.currentProcessApproach === ProcessApproach.WebGPU ? this.
|
|
285
|
+
const { transcodeTargetStr, compressionTextureType } = engine.engineState.currentProcessApproach === ProcessApproach.WebGPU ? this.YF(engine, hasAlpha) : this.XF(engine, hasAlpha);
|
|
286
286
|
const transcodeTarget = transcoderModule.TranscodeTarget[transcodeTargetStr];
|
|
287
287
|
const mipmapData = [];
|
|
288
288
|
const transcodedData = {
|
|
@@ -301,7 +301,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
301
301
|
const levelBufferByteLength = imageInfo.numBlocksX * imageInfo.numBlocksY * dfd.bytesPlane[0];
|
|
302
302
|
if (ktx2Container.supercompressionScheme === KHR_SUPERCOMPRESSION_ZSTD) {
|
|
303
303
|
levelBuffer = new Uint8Array(
|
|
304
|
-
_KTX2TextureLoader.
|
|
304
|
+
_KTX2TextureLoader.QF.decode(
|
|
305
305
|
new Uint8Array(levelBuffer.buffer, levelBuffer.byteOffset, levelBuffer.byteLength),
|
|
306
306
|
levelUncompressedByteLength
|
|
307
307
|
)
|
|
@@ -380,11 +380,11 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
380
380
|
* @returns True if the texture has alpha channel data, false otherwise
|
|
381
381
|
* @private
|
|
382
382
|
*/
|
|
383
|
-
|
|
383
|
+
ZF(dfd, compressedTextureFormat) {
|
|
384
384
|
if (compressedTextureFormat === CompressedTextureFormat.UASTC4x4) {
|
|
385
|
-
return _KTX2TextureLoader.
|
|
385
|
+
return _KTX2TextureLoader.TF(dfd.samples[0]) === KTX2ChannelUASTC.RGBA;
|
|
386
386
|
}
|
|
387
|
-
return dfd.samples.length === 2 && (_KTX2TextureLoader.
|
|
387
|
+
return dfd.samples.length === 2 && (_KTX2TextureLoader.TF(dfd.samples[0]) === KTX2ChannelETC1S.AAA || _KTX2TextureLoader.TF(dfd.samples[1]) === KTX2ChannelETC1S.AAA);
|
|
388
388
|
}
|
|
389
389
|
/**
|
|
390
390
|
* Returns the KHR_DF channel ID of a DFD sample.
|
|
@@ -397,7 +397,7 @@ var KTX2TextureLoader = class _KTX2TextureLoader {
|
|
|
397
397
|
* @returns The numeric KHR_DF channel ID
|
|
398
398
|
* @private
|
|
399
399
|
*/
|
|
400
|
-
static
|
|
400
|
+
static TF(sample) {
|
|
401
401
|
var _a, _b;
|
|
402
402
|
const versionTolerantSample = sample;
|
|
403
403
|
return (_b = (_a = versionTolerantSample.channelType) != null ? _a : versionTolerantSample.channelID) != null ? _b : 0;
|