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
|
@@ -164,67 +164,67 @@ function findAttribute(primitive, name) {
|
|
|
164
164
|
}
|
|
165
165
|
var AttributeReader = class {
|
|
166
166
|
constructor(accessor) {
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
167
|
+
this.xK = 0;
|
|
168
|
+
this.yK = 4;
|
|
169
|
+
this.Rt = 1;
|
|
170
|
+
this.tK = false;
|
|
171
|
+
this.nK = false;
|
|
172
|
+
this.em = accessor;
|
|
173
173
|
if (accessor === void 0) {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
176
|
+
this.xK = Math.min(accessor.numberOfComponents, 4);
|
|
177
|
+
this.yK = accessor.componentSizeInBytes;
|
|
178
178
|
const componentType = accessor.componentType;
|
|
179
179
|
const hasNormalizedFormat = accessor.numberOfComponents === 2 || accessor.numberOfComponents === 4;
|
|
180
180
|
if (accessor.normalized && hasNormalizedFormat) {
|
|
181
181
|
if (componentType === ComponentType.UnsignedByte) {
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
182
|
+
this.nK = true;
|
|
183
|
+
this.Rt = 255;
|
|
184
184
|
} else if (componentType === ComponentType.Byte) {
|
|
185
|
-
this.
|
|
186
|
-
this.
|
|
187
|
-
this.
|
|
185
|
+
this.nK = true;
|
|
186
|
+
this.Rt = 127;
|
|
187
|
+
this.tK = true;
|
|
188
188
|
} else if (componentType === ComponentType.UnsignedShort) {
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
189
|
+
this.nK = true;
|
|
190
|
+
this.Rt = 65535;
|
|
191
191
|
} else if (componentType === ComponentType.Short) {
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
192
|
+
this.nK = true;
|
|
193
|
+
this.Rt = 32767;
|
|
194
|
+
this.tK = true;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
get exists() {
|
|
199
|
-
return this.
|
|
199
|
+
return this.em !== void 0;
|
|
200
200
|
}
|
|
201
201
|
/** Reads the component `c` of the element `i`. */
|
|
202
202
|
read(i, c) {
|
|
203
|
-
const accessor = this.
|
|
204
|
-
if (accessor === void 0 || c >= this.
|
|
203
|
+
const accessor = this.em;
|
|
204
|
+
if (accessor === void 0 || c >= this.xK) {
|
|
205
205
|
return c === 3 ? 1 : 0;
|
|
206
206
|
}
|
|
207
|
-
const value = accessor.getScalarAt(i, c * this.
|
|
208
|
-
if (!this.
|
|
207
|
+
const value = accessor.getScalarAt(i, c * this.yK, EmptyAccessOption);
|
|
208
|
+
if (!this.nK) {
|
|
209
209
|
return value;
|
|
210
210
|
}
|
|
211
|
-
const normalized = value / this.
|
|
212
|
-
return this.
|
|
211
|
+
const normalized = value / this.Rt;
|
|
212
|
+
return this.tK ? Math.max(normalized, -1) : normalized;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
var WebGpuVertexDeformer = class {
|
|
216
216
|
constructor(device) {
|
|
217
|
-
this.
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
221
|
-
this.
|
|
222
|
-
this.
|
|
223
|
-
this.
|
|
217
|
+
this.sH = new Uint32Array(ParamsByteSize / 4);
|
|
218
|
+
this.vK = new DirtyRange();
|
|
219
|
+
this.RG = new DirtyRange();
|
|
220
|
+
this.mK = /* @__PURE__ */ new Map();
|
|
221
|
+
this.mu = 0;
|
|
222
|
+
this.AK = -1;
|
|
223
|
+
this.wK = false;
|
|
224
224
|
/** `Mesh._primitivePositionUpdateVersion` when the sources were last revalidated. */
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
227
|
-
this.
|
|
225
|
+
this.nH = -1;
|
|
226
|
+
this.xG = device;
|
|
227
|
+
this.DG = new GpuDeformRegistry(InitialCapacities);
|
|
228
228
|
const r = "read-only-storage";
|
|
229
229
|
const types = [r, "uniform", r, r, r, r, r, "storage", "storage"];
|
|
230
230
|
const layout = device.createBindGroupLayout({
|
|
@@ -239,53 +239,53 @@ var WebGpuVertexDeformer = class {
|
|
|
239
239
|
entryPoint: "deform"
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
|
-
this.
|
|
243
|
-
this.
|
|
242
|
+
this.qK = { layout, pipeline, bindGroupBuffers: [] };
|
|
243
|
+
this.FG = device.createBuffer({
|
|
244
244
|
label: "GpuSkinning.params",
|
|
245
245
|
size: ParamsByteSize,
|
|
246
246
|
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
|
|
247
247
|
});
|
|
248
|
-
this.
|
|
248
|
+
this.oK = device.createBuffer({
|
|
249
249
|
label: "GpuSkinning.dummy",
|
|
250
250
|
size: 16,
|
|
251
251
|
usage: GPUBufferUsage.STORAGE
|
|
252
252
|
});
|
|
253
|
-
this.
|
|
253
|
+
this.pH(InitialCapacities);
|
|
254
254
|
}
|
|
255
255
|
/** The bookkeeping of the allocations (exposed for tests and statistics). */
|
|
256
256
|
get registry() {
|
|
257
|
-
return this.
|
|
257
|
+
return this.DG;
|
|
258
258
|
}
|
|
259
259
|
/** The deformed vertices, read by the vertex shaders (group 0, binding 4). */
|
|
260
260
|
get deformedVerticesBuffer() {
|
|
261
|
-
return this.
|
|
261
|
+
return this.sK;
|
|
262
262
|
}
|
|
263
263
|
/** The bounding boxes of the deformed instances, read by the culling. */
|
|
264
264
|
get boundsBuffer() {
|
|
265
|
-
return this.
|
|
265
|
+
return this.pK;
|
|
266
266
|
}
|
|
267
267
|
/** Whether any entry is alive. */
|
|
268
268
|
get hasEntries() {
|
|
269
|
-
return this.
|
|
269
|
+
return this.DG.entryCount > 0;
|
|
270
270
|
}
|
|
271
271
|
/** Whether the tables changed since the last dispatch (the deformation must run again). */
|
|
272
272
|
get isChanged() {
|
|
273
|
-
return this.
|
|
273
|
+
return this.mu !== this.AK;
|
|
274
274
|
}
|
|
275
275
|
/** Whether an allocation failed since the last reset (the tables must grow). */
|
|
276
276
|
get isOverflowed() {
|
|
277
|
-
return this.
|
|
277
|
+
return this.DG.isOverflowed;
|
|
278
278
|
}
|
|
279
279
|
/**
|
|
280
280
|
* Whether the entries can no longer be updated in place (the vertex counts of a mesh changed): every entry must be
|
|
281
281
|
* dropped with `reset`.
|
|
282
282
|
*/
|
|
283
283
|
get isResetRequested() {
|
|
284
|
-
return this.
|
|
284
|
+
return this.wK;
|
|
285
285
|
}
|
|
286
286
|
/** The current capacities of the tables. */
|
|
287
287
|
get capacities() {
|
|
288
|
-
return this.
|
|
288
|
+
return this.DG.capacities;
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Gets the deformation of the instances of a mesh, allocating and writing its tables on first use.
|
|
@@ -309,7 +309,7 @@ var WebGpuVertexDeformer = class {
|
|
|
309
309
|
primitives.push(primitive);
|
|
310
310
|
vertexCounts.push(position.elementCount);
|
|
311
311
|
}
|
|
312
|
-
const result = this.
|
|
312
|
+
const result = this.DG.acquire(entityInfo, vertexCounts, entityInfo.length / 4);
|
|
313
313
|
if (result === void 0) {
|
|
314
314
|
return void 0;
|
|
315
315
|
}
|
|
@@ -323,10 +323,10 @@ var WebGpuVertexDeformer = class {
|
|
|
323
323
|
morphPrimitiveCount: -1,
|
|
324
324
|
blendShapeOffsets: []
|
|
325
325
|
};
|
|
326
|
-
this.
|
|
327
|
-
this.
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
326
|
+
this.mK.set(result.entry, info);
|
|
327
|
+
this.BK(result.entry, info);
|
|
328
|
+
this.CK(result.entry, info);
|
|
329
|
+
this.mu++;
|
|
330
330
|
}
|
|
331
331
|
return result.entry;
|
|
332
332
|
}
|
|
@@ -334,23 +334,23 @@ var WebGpuVertexDeformer = class {
|
|
|
334
334
|
* Removes the reference of a cull group to an entry (after the commands that used it were submitted).
|
|
335
335
|
*/
|
|
336
336
|
release(entry) {
|
|
337
|
-
if (!this.
|
|
337
|
+
if (!this.DG.release(entry)) {
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
|
-
this.
|
|
341
|
-
const chunks = this.
|
|
340
|
+
this.mK.delete(entry);
|
|
341
|
+
const chunks = this.OG;
|
|
342
342
|
for (let k = 0; k < entry.chunkCount; k++) {
|
|
343
343
|
chunks[(entry.chunkBase + k) * ChunkWordSize + 1] = 0;
|
|
344
344
|
}
|
|
345
|
-
this.
|
|
346
|
-
this.
|
|
345
|
+
this.RG.add(entry.chunkBase, entry.chunkBase + entry.chunkCount);
|
|
346
|
+
this.mu++;
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* The index of the first deformed vertex of a primitive among the deformed vertices of an instance
|
|
350
350
|
* (`UniformDrawParameters.deformedVertexOffset`), or undefined when the primitive is not one of the entry's mesh.
|
|
351
351
|
*/
|
|
352
352
|
getPrimitiveOffset(entry, primitive) {
|
|
353
|
-
const info = this.
|
|
353
|
+
const info = this.mK.get(entry);
|
|
354
354
|
if (info === void 0) {
|
|
355
355
|
return void 0;
|
|
356
356
|
}
|
|
@@ -372,11 +372,11 @@ var WebGpuVertexDeformer = class {
|
|
|
372
372
|
*/
|
|
373
373
|
refresh() {
|
|
374
374
|
const positionUpdateVersion = Mesh._primitivePositionUpdateVersion;
|
|
375
|
-
if (positionUpdateVersion !== this.
|
|
376
|
-
this.
|
|
377
|
-
this.
|
|
375
|
+
if (positionUpdateVersion !== this.nH) {
|
|
376
|
+
this.nH = positionUpdateVersion;
|
|
377
|
+
this.DK();
|
|
378
378
|
}
|
|
379
|
-
this.
|
|
379
|
+
this.EK();
|
|
380
380
|
}
|
|
381
381
|
/**
|
|
382
382
|
* Records the deformation compute pass (after clearing the bounding boxes) when there is anything to deform.
|
|
@@ -389,30 +389,30 @@ var WebGpuVertexDeformer = class {
|
|
|
389
389
|
*/
|
|
390
390
|
encode(encoder, storageBuffer, morphBuffers, gpuTimer) {
|
|
391
391
|
var _a, _b, _c;
|
|
392
|
-
const registry = this.
|
|
392
|
+
const registry = this.DG;
|
|
393
393
|
if (registry.entryCount === 0) {
|
|
394
394
|
return false;
|
|
395
395
|
}
|
|
396
|
-
const device = this.
|
|
397
|
-
this.
|
|
398
|
-
this.
|
|
396
|
+
const device = this.xG;
|
|
397
|
+
this.TG(this.rK, this.uK, this.vK, SourceVertexWordSize);
|
|
398
|
+
this.TG(this.MG, this.OG, this.RG, ChunkWordSize);
|
|
399
399
|
const chunkCount = registry.chunkHighWater;
|
|
400
400
|
const chunksPerRow = Math.max(1, Math.min(chunkCount, MaxWorkgroupsPerDimension));
|
|
401
|
-
const params = this.
|
|
401
|
+
const params = this.sH;
|
|
402
402
|
params[0] = chunkCount;
|
|
403
403
|
params[1] = chunksPerRow;
|
|
404
|
-
device.queue.writeBuffer(this.
|
|
405
|
-
const stage = this.
|
|
404
|
+
device.queue.writeBuffer(this.FG, 0, params);
|
|
405
|
+
const stage = this.qK;
|
|
406
406
|
const buffers = [
|
|
407
407
|
storageBuffer,
|
|
408
|
-
this.
|
|
409
|
-
this.
|
|
410
|
-
this.
|
|
411
|
-
(_a = morphBuffers.blendShapeData) != null ? _a : this.
|
|
412
|
-
(_b = morphBuffers.morphOffsets) != null ? _b : this.
|
|
413
|
-
(_c = morphBuffers.morphWeights) != null ? _c : this.
|
|
414
|
-
this.
|
|
415
|
-
this.
|
|
408
|
+
this.FG,
|
|
409
|
+
this.rK,
|
|
410
|
+
this.MG,
|
|
411
|
+
(_a = morphBuffers.blendShapeData) != null ? _a : this.oK,
|
|
412
|
+
(_b = morphBuffers.morphOffsets) != null ? _b : this.oK,
|
|
413
|
+
(_c = morphBuffers.morphWeights) != null ? _c : this.oK,
|
|
414
|
+
this.sK,
|
|
415
|
+
this.pK
|
|
416
416
|
];
|
|
417
417
|
let isBindGroupValid = stage.bindGroup != null;
|
|
418
418
|
for (let i = 0; i < buffers.length && isBindGroupValid; i++) {
|
|
@@ -426,7 +426,7 @@ var WebGpuVertexDeformer = class {
|
|
|
426
426
|
});
|
|
427
427
|
stage.bindGroupBuffers = buffers;
|
|
428
428
|
}
|
|
429
|
-
encoder.clearBuffer(this.
|
|
429
|
+
encoder.clearBuffer(this.pK, 0, registry.boundsHighWater * DeformBoundsByteSize);
|
|
430
430
|
const passDescriptor = { label: "GpuSkinning" };
|
|
431
431
|
const timestampWrites = gpuTimer == null ? void 0 : gpuTimer.getTimestampWrites("GpuSkinning");
|
|
432
432
|
if (timestampWrites != null) {
|
|
@@ -439,7 +439,7 @@ var WebGpuVertexDeformer = class {
|
|
|
439
439
|
pass.dispatchWorkgroups(chunksPerRow, Math.ceil(chunkCount / chunksPerRow));
|
|
440
440
|
}
|
|
441
441
|
pass.end();
|
|
442
|
-
this.
|
|
442
|
+
this.AK = this.mu;
|
|
443
443
|
return true;
|
|
444
444
|
}
|
|
445
445
|
/**
|
|
@@ -447,13 +447,13 @@ var WebGpuVertexDeformer = class {
|
|
|
447
447
|
* cannot grow (the device limits are reached; the failed draws stay unculled).
|
|
448
448
|
*/
|
|
449
449
|
getGrownCapacities() {
|
|
450
|
-
const registry = this.
|
|
450
|
+
const registry = this.DG;
|
|
451
451
|
if (!registry.isOverflowed) {
|
|
452
452
|
return void 0;
|
|
453
453
|
}
|
|
454
454
|
const required = registry.requiredCapacities;
|
|
455
455
|
const current = registry.capacities;
|
|
456
|
-
const limits = this.
|
|
456
|
+
const limits = this.xG.limits;
|
|
457
457
|
const maxBytes = Math.min(limits.maxStorageBufferBindingSize, limits.maxBufferSize);
|
|
458
458
|
const grow = (capacity, needed, bytesPerSlot) => {
|
|
459
459
|
let next = capacity;
|
|
@@ -478,74 +478,74 @@ var WebGpuVertexDeformer = class {
|
|
|
478
478
|
* and the render bundles that bound the deformed vertex buffer.
|
|
479
479
|
*/
|
|
480
480
|
reset(capacities) {
|
|
481
|
-
this.
|
|
482
|
-
this.
|
|
483
|
-
this.
|
|
484
|
-
this.
|
|
485
|
-
this.
|
|
486
|
-
this.
|
|
481
|
+
this.rH();
|
|
482
|
+
this.pH(capacities);
|
|
483
|
+
this.DG.reset(capacities);
|
|
484
|
+
this.mK.clear();
|
|
485
|
+
this.wK = false;
|
|
486
|
+
this.mu++;
|
|
487
487
|
}
|
|
488
488
|
/** Releases the GPU resources. */
|
|
489
489
|
destroy() {
|
|
490
|
-
this.
|
|
491
|
-
this.
|
|
492
|
-
this.
|
|
490
|
+
this.rH();
|
|
491
|
+
this.FG.destroy();
|
|
492
|
+
this.oK.destroy();
|
|
493
493
|
}
|
|
494
|
-
|
|
495
|
-
const device = this.
|
|
496
|
-
this.
|
|
494
|
+
pH(capacities) {
|
|
495
|
+
const device = this.xG;
|
|
496
|
+
this.rK = device.createBuffer({
|
|
497
497
|
label: "GpuSkinning.sources",
|
|
498
498
|
size: capacities.sourceVertices * SourceVertexByteSize,
|
|
499
499
|
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
|
|
500
500
|
});
|
|
501
|
-
this.
|
|
501
|
+
this.MG = device.createBuffer({
|
|
502
502
|
label: "GpuSkinning.chunks",
|
|
503
503
|
size: capacities.chunks * ChunkByteSize,
|
|
504
504
|
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
|
|
505
505
|
});
|
|
506
|
-
this.
|
|
506
|
+
this.sK = device.createBuffer({
|
|
507
507
|
label: "GpuSkinning.deformedVertices",
|
|
508
508
|
size: capacities.deformedVertices * DeformedVertexByteSize,
|
|
509
509
|
// COPY_SRC lets tests and tools read back the deformed vertices.
|
|
510
510
|
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC
|
|
511
511
|
});
|
|
512
|
-
this.
|
|
512
|
+
this.pK = device.createBuffer({
|
|
513
513
|
label: "GpuSkinning.bounds",
|
|
514
514
|
size: capacities.bounds * DeformBoundsByteSize,
|
|
515
515
|
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST | GPUBufferUsage.COPY_SRC
|
|
516
516
|
});
|
|
517
517
|
const sources = new ArrayBuffer(capacities.sourceVertices * SourceVertexByteSize);
|
|
518
|
-
this.
|
|
519
|
-
this.
|
|
520
|
-
this.
|
|
521
|
-
this.
|
|
522
|
-
this.
|
|
523
|
-
this.
|
|
524
|
-
this.
|
|
525
|
-
this.
|
|
526
|
-
}
|
|
527
|
-
|
|
518
|
+
this.uK = new Uint32Array(sources);
|
|
519
|
+
this.zK = new Float32Array(sources);
|
|
520
|
+
this.OG = new Uint32Array(capacities.chunks * ChunkWordSize);
|
|
521
|
+
this.vK.clear();
|
|
522
|
+
this.RG.clear();
|
|
523
|
+
this.RG.add(0, capacities.chunks);
|
|
524
|
+
this.qK.bindGroup = void 0;
|
|
525
|
+
this.qK.bindGroupBuffers = [];
|
|
526
|
+
}
|
|
527
|
+
rH() {
|
|
528
528
|
var _a, _b, _c, _d;
|
|
529
|
-
(_a = this.
|
|
530
|
-
(_b = this.
|
|
531
|
-
(_c = this.
|
|
532
|
-
(_d = this.
|
|
529
|
+
(_a = this.rK) == null ? void 0 : _a.destroy();
|
|
530
|
+
(_b = this.MG) == null ? void 0 : _b.destroy();
|
|
531
|
+
(_c = this.sK) == null ? void 0 : _c.destroy();
|
|
532
|
+
(_d = this.pK) == null ? void 0 : _d.destroy();
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
TG(buffer, mirror, dirty, wordsPerSlot) {
|
|
535
535
|
if (dirty.isEmpty) {
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
538
|
const begin = dirty.min * wordsPerSlot;
|
|
539
539
|
const end = Math.min(dirty.max * wordsPerSlot, mirror.length);
|
|
540
|
-
this.
|
|
540
|
+
this.xG.queue.writeBuffer(buffer, begin * 4, mirror, begin, end - begin);
|
|
541
541
|
dirty.clear();
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
544
544
|
* Writes the undeformed vertices of the primitives of an entry's mesh.
|
|
545
545
|
*/
|
|
546
|
-
|
|
547
|
-
const u32 = this.
|
|
548
|
-
const f32 = this.
|
|
546
|
+
BK(entry, info) {
|
|
547
|
+
const u32 = this.uK;
|
|
548
|
+
const f32 = this.zK;
|
|
549
549
|
for (let p = 0; p < info.primitives.length; p++) {
|
|
550
550
|
const primitive = info.primitives[p];
|
|
551
551
|
const position = new AttributeReader(findAttribute(primitive, "POSITION"));
|
|
@@ -577,13 +577,13 @@ var WebGpuVertexDeformer = class {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
this.
|
|
580
|
+
this.vK.add(entry.sourceBase, entry.sourceBase + entry.vertexCount);
|
|
581
581
|
}
|
|
582
582
|
/**
|
|
583
583
|
* Writes the chunks of an entry: the source and destination ranges, the skeleton and the morph targets applied to
|
|
584
584
|
* each primitive of each instance.
|
|
585
585
|
*/
|
|
586
|
-
|
|
586
|
+
CK(entry, info) {
|
|
587
587
|
var _a, _b, _c, _d;
|
|
588
588
|
const engine = info.engine;
|
|
589
589
|
const entityInfo = info.entityInfo;
|
|
@@ -598,7 +598,7 @@ var WebGpuVertexDeformer = class {
|
|
|
598
598
|
Component._getVariableLengthLocationMemberName("boneData")
|
|
599
599
|
);
|
|
600
600
|
const infoOffsets = Component.getLocationOffsetOfMemberOfComponent(engine, SkeletalComponent, "boneDataInfo");
|
|
601
|
-
const chunks = this.
|
|
601
|
+
const chunks = this.OG;
|
|
602
602
|
for (let i = 0; i < entry.instanceCount; i++) {
|
|
603
603
|
const skeletalSID = entityInfo[4 * i + 1];
|
|
604
604
|
const blendShapeSID = entityInfo[4 * i + 2];
|
|
@@ -649,14 +649,14 @@ var WebGpuVertexDeformer = class {
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
this.
|
|
652
|
+
this.RG.add(entry.chunkBase, entry.chunkBase + entry.chunkCount);
|
|
653
653
|
}
|
|
654
654
|
/**
|
|
655
655
|
* Rewrites the sources of the meshes whose vertex positions were updated. When the vertex counts changed, the entry
|
|
656
656
|
* layout is no longer valid and a reset is requested.
|
|
657
657
|
*/
|
|
658
|
-
|
|
659
|
-
for (const [entry, info] of this.
|
|
658
|
+
DK() {
|
|
659
|
+
for (const [entry, info] of this.mK) {
|
|
660
660
|
const mesh = info.mesh;
|
|
661
661
|
if (mesh.primitivePositionUpdateCount === info.positionUpdateCount) {
|
|
662
662
|
continue;
|
|
@@ -669,25 +669,25 @@ var WebGpuVertexDeformer = class {
|
|
|
669
669
|
isLayoutValid = primitive === info.primitives[p] && position !== void 0 && position.elementCount === entry.primitiveVertexCounts[p];
|
|
670
670
|
}
|
|
671
671
|
if (!isLayoutValid) {
|
|
672
|
-
this.
|
|
672
|
+
this.wK = true;
|
|
673
673
|
continue;
|
|
674
674
|
}
|
|
675
|
-
this.
|
|
676
|
-
this.
|
|
675
|
+
this.BK(entry, info);
|
|
676
|
+
this.mu++;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
/**
|
|
680
680
|
* Rewrites the chunks of the entries when the morph target or blend shape weight layouts changed (primitives with
|
|
681
681
|
* morph targets or blend shape components were created or destroyed).
|
|
682
682
|
*/
|
|
683
|
-
|
|
683
|
+
EK() {
|
|
684
684
|
const morphPrimitiveCount = Primitive.getPrimitiveCountHasMorph();
|
|
685
|
-
for (const [entry, info] of this.
|
|
685
|
+
for (const [entry, info] of this.mK) {
|
|
686
686
|
if (info.morphPrimitiveCount === morphPrimitiveCount && info.blendShapeOffsets === BlendShapeComponent.getOffsetsInUniform(info.engine)) {
|
|
687
687
|
continue;
|
|
688
688
|
}
|
|
689
|
-
this.
|
|
690
|
-
this.
|
|
689
|
+
this.CK(entry, info);
|
|
690
|
+
this.mu++;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
};
|
package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// shaderity:/Users/emadurandal/ghq/github.com/actnwit/RhodoniteEditor2/submodules/RhodoniteTS/src/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl
|
|
2
|
+
var code = "/* shaderity: @{definitions} */\n/* shaderity: @{vertexOutput} */\n/* shaderity: @{prerequisites} */\n\n/* shaderity: @{getters} */\n\n@fragment\nfn main(\n input: VertexOutput\n) -> @location(0) vec4<f32> {\n/* shaderity: @{mainPrerequisites} */\n\n // position_inWorld and color_0 carry the clip space positions of this frame (without the jitter) and of\n // the previous frame (see MotionVectorShader.vert.wgsl).\n let currentPosition_inClip = input.position_inWorld;\n let previousPosition_inClip = input.color_0;\n\n // The motion from the previous frame in texture coordinates. In WebGPU, the v axis of the texture\n // coordinates points down while the NDC y axis points up.\n var velocity = vec2<f32>(2.0, 2.0); // moves the history lookup off screen, i.e. rejects the history\n if (previousPosition_inClip.w > 0.0) {\n let currentNdc = currentPosition_inClip.xy / currentPosition_inClip.w;\n let previousNdc = previousPosition_inClip.xy / previousPosition_inClip.w;\n velocity = (currentNdc - previousNdc) * vec2<f32>(0.5, -0.5);\n }\n\n // z: the depth, used to pick the motion vector of the closest surface around a pixel.\n return vec4<f32>(velocity, input.position.z, 1.0);\n}\n";
|
|
3
|
+
var shaderStage = "fragment";
|
|
4
|
+
var isFragmentShader = true;
|
|
5
|
+
var MotionVectorShader_frag_default = { code, shaderStage, isFragmentShader };
|
|
6
|
+
export {
|
|
7
|
+
code,
|
|
8
|
+
MotionVectorShader_frag_default as default,
|
|
9
|
+
isFragmentShader,
|
|
10
|
+
shaderStage
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2hhZGVyaXR5Oi9Vc2Vycy9lbWFkdXJhbmRhbC9naHEvZ2l0aHViLmNvbS9hY3Rud2l0L1Job2Rvbml0ZUVkaXRvcjIvc3VibW9kdWxlcy9SaG9kb25pdGVUUy9zcmMvd2ViZ3B1L3NoYWRlcml0eV9zaGFkZXJzL01vdGlvblZlY3RvclNoYWRlci9Nb3Rpb25WZWN0b3JTaGFkZXIuZnJhZy53Z3NsIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJ7XCJjb2RlXCI6XCIvKiBzaGFkZXJpdHk6IEB7ZGVmaW5pdGlvbnN9ICovXFxuLyogc2hhZGVyaXR5OiBAe3ZlcnRleE91dHB1dH0gKi9cXG4vKiBzaGFkZXJpdHk6IEB7cHJlcmVxdWlzaXRlc30gKi9cXG5cXG4vKiBzaGFkZXJpdHk6IEB7Z2V0dGVyc30gKi9cXG5cXG5AZnJhZ21lbnRcXG5mbiBtYWluKFxcbiAgaW5wdXQ6IFZlcnRleE91dHB1dFxcbikgLT4gQGxvY2F0aW9uKDApIHZlYzQ8ZjMyPiB7XFxuLyogc2hhZGVyaXR5OiBAe21haW5QcmVyZXF1aXNpdGVzfSAqL1xcblxcbiAg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sIC0wLjUpO1xcbiAgfVxcblxcbiAgLy8gejogdGhlIGRlcHRoLCB1c2VkIHRvIHBpY2sgdGhlIG1vdGlvbiB2ZWN0b3Igb2YgdGhlIGNsb3Nlc3Qgc3VyZmFjZSBhcm91bmQgYSBwaXhlbC5cXG4gIHJldHVybiB2ZWM0PGYzMj4odmVsb2NpdHksIGlucHV0LnBvc2l0aW9uLnosIDEuMCk7XFxufVxcblwiLFwic2hhZGVyU3RhZ2VcIjpcImZyYWdtZW50XCIsXCJpc0ZyYWdtZW50U2hhZGVyXCI6dHJ1ZX0iXSwKICAibWFwcGluZ3MiOiAiO0FBQUMsV0FBTztBQUErckMsa0JBQWM7QUFBVyx1QkFBbUI7QUFBbnZDLHdDQUFDLE1BQXNzQyxhQUF5QixpQkFBdUI7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// shaderity:/Users/emadurandal/ghq/github.com/actnwit/RhodoniteEditor2/submodules/RhodoniteTS/src/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl
|
|
2
|
+
var code = "\n/* shaderity: @{definitions} */\n/* shaderity: @{vertexOutput} */\n/* shaderity: @{prerequisites} */\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n/* shaderity: @{processGeometry} */\n\n#ifdef RN_IS_SKINNING\n// The matrix of one joint decoded from the bone data of the previous frame (see getBoneMatrix in processGeometry)\nfn getPreviousBoneMatrix(skeletalComponentSID: u32, jointIdx: u32, boneDataType: i32, boneDataInfo: vec4<f32>) -> mat4x4<f32> {\n let chunkCount = boneDataChunkCountOfJoint(boneDataType);\n let base = jointIdx * chunkCount;\n let c0 = get_previousBoneData(skeletalComponentSID, base);\n var c1 = vec4<f32>(0.0);\n var c2 = vec4<f32>(0.0);\n if (chunkCount >= 2u) {\n c1 = get_previousBoneData(skeletalComponentSID, base + 1u);\n }\n if (chunkCount >= 3u) {\n c2 = get_previousBoneData(skeletalComponentSID, base + 2u);\n }\n return decodeBoneMatrix(boneDataType, c0, c1, c2, boneDataInfo);\n}\n\n// The skinning matrix of the previous frame. The previous bone data info has w = -1 until the skeleton has\n// previous bone data; the current skinning matrix is used then.\nfn getPreviousSkinMatrix(skeletalComponentSID: u32, joint: vec4<u32>, weight: vec4<f32>) -> mat4x4<f32> {\n let boneDataInfo = get_previousBoneDataInfo(skeletalComponentSID);\n if (boneDataInfo.w < 0.0) {\n return getSkinMatrix(skeletalComponentSID, joint, weight);\n }\n let boneDataType = i32(boneDataInfo.w + 0.5);\n var skinMat: mat4x4<f32> = weight.x * getPreviousBoneMatrix(skeletalComponentSID, joint.x, boneDataType, boneDataInfo);\n skinMat += weight.y * getPreviousBoneMatrix(skeletalComponentSID, joint.y, boneDataType, boneDataInfo);\n skinMat += weight.z * getPreviousBoneMatrix(skeletalComponentSID, joint.z, boneDataType, boneDataInfo);\n skinMat += weight.w * getPreviousBoneMatrix(skeletalComponentSID, joint.w, boneDataType, boneDataInfo);\n return skinMat;\n}\n#endif\n\n@vertex\nfn main(\n/* shaderity: @{vertexInput} */\n) -> VertexOutput {\n/* shaderity: @{mainPrerequisites} */\n var output : VertexOutput;\n\n#ifdef RN_USE_NORMAL\n#else\n let normal = vec3<f32>(0.0, 0.0, 0.0);\n#endif\n\n#ifdef RN_USE_JOINTS_0\n let joint = joints_0;\n#else\n let joint = vec4<u32>(0, 0, 0, 0);\n#endif\n#ifdef RN_USE_WEIGHTS_0\n let weight = weights_0;\n#else\n let weight = vec4<f32>(0.0, 0.0, 0.0, 0.0);\n#endif\n#ifdef RN_USE_BARY_CENTRIC_COORD\n#else\n let baryCentricCoord = vec4<f32>(0.0, 0.0, 0.0, 0.0);\n#endif\n\n let instanceId = u32(instanceIds.x);\n let worldMatrix = get_worldMatrix(instanceId);\n let previousWorldMatrix = get_previousWorldMatrix(instanceId);\n var normalMatrix = get_normalMatrix(instanceId);\n let isBillboard = get_isBillboard(instanceId);\n let viewMatrix = get_viewMatrix(cameraSID);\n let skeletalComponentSID = i32(instanceIds.y);\n let blendShapeComponentSID = u32(instanceIds.z);\n\n var position_inWorld = vec4<f32>(0.0, 0.0, 0.0, 1.0);\n var normal_inWorld = vec3<f32>(0.0, 0.0, 0.0);\n let isSkinning = processGeometry(\n worldMatrix,\n normalMatrix,\n viewMatrix,\n position,\n normal,\n joint,\n weight,\n isBillboard,\n &normalMatrix,\n &position_inWorld,\n &normal_inWorld\n );\n\n let projectionMatrix = get_projectionMatrix(cameraSID);\n\n // The same (jittered) position as the color pass, so that the motion vectors cover the same pixels.\n let position_inClip = projectionMatrix * viewMatrix * position_inWorld;\n output.position = position_inClip;\n\n // VertexOutput is shared by all shaders, so its position_inWorld and color_0 slots carry the clip space\n // positions of this frame (without the jitter) and of the previous frame to the fragment shader.\n // The jitter moves the NDC position by currentJitter, i.e. the clip position by currentJitter * w.\n let currentJitter = get_currentJitter(materialSID, 0);\n output.position_inWorld = position_inClip - vec4<f32>(currentJitter * position_inClip.w, 0.0, 0.0);\n\n // The previous world position: the vertex deformed by the blend shape weights and the bone data of the previous\n // frame, transformed by the world matrix of the previous frame. It is computed from the vertex attributes even\n // when the current position comes from the vertices deformed by the compute shader of the GPU culling.\n var previousPosition_inWorld: vec4<f32>;\n if (isBillboard) {\n // A billboard faces the camera of each frame: only the motion of its world matrix is considered.\n previousPosition_inWorld = previousWorldMatrix * (inverse4x4(worldMatrix) * position_inWorld);\n } else {\n var previousPosition_inLocal = position.xyz;\n#ifdef RN_IS_MORPHING\n if (uniformDrawParameters.morphTargetNumber != 0u) {\n previousPosition_inLocal = get_previousMorphedPosition(u32(a_baryCentricCoord.w), position.xyz, blendShapeComponentSID);\n }\n#endif\n var previousLocalToWorld = previousWorldMatrix;\n#ifdef RN_IS_SKINNING\n if (instanceIds.y != INVALID_ID) {\n previousLocalToWorld = previousWorldMatrix * getPreviousSkinMatrix(instanceIds.y, joint, weight);\n }\n#endif\n previousPosition_inWorld = previousLocalToWorld * vec4<f32>(previousPosition_inLocal, 1.0);\n }\n output.color_0 = get_previousViewProjectionMatrix(materialSID, 0) * previousPosition_inWorld;\n\n return output;\n}\n";
|
|
3
|
+
var shaderStage = "vertex";
|
|
4
|
+
var isFragmentShader = false;
|
|
5
|
+
var MotionVectorShader_vert_default = { code, shaderStage, isFragmentShader };
|
|
6
|
+
export {
|
|
7
|
+
code,
|
|
8
|
+
MotionVectorShader_vert_default as default,
|
|
9
|
+
isFragmentShader,
|
|
10
|
+
shaderStage
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2hhZGVyaXR5Oi9Vc2Vycy9lbWFkdXJhbmRhbC9naHEvZ2l0aHViLmNvbS9hY3Rud2l0L1Job2Rvbml0ZUVkaXRvcjIvc3VibW9kdWxlcy9SaG9kb25pdGVUUy9zcmMvd2ViZ3B1L3NoYWRlcml0eV9zaGFkZXJzL01vdGlvblZlY3RvclNoYWRlci9Nb3Rpb25WZWN0b3JTaGFkZXIudmVydC53Z3NsIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJ7XCJjb2RlXCI6XCJcXG4vKiBzaGFkZXJpdHk6IEB7ZGVmaW5pdGlvbnN9ICovXFxuLyogc2hhZGVyaXR5OiBAe3ZlcnRleE91dHB1dH0gKi9cXG4vKiBzaGFkZXJpdHk6IEB7cHJlcmVxdWlzaXRlc30gKi9cXG5cXG4vKiBzaGFkZXJpdHk6IEB7Z2V0dGVyc30gKi9cXG4vKiBzaGFkZXJpdHk6IEB7bWF0cmljZXNHZXR0ZXJzfSAqL1xcbi8qIHNoYWRlcml0eTogQHtwcm9jZXNzR2VvbWV0cnl9ICovXFxuXFxuI2lmZGVmIFJOX0lTX1NLSU5OSU5HXFxuLy8gVGhlIG1hdHJpeCBvZiBvbmUgam9pbnQgZGVjb2RlZCBmcm9tIHRoZSBib25l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TG9jYWxUb1dvcmxkID0gcHJldmlvdXNXb3JsZE1hdHJpeCAqIGdldFByZXZpb3VzU2tpbk1hdHJpeChpbnN0YW5jZUlkcy55LCBqb2ludCwgd2VpZ2h0KTtcXG4gICAgfVxcbiNlbmRpZlxcbiAgICBwcmV2aW91c1Bvc2l0aW9uX2luV29ybGQgPSBwcmV2aW91c0xvY2FsVG9Xb3JsZCAqIHZlYzQ8ZjMyPihwcmV2aW91c1Bvc2l0aW9uX2luTG9jYWwsIDEuMCk7XFxuICB9XFxuICBvdXRwdXQuY29sb3JfMCA9IGdldF9wcmV2aW91c1ZpZXdQcm9qZWN0aW9uTWF0cml4KG1hdGVyaWFsU0lELCAwKSAqIHByZXZpb3VzUG9zaXRpb25faW5Xb3JsZDtcXG5cXG4gIHJldHVybiBvdXRwdXQ7XFxufVxcblwiLFwic2hhZGVyU3RhZ2VcIjpcInZlcnRleFwiLFwiaXNGcmFnbWVudFNoYWRlclwiOmZhbHNlfSJdLAogICJtYXBwaW5ncyI6ICI7QUFBQyxXQUFPO0FBQW91SyxrQkFBYztBQUFTLHVCQUFtQjtBQUF0eEssd0NBQUMsTUFBMnVLLGFBQXVCLGlCQUF3QjsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// shaderity:/Users/emadurandal/ghq/github.com/actnwit/RhodoniteEditor2/submodules/RhodoniteTS/src/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl
|
|
2
|
+
var code = "/* shaderity: @{definitions} */\n/* shaderity: @{vertexOutput} */\n/* shaderity: @{prerequisites} */\n\n/* shaderity: @{getters} */\n\n// Temporal anti-aliasing resolve: blends the current (jittered) frame with the reprojected history.\n// baseColorTexture: the current frame, historyTexture: the previous result,\n// velocityTexture: xy = the motion from the previous frame in texture coordinates, z = the depth.\n// textureSampleLevel is used everywhere because some lookups are in non-uniform control flow.\n\nfn rgbToYCoCg(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(0.25 * c.r + 0.5 * c.g + 0.25 * c.b, 0.5 * c.r - 0.5 * c.b, -0.25 * c.r + 0.5 * c.g - 0.25 * c.b);\n}\n\nfn yCoCgToRgb(c: vec3<f32>) -> vec3<f32> {\n let t = c.x - c.z;\n return vec3<f32>(t + c.y, c.x + c.z, t - c.y);\n}\n\n// Bicubic Catmull-Rom filtering of the history with 5 bilinear taps (the 4 corner taps are dropped),\n// which keeps the history sharp when it is resampled every frame.\nfn sampleHistoryCatmullRom(uv: vec2<f32>, textureSize: vec2<f32>) -> vec3<f32> {\n let samplePosition = uv * textureSize;\n let texPosition1 = floor(samplePosition - 0.5) + 0.5;\n let f = samplePosition - texPosition1;\n let w0 = f * (-0.5 + f * (1.0 - 0.5 * f));\n let w1 = 1.0 + f * f * (-2.5 + 1.5 * f);\n let w2 = f * (0.5 + f * (2.0 - 1.5 * f));\n let w3 = f * f * (-0.5 + 0.5 * f);\n let w12 = w1 + w2;\n let offset12 = w2 / w12;\n let texPosition0 = (texPosition1 - 1.0) / textureSize;\n let texPosition3 = (texPosition1 + 2.0) / textureSize;\n let texPosition12 = (texPosition1 + offset12) / textureSize;\n\n var result = textureSampleLevel(historyTexture, historySampler, vec2<f32>(texPosition12.x, texPosition0.y), 0.0).rgb * (w12.x * w0.y);\n result += textureSampleLevel(historyTexture, historySampler, vec2<f32>(texPosition0.x, texPosition12.y), 0.0).rgb * (w0.x * w12.y);\n result += textureSampleLevel(historyTexture, historySampler, texPosition12, 0.0).rgb * (w12.x * w12.y);\n result += textureSampleLevel(historyTexture, historySampler, vec2<f32>(texPosition3.x, texPosition12.y), 0.0).rgb * (w3.x * w12.y);\n result += textureSampleLevel(historyTexture, historySampler, vec2<f32>(texPosition12.x, texPosition3.y), 0.0).rgb * (w12.x * w3.y);\n let weightSum = w12.x * w0.y + w0.x * w12.y + w12.x * w12.y + w3.x * w12.y + w12.x * w3.y;\n return max(result / weightSum, vec3<f32>(0.0));\n}\n\n// The color of the pixel at texelOffset for the clipping box, or fallback when that pixel moves: the box only\n// grows to cover the sub-pixel coverage changes of still surfaces, not the colors of moving objects, whose\n// stale history would otherwise survive behind them.\nfn stillNeighborForBox(uv: vec2<f32>, texelOffset: vec2<f32>, texelSize: vec2<f32>, framebufferSize: vec2<f32>, fallback: vec3<f32>) -> vec3<f32> {\n let sampleUv = uv + texelOffset * texelSize;\n let velocity = textureSampleLevel(velocityTexture, velocitySampler, sampleUv, 0.0).xy;\n let color = rgbToYCoCg(textureSampleLevel(baseColorTexture, baseColorSampler, sampleUv, 0.0).rgb);\n return select(color, fallback, length(velocity * framebufferSize) >= 0.5);\n}\n\n@fragment\nfn main(\n input: VertexOutput,\n) -> @location(0) vec4<f32> {\n/* shaderity: @{mainPrerequisites} */\n\n let uv = input.texcoord_0;\n let framebufferSize: vec2<f32> = get_framebufferSize(materialSID, 0);\n let texelSize = 1.0 / framebufferSize;\n\n let centerSample = textureSampleLevel(baseColorTexture, baseColorSampler, uv, 0.0);\n let currentAlpha = centerSample.a;\n\n // The position where this frame sampled the scene, relative to the center of each pixel, in texels. The jitter\n // moves the geometry by currentJitter (NDC, y up), i.e. the sample position by -currentJitter, and the v axis of\n // the texture coordinates points down.\n let currentJitter = get_currentJitter(materialSID, 0);\n let sampleOffset = vec2<f32>(-currentJitter.x, currentJitter.y) * framebufferSize * 0.5;\n\n // Statistics of the 3x3 neighborhood (for the variance clipping), the closest surface in it (whose motion vector\n // is used, so that the edges of moving objects reproject with them) and the reconstruction of the current frame.\n var moment1 = vec3<f32>(0.0);\n var moment2 = vec3<f32>(0.0);\n var filtered = vec3<f32>(0.0);\n var filterWeightSum = 0.0;\n var closestDepth = 2.0;\n var closestOffset = vec2<f32>(0.0);\n for (var y = -1; y <= 1; y++) {\n for (var x = -1; x <= 1; x++) {\n let texelOffset = vec2<f32>(f32(x), f32(y));\n let offset = texelOffset * texelSize;\n let neighbor = rgbToYCoCg(textureSampleLevel(baseColorTexture, baseColorSampler, uv + offset, 0.0).rgb);\n moment1 += neighbor;\n moment2 += neighbor * neighbor;\n // Reconstruction filter: weights each sample by its distance from the center of this pixel, with the\n // Gaussian fit of a Blackman-Harris window (Karis 2014). Without it, the sample of every frame counts the\n // same wherever the jitter put it, and edge pixels flicker with the period of the jitter sequence.\n let sampleDistance = texelOffset + sampleOffset;\n let filterWeight = exp(-2.29 * dot(sampleDistance, sampleDistance));\n filtered += neighbor * filterWeight;\n filterWeightSum += filterWeight;\n let depth = textureSampleLevel(velocityTexture, velocitySampler, uv + offset, 0.0).z;\n if (depth < closestDepth) {\n closestDepth = depth;\n closestOffset = offset;\n }\n }\n }\n let currentYCoCg = filtered / filterWeightSum;\n\n let velocity = textureSampleLevel(velocityTexture, velocitySampler, uv + closestOffset, 0.0).xy;\n let historyUv = uv - velocity;\n let isHistoryValid = get_isHistoryValid(materialSID, 0);\n if (!isHistoryValid || historyUv.x < 0.0 || historyUv.x > 1.0 || historyUv.y < 0.0 || historyUv.y > 1.0) {\n return vec4<f32>(max(yCoCgToRgb(currentYCoCg), vec3<f32>(0.0)), currentAlpha);\n }\n\n var history = rgbToYCoCg(sampleHistoryCatmullRom(historyUv, framebufferSize));\n\n // Variance clipping (Salvi 2016): clip the history into a box around the neighborhood.\n // - The box also contains the colors 2 pixels away in the 4 axis directions, where those pixels do not move. The\n // reconstruction filter spreads a surface into the pixels next to it, so a pixel beside a high contrast edge\n // accumulates some of the surface; in the frames where the jitter puts the samples of its 3x3 neighborhood all\n // on the other side, the variance box collapses (sigma = 0) and would clip that history away every few\n // frames, which flickers.\n // - The box always contains the sample of this pixel and the reconstructed current color, and the history is\n // clipped along the line towards the reconstructed current color. The result then always lies between the\n // history and the current color. Clipping towards the center of the box instead moved the luminance towards\n // the center: a gray pixel, whose chroma extents are almost 0, was clipped by a chroma difference of 1e-4 and\n // its luminance pulled up to the middle of an asymmetric box, once per jitter sequence.\n // - The chroma of grays is almost 0, so the distance to the box is measured with a tolerance proportional to the\n // luminance, so that rounding differences in the chroma do not clip the history.\n let mean = moment1 / 9.0;\n let sigma = sqrt(max(moment2 / 9.0 - mean * mean, vec3<f32>(0.0)));\n let varianceClipGamma = get_varianceClipGamma(materialSID, 0);\n let farLeft = stillNeighborForBox(uv, vec2<f32>(-2.0, 0.0), texelSize, framebufferSize, currentYCoCg);\n let farRight = stillNeighborForBox(uv, vec2<f32>(2.0, 0.0), texelSize, framebufferSize, currentYCoCg);\n let farUp = stillNeighborForBox(uv, vec2<f32>(0.0, -2.0), texelSize, framebufferSize, currentYCoCg);\n let farDown = stillNeighborForBox(uv, vec2<f32>(0.0, 2.0), texelSize, framebufferSize, currentYCoCg);\n let centerYCoCg = rgbToYCoCg(centerSample.rgb);\n let localMin = min(min(centerYCoCg, currentYCoCg), min(min(farLeft, farRight), min(farUp, farDown)));\n let localMax = max(max(centerYCoCg, currentYCoCg), max(max(farLeft, farRight), max(farUp, farDown)));\n let boxMin = min(mean - sigma * varianceClipGamma, localMin);\n let boxMax = max(mean + sigma * varianceClipGamma, localMax);\n let toHistory = history - currentYCoCg;\n let roomToBox = select(currentYCoCg - boxMin, boxMax - currentYCoCg, toHistory > vec3<f32>(0.0));\n let tolerance = 1.0e-4 + 0.01 * (abs(currentYCoCg.x) + abs(history.x));\n let ratio = abs(toHistory) / max(roomToBox, vec3<f32>(tolerance));\n let maxRatio = max(ratio.x, max(ratio.y, ratio.z));\n if (maxRatio > 1.0) {\n history = currentYCoCg + toHistory / maxRatio;\n }\n\n // The weight of the current frame. Pixels that do not move use the smaller static weight: the exponential blend\n // weights the recent frames of the jitter sequence more, and a smaller weight averages the sequence more evenly.\n // Pixels that move by a pixel per frame or more keep the larger weight, so that the history, resampled every\n // frame, does not blur. Right after a reset, the weight starts at 1 / (n + 1), the even average of the frames.\n let movingFrameWeight = get_currentFrameWeight(materialSID, 0);\n let staticFrameWeight = min(get_staticFrameWeight(materialSID, 0), movingFrameWeight);\n let speedInPixels = length(velocity * framebufferSize);\n let historyFrameCount = get_historyFrameCount(materialSID, 0);\n let blendFactor = max(\n mix(staticFrameWeight, movingFrameWeight, saturate(speedInPixels)),\n 1.0 / (historyFrameCount + 1.0)\n );\n\n // Exponential blend weighted by the inverse luminance (Karis 2014) to suppress flickering highlights.\n let currentWeight = blendFactor / (1.0 + currentYCoCg.x);\n let historyWeight = (1.0 - blendFactor) / (1.0 + history.x);\n let result = (currentYCoCg * currentWeight + history * historyWeight) / (currentWeight + historyWeight);\n\n return vec4<f32>(max(yCoCgToRgb(result), vec3<f32>(0.0)), currentAlpha);\n}\n";
|
|
3
|
+
var shaderStage = "fragment";
|
|
4
|
+
var isFragmentShader = true;
|
|
5
|
+
var TemporalAAResolveShader_frag_default = { code, shaderStage, isFragmentShader };
|
|
6
|
+
export {
|
|
7
|
+
code,
|
|
8
|
+
TemporalAAResolveShader_frag_default as default,
|
|
9
|
+
isFragmentShader,
|
|
10
|
+
shaderStage
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2hhZGVyaXR5Oi9Vc2Vycy9lbWFkdXJhbmRhbC9naHEvZ2l0aHViLmNvbS9hY3Rud2l0L1Job2Rvbml0ZUVkaXRvcjIvc3VibW9kdWxlcy9SaG9kb25pdGVUUy9zcmMvd2ViZ3B1L3NoYWRlcml0eV9zaGFkZXJzL1RlbXBvcmFsQUFSZXNvbHZlU2hhZGVyL1RlbXBvcmFsQUFSZXNvbHZlU2hhZGVyLmZyYWcud2dzbCJdLAogICJzb3VyY2VzQ29udGVudCI6IFsie1wiY29kZVwiOlwiLyogc2hhZGVyaXR5OiBAe2RlZmluaXRpb25zfSAqL1xcbi8qIHNoYWRlcml0eTogQHt2ZXJ0ZXhPdXRwdXR9ICovXFxuLyogc2hhZGVyaXR5OiBAe3ByZXJlcXVpc2l0ZXN9ICovXFxuXFxuLyogc2hhZGVyaXR5OiBAe2dldHRlcnN9ICovXFxuXFxuLy8gVGVtcG9yYWwgYW50aS1hbGlhc2luZyByZXNvbHZlOi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W1lV2VpZ2h0LCBtb3ZpbmdGcmFtZVdlaWdodCwgc2F0dXJhdGUoc3BlZWRJblBpeGVscykpLFxcbiAgICAxLjAgLyAoaGlzdG9yeUZyYW1lQ291bnQgKyAxLjApXFxuICApO1xcblxcbiAgLy8gRXhwb25lbnRpYWwgYmxlbmQgd2VpZ2h0ZWQgYnkgdGhlIGludmVyc2UgbHVtaW5hbmNlIChLYXJpcyAyMDE0KSB0byBzdXBwcmVzcyBmbGlja2VyaW5nIGhpZ2hsaWdodHMuXFxuICBsZXQgY3VycmVudFdlaWdodCA9IGJsZW5kRmFjdG9yIC8gKDEuMCArIGN1cnJlbnRZQ29DZy54KTtcXG4gIGxldCBoaXN0b3J5V2VpZ2h0ID0gKDEuMCAtIGJsZW5kRmFjdG9yKSAvICgxLjAgKyBoaXN0b3J5LngpO1xcbiAgbGV0IHJlc3VsdCA9IChjdXJyZW50WUNvQ2cgKiBjdXJyZW50V2VpZ2h0ICsgaGlzdG9yeSAqIGhpc3RvcnlXZWlnaHQpIC8gKGN1cnJlbnRXZWlnaHQgKyBoaXN0b3J5V2VpZ2h0KTtcXG5cXG4gIHJldHVybiB2ZWM0PGYzMj4obWF4KHlDb0NnVG9SZ2IocmVzdWx0KSwgdmVjMzxmMzI+KDAuMCkpLCBjdXJyZW50QWxwaGEpO1xcbn1cXG5cIixcInNoYWRlclN0YWdlXCI6XCJmcmFnbWVudFwiLFwiaXNGcmFnbWVudFNoYWRlclwiOnRydWV9Il0sCiAgIm1hcHBpbmdzIjogIjtBQUFDLFdBQU87QUFBcTJULGtCQUFjO0FBQVcsdUJBQW1CO0FBQXo1VCw2Q0FBQyxNQUE0MlQsYUFBeUIsaUJBQXVCOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// shaderity:/Users/emadurandal/ghq/github.com/actnwit/RhodoniteEditor2/submodules/RhodoniteTS/src/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl
|
|
2
|
+
var code = "/* shaderity: @{definitions} */\n/* shaderity: @{vertexOutput} */\n/* shaderity: @{prerequisites} */\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n\n@vertex\nfn main(\n @builtin(vertex_index) vertexIdx : u32,\n) -> VertexOutput {\n var output : VertexOutput;\n\n/* shaderity: @{fullscreen} */\n\n return output;\n\n}\n";
|
|
3
|
+
var shaderStage = "vertex";
|
|
4
|
+
var isFragmentShader = false;
|
|
5
|
+
var TemporalAAResolveShader_vert_default = { code, shaderStage, isFragmentShader };
|
|
6
|
+
export {
|
|
7
|
+
code,
|
|
8
|
+
TemporalAAResolveShader_vert_default as default,
|
|
9
|
+
isFragmentShader,
|
|
10
|
+
shaderStage
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2hhZGVyaXR5Oi9Vc2Vycy9lbWFkdXJhbmRhbC9naHEvZ2l0aHViLmNvbS9hY3Rud2l0L1Job2Rvbml0ZUVkaXRvcjIvc3VibW9kdWxlcy9SaG9kb25pdGVUUy9zcmMvd2ViZ3B1L3NoYWRlcml0eV9zaGFkZXJzL1RlbXBvcmFsQUFSZXNvbHZlU2hhZGVyL1RlbXBvcmFsQUFSZXNvbHZlU2hhZGVyLnZlcnQud2dzbCJdLAogICJzb3VyY2VzQ29udGVudCI6IFsie1wiY29kZVwiOlwiLyogc2hhZGVyaXR5OiBAe2RlZmluaXRpb25zfSAqL1xcbi8qIHNoYWRlcml0eTogQHt2ZXJ0ZXhPdXRwdXR9ICovXFxuLyogc2hhZGVyaXR5OiBAe3ByZXJlcXVpc2l0ZXN9ICovXFxuXFxuLyogc2hhZGVyaXR5OiBAe2dldHRlcnN9ICovXFxuLyogc2hhZGVyaXR5OiBAe21hdHJpY2VzR2V0dGVyc30gKi9cXG5cXG5AdmVydGV4XFxuZm4gbWFpbihcXG4gIEBidWlsdGluKHZlcnRleF9pb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