rhodonite 0.27.0 → 0.28.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.
Files changed (1197) hide show
  1. package/README.md +10 -10
  2. package/VERSION-FILE +1 -1
  3. package/dist/esm/effekseer/EffekseerComponent.js +3 -3
  4. package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
  5. package/dist/esm/foundation/components/Light/LightComponent.d.ts +14 -0
  6. package/dist/esm/foundation/components/Light/LightComponent.js +1 -1
  7. package/dist/esm/foundation/components/Mesh/MeshComponent.js +1 -1
  8. package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +33 -5
  9. package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
  10. package/dist/esm/foundation/components/Physics/PhysicsComponent.js +1 -1
  11. package/dist/esm/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +1 -1
  12. package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.js +1 -1
  13. package/dist/esm/foundation/components/Shape/ShapeComponent.js +1 -1
  14. package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +1 -1
  15. package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
  16. package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
  17. package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
  18. package/dist/esm/foundation/core/Component.js +1 -1
  19. package/dist/esm/foundation/core/Config.d.ts +15 -0
  20. package/dist/esm/foundation/core/Config.js +1 -1
  21. package/dist/esm/foundation/core/GlobalDataRepository.d.ts +3 -3
  22. package/dist/esm/foundation/core/GlobalDataRepository.js +1 -1
  23. package/dist/esm/foundation/definitions/RenderBackend.d.ts +21 -0
  24. package/dist/esm/foundation/definitions/RenderBackend.js +1 -0
  25. package/dist/esm/foundation/definitions/ShaderSemantics.js +1 -1
  26. package/dist/esm/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
  27. package/dist/esm/foundation/definitions/ShaderSemanticsInfo.js +1 -1
  28. package/dist/esm/foundation/definitions/VertexAttribute.js +1 -1
  29. package/dist/esm/foundation/definitions/index.d.ts +1 -1
  30. package/dist/esm/foundation/definitions/index.js +1 -1
  31. package/dist/esm/foundation/exporter/Gltf2Exporter.d.ts +6 -0
  32. package/dist/esm/foundation/exporter/Gltf2Exporter.js +1 -1
  33. package/dist/esm/foundation/geometry/Frustum.js +1 -1
  34. package/dist/esm/foundation/geometry/Mesh.d.ts +33 -68
  35. package/dist/esm/foundation/geometry/Mesh.js +1 -1
  36. package/dist/esm/foundation/geometry/Primitive.d.ts +1 -1
  37. package/dist/esm/foundation/geometry/Primitive.js +1 -1
  38. package/dist/esm/foundation/geometry/shapes/Cylinder.js +1 -1
  39. package/dist/esm/foundation/geometry/shapes/Joint.js +1 -1
  40. package/dist/esm/foundation/gizmos/AABBGizmo.js +1 -1
  41. package/dist/esm/foundation/gizmos/CapsuleColliderGizmo.js +1 -1
  42. package/dist/esm/foundation/gizmos/Gizmo.js +1 -1
  43. package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
  44. package/dist/esm/foundation/gizmos/LightGizmo.d.ts +108 -10
  45. package/dist/esm/foundation/gizmos/LightGizmo.js +1 -1
  46. package/dist/esm/foundation/gizmos/LocatorGizmo.js +1 -1
  47. package/dist/esm/foundation/gizmos/RotationGizmo.js +1 -1
  48. package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
  49. package/dist/esm/foundation/gizmos/ShapeGizmo.js +1 -1
  50. package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
  51. package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
  52. package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
  53. package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
  54. package/dist/esm/foundation/helpers/MaterialHelper.d.ts +2 -0
  55. package/dist/esm/foundation/helpers/MaterialHelper.js +1 -1
  56. package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
  57. package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
  58. package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.js +1 -0
  59. package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
  60. package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +1 -0
  61. package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
  62. package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
  63. package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.js +1 -0
  64. package/dist/esm/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
  65. package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
  66. package/dist/esm/foundation/helpers/materials/createClassicUberMaterial.js +1 -1
  67. package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
  68. package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +1 -0
  69. package/dist/esm/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +1 -1
  70. package/dist/esm/foundation/helpers/materials/createGaussianBlurMaterial.js +1 -1
  71. package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -1
  72. package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
  73. package/dist/esm/foundation/helpers/materials/createPbrUberMaterial.js +1 -1
  74. package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -1
  75. package/dist/esm/foundation/helpers/materials/index.d.ts +1 -0
  76. package/dist/esm/foundation/helpers/materials/index.js +1 -1
  77. package/dist/esm/foundation/helpers/materials/nodeBasedMaterialCommon.js +1 -1
  78. package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
  79. package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
  80. package/dist/esm/foundation/importer/GltfImporter.js +1 -1
  81. package/dist/esm/foundation/importer/ModelConverter.d.ts +19 -0
  82. package/dist/esm/foundation/importer/ModelConverter.js +1 -1
  83. package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
  84. package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
  85. package/dist/esm/foundation/importer/VrmImporter.js +1 -1
  86. package/dist/esm/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
  87. package/dist/esm/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -1
  88. package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
  89. package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
  90. package/dist/esm/foundation/materials/contents/DepthEncodeMaterialContent.js +1 -1
  91. package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
  92. package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +1 -1
  93. package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
  94. package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.js +1 -1
  95. package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
  96. package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.js +1 -1
  97. package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +18 -18
  98. package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
  99. package/dist/esm/foundation/materials/contents/MatCapMaterialContent.d.ts +0 -16
  100. package/dist/esm/foundation/materials/contents/MatCapMaterialContent.js +1 -1
  101. package/dist/esm/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +1 -1
  102. package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
  103. package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.js +1 -1
  104. package/dist/esm/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +1 -1
  105. package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
  106. package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
  107. package/dist/esm/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
  108. package/dist/esm/foundation/materials/core/AbstractShaderNode.js +2 -2
  109. package/dist/esm/foundation/materials/core/Material.d.ts +7 -114
  110. package/dist/esm/foundation/materials/core/Material.js +1 -1
  111. package/dist/esm/foundation/materials/core/MaterialRepository.js +1 -1
  112. package/dist/esm/foundation/materials/core/ShaderGraphResolver.js +6 -6
  113. package/dist/esm/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
  114. package/dist/esm/foundation/materials/core/ShaderNodeFactories.js +1 -0
  115. package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
  116. package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.js +23 -0
  117. package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
  118. package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
  119. package/dist/esm/foundation/materials/nodes/AbsShaderNode.js +1 -1
  120. package/dist/esm/foundation/materials/nodes/AcosShaderNode.js +1 -1
  121. package/dist/esm/foundation/materials/nodes/AddShaderNode.js +1 -1
  122. package/dist/esm/foundation/materials/nodes/AlphaTestShaderNode.js +1 -1
  123. package/dist/esm/foundation/materials/nodes/AndShaderNode.js +1 -1
  124. package/dist/esm/foundation/materials/nodes/Atan2ShaderNode.js +1 -1
  125. package/dist/esm/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
  126. package/dist/esm/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
  127. package/dist/esm/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
  128. package/dist/esm/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
  129. package/dist/esm/foundation/materials/nodes/AttributePositionShaderNode.js +1 -1
  130. package/dist/esm/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
  131. package/dist/esm/foundation/materials/nodes/AttributeTexcoordShaderNode.js +1 -1
  132. package/dist/esm/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
  133. package/dist/esm/foundation/materials/nodes/BlockBeginShaderNode.js +1 -1
  134. package/dist/esm/foundation/materials/nodes/BlockEndShaderNode.js +1 -1
  135. package/dist/esm/foundation/materials/nodes/BranchShaderNode.js +1 -1
  136. package/dist/esm/foundation/materials/nodes/CalcBitangentShaderNode.js +1 -1
  137. package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
  138. package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
  139. package/dist/esm/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
  140. package/dist/esm/foundation/materials/nodes/ClampShaderNode.js +1 -1
  141. package/dist/esm/foundation/materials/nodes/ClassicShaderNode.js +1 -1
  142. package/dist/esm/foundation/materials/nodes/ConstantVariableShaderNode.js +1 -1
  143. package/dist/esm/foundation/materials/nodes/CosShaderNode.d.ts +1 -1
  144. package/dist/esm/foundation/materials/nodes/CosShaderNode.js +1 -1
  145. package/dist/esm/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
  146. package/dist/esm/foundation/materials/nodes/DotProductShaderNode.js +1 -1
  147. package/dist/esm/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
  148. package/dist/esm/foundation/materials/nodes/EqualShaderNode.js +1 -1
  149. package/dist/esm/foundation/materials/nodes/FlatShaderNode.js +1 -1
  150. package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
  151. package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.js +1 -1
  152. package/dist/esm/foundation/materials/nodes/GreaterShaderNode.js +1 -1
  153. package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
  154. package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.js +1 -1
  155. package/dist/esm/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
  156. package/dist/esm/foundation/materials/nodes/LengthShaderNode.js +1 -1
  157. package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
  158. package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.js +1 -1
  159. package/dist/esm/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
  160. package/dist/esm/foundation/materials/nodes/LessThanShaderNode.js +1 -1
  161. package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
  162. package/dist/esm/foundation/materials/nodes/MinShaderNode.js +1 -1
  163. package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
  164. package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.js +1 -1
  165. package/dist/esm/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
  166. package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
  167. package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.js +1 -1
  168. package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
  169. package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.js +1 -1
  170. package/dist/esm/foundation/materials/nodes/OrShaderNode.js +1 -1
  171. package/dist/esm/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +1 -1
  172. package/dist/esm/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +1 -1
  173. package/dist/esm/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +1 -1
  174. package/dist/esm/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +1 -1
  175. package/dist/esm/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +1 -1
  176. package/dist/esm/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +1 -1
  177. package/dist/esm/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +1 -1
  178. package/dist/esm/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +1 -1
  179. package/dist/esm/foundation/materials/nodes/PbrNormalPropsShaderNode.js +1 -1
  180. package/dist/esm/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +1 -1
  181. package/dist/esm/foundation/materials/nodes/PbrShaderShaderNode.js +1 -1
  182. package/dist/esm/foundation/materials/nodes/PbrSheenPropsShaderNode.js +1 -1
  183. package/dist/esm/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +1 -1
  184. package/dist/esm/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +1 -1
  185. package/dist/esm/foundation/materials/nodes/PbrVolumePropsShaderNode.js +1 -1
  186. package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.d.ts +1 -1
  187. package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +1 -1
  188. package/dist/esm/foundation/materials/nodes/ProcessGeometryShaderNode.js +1 -1
  189. package/dist/esm/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
  190. package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +2 -2
  191. package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +2 -2
  192. package/dist/esm/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
  193. package/dist/esm/foundation/materials/nodes/RemapShaderNode.js +1 -1
  194. package/dist/esm/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
  195. package/dist/esm/foundation/materials/nodes/SinShaderNode.js +1 -1
  196. package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
  197. package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.js +1 -1
  198. package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
  199. package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
  200. package/dist/esm/foundation/materials/nodes/StepShaderNode.js +1 -1
  201. package/dist/esm/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
  202. package/dist/esm/foundation/materials/nodes/TanShaderNode.js +1 -1
  203. package/dist/esm/foundation/materials/nodes/Texture2DShaderNode.js +1 -1
  204. package/dist/esm/foundation/materials/nodes/TimeShaderNode.js +1 -1
  205. package/dist/esm/foundation/materials/nodes/TransformShaderNode.d.ts +1 -1
  206. package/dist/esm/foundation/materials/nodes/TransformShaderNode.js +1 -1
  207. package/dist/esm/foundation/materials/nodes/UniformDataShaderNode.js +1 -1
  208. package/dist/esm/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
  209. package/dist/esm/foundation/materials/nodes/WireframeMaterialNode.js +1 -1
  210. package/dist/esm/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
  211. package/dist/esm/foundation/materials/nodes/raymarching/BendXYShaderNode.js +1 -1
  212. package/dist/esm/foundation/materials/nodes/raymarching/BendXZShaderNode.js +1 -1
  213. package/dist/esm/foundation/materials/nodes/raymarching/BendYXShaderNode.js +1 -1
  214. package/dist/esm/foundation/materials/nodes/raymarching/BendYZShaderNode.js +1 -1
  215. package/dist/esm/foundation/materials/nodes/raymarching/BendZXShaderNode.js +1 -1
  216. package/dist/esm/foundation/materials/nodes/raymarching/BendZYShaderNode.js +1 -1
  217. package/dist/esm/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
  218. package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +1 -1
  219. package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +1 -1
  220. package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +1 -1
  221. package/dist/esm/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +1 -1
  222. package/dist/esm/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +1 -1
  223. package/dist/esm/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +1 -1
  224. package/dist/esm/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +1 -1
  225. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +1 -1
  226. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +1 -1
  227. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +1 -1
  228. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +1 -1
  229. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +1 -1
  230. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +1 -1
  231. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +1 -1
  232. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +1 -1
  233. package/dist/esm/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +1 -1
  234. package/dist/esm/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +1 -1
  235. package/dist/esm/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +1 -1
  236. package/dist/esm/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +1 -1
  237. package/dist/esm/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +1 -1
  238. package/dist/esm/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +1 -1
  239. package/dist/esm/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +1 -1
  240. package/dist/esm/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +1 -1
  241. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +1 -1
  242. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +1 -1
  243. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +1 -1
  244. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +1 -1
  245. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +1 -1
  246. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +1 -1
  247. package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +1 -1
  248. package/dist/esm/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +1 -1
  249. package/dist/esm/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +1 -1
  250. package/dist/esm/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +1 -1
  251. package/dist/esm/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +1 -1
  252. package/dist/esm/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +1 -1
  253. package/dist/esm/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +1 -1
  254. package/dist/esm/foundation/materials/nodes/raymarching/TwistXShaderNode.js +1 -1
  255. package/dist/esm/foundation/materials/nodes/raymarching/TwistYShaderNode.js +1 -1
  256. package/dist/esm/foundation/materials/nodes/raymarching/TwistZShaderNode.js +1 -1
  257. package/dist/esm/foundation/math/IdentityMatrix33.js +2 -2
  258. package/dist/esm/foundation/math/IdentityMatrix44.js +2 -2
  259. package/dist/esm/foundation/math/MathClassUtil.js +1 -1
  260. package/dist/esm/foundation/math/MathUtil.d.ts +11 -0
  261. package/dist/esm/foundation/math/MathUtil.js +1 -1
  262. package/dist/esm/foundation/math/Quaternion.js +1 -1
  263. package/dist/esm/foundation/math/Transform3D.js +1 -1
  264. package/dist/esm/foundation/memory/Accessor.js +6 -6
  265. package/dist/esm/foundation/memory/Buffer.js +3 -3
  266. package/dist/esm/foundation/memory/BufferView.js +1 -1
  267. package/dist/esm/foundation/misc/Logger.js +1 -1
  268. package/dist/esm/foundation/misc/Time.js +1 -1
  269. package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +1 -1
  270. package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.js +1 -1
  271. package/dist/esm/foundation/physics/VRMSpring/CapsuleCollider.js +1 -1
  272. package/dist/esm/foundation/physics/VRMSpring/SphereCollider.js +1 -1
  273. package/dist/esm/foundation/physics/VRMSpring/VRMSpringBone.js +1 -1
  274. package/dist/esm/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
  275. package/dist/esm/foundation/renderer/CGAPIResourceRepository.js +1 -1
  276. package/dist/esm/foundation/renderer/Frame.js +1 -1
  277. package/dist/esm/foundation/renderer/FrameBuffer.js +1 -1
  278. package/dist/esm/foundation/renderer/FrameRenderer.d.ts +42 -0
  279. package/dist/esm/foundation/renderer/FrameRenderer.js +0 -0
  280. package/dist/esm/foundation/renderer/RenderPass.js +1 -1
  281. package/dist/esm/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
  282. package/dist/esm/foundation/renderer/ShaderPropertyLayout.js +1 -0
  283. package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -1
  284. package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
  285. package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -1
  286. package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
  287. package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.js +1 -1
  288. package/dist/esm/foundation/renderer/lightCluster/LightClusterSystemStub.js +1 -1
  289. package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
  290. package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +82 -176
  291. package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
  292. package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
  293. package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.js +1 -0
  294. package/dist/esm/foundation/system/Engine.d.ts +19 -44
  295. package/dist/esm/foundation/system/Engine.js +1 -1
  296. package/dist/esm/foundation/system/EngineState.d.ts +9 -3
  297. package/dist/esm/foundation/system/EngineState.js +1 -1
  298. package/dist/esm/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
  299. package/dist/esm/foundation/system/GpuDriverWorkarounds.js +1 -0
  300. package/dist/esm/foundation/system/ModuleManager.js +1 -1
  301. package/dist/esm/foundation/system/index.d.ts +1 -0
  302. package/dist/esm/foundation/system/index.js +1 -1
  303. package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
  304. package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.js +1 -0
  305. package/dist/esm/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
  306. package/dist/esm/foundation/textures/AbstractRenderTargetTexture.js +1 -0
  307. package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
  308. package/dist/esm/foundation/textures/CubeTexture.js +1 -1
  309. package/dist/esm/foundation/textures/RenderBuffer.js +1 -1
  310. package/dist/esm/foundation/textures/RenderTargetTexture.d.ts +5 -67
  311. package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
  312. package/dist/esm/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
  313. package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
  314. package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
  315. package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
  316. package/dist/esm/foundation/textures/Texture.d.ts +19 -1
  317. package/dist/esm/foundation/textures/Texture.js +1 -1
  318. package/dist/esm/foundation/textures/TextureArray.js +1 -1
  319. package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
  320. package/dist/esm/foundation/textures/VideoTexture.d.ts +11 -0
  321. package/dist/esm/foundation/textures/VideoTexture.js +1 -1
  322. package/dist/esm/foundation/textures/decodeBasisImage.d.ts +14 -0
  323. package/dist/esm/foundation/textures/decodeBasisImage.js +1 -0
  324. package/dist/esm/foundation/textures/index.d.ts +2 -0
  325. package/dist/esm/foundation/textures/index.js +1 -1
  326. package/dist/esm/types/glTF2.d.ts +9 -0
  327. package/dist/esm/version.js +1 -1
  328. package/dist/esm/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
  329. package/dist/esm/webgl/ComponentDataAccessorGLSL.js +27 -0
  330. package/dist/esm/webgl/InstanceSidTable.js +1 -1
  331. package/dist/esm/webgl/MultiDraw.d.ts +1 -1
  332. package/dist/esm/webgl/MultiDraw.js +1 -1
  333. package/dist/esm/webgl/MultiDrawRepository.js +1 -1
  334. package/dist/esm/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
  335. package/dist/esm/webgl/ShaderPropertyAccessorGLSL.js +29 -0
  336. package/dist/esm/webgl/WebGLCompressedTextures.d.ts +48 -0
  337. package/dist/esm/webgl/WebGLCompressedTextures.js +1 -0
  338. package/dist/esm/webgl/WebGLContextWrapper.d.ts +9 -52
  339. package/dist/esm/webgl/WebGLContextWrapper.js +1 -1
  340. package/dist/esm/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
  341. package/dist/esm/webgl/WebGLCubeTextureFileLoader.js +1 -0
  342. package/dist/esm/webgl/WebGLCubeTextures.d.ts +92 -0
  343. package/dist/esm/webgl/WebGLCubeTextures.js +42 -0
  344. package/dist/esm/webgl/WebGLDataTexture.d.ts +108 -0
  345. package/dist/esm/webgl/WebGLDataTexture.js +1 -0
  346. package/dist/esm/webgl/WebGLDrawState.d.ts +84 -0
  347. package/dist/esm/webgl/WebGLDrawState.js +1 -0
  348. package/dist/esm/webgl/WebGLExternalState.d.ts +43 -0
  349. package/dist/esm/webgl/WebGLExternalState.js +1 -0
  350. package/dist/esm/webgl/WebGLFrameRenderer.d.ts +32 -0
  351. package/dist/esm/webgl/WebGLFrameRenderer.js +1 -0
  352. package/dist/esm/webgl/WebGLFramebuffers.d.ts +142 -0
  353. package/dist/esm/webgl/WebGLFramebuffers.js +1 -0
  354. package/dist/esm/webgl/WebGLGpuTimer.js +1 -1
  355. package/dist/esm/webgl/WebGLMaterialParameters.d.ts +47 -0
  356. package/dist/esm/webgl/WebGLMaterialParameters.js +1 -0
  357. package/dist/esm/webgl/WebGLMeshResources.d.ts +115 -0
  358. package/dist/esm/webgl/WebGLMeshResources.js +1 -0
  359. package/dist/esm/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
  360. package/dist/esm/webgl/WebGLMorphUniformBuffers.js +57 -0
  361. package/dist/esm/webgl/WebGLResourceRepository.d.ts +100 -178
  362. package/dist/esm/webgl/WebGLResourceRepository.js +1 -55
  363. package/dist/esm/webgl/WebGLSamplers.d.ts +78 -0
  364. package/dist/esm/webgl/WebGLSamplers.js +1 -0
  365. package/dist/esm/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
  366. package/dist/esm/webgl/WebGLShaderProgramBuilder.js +15 -0
  367. package/dist/esm/webgl/WebGLShaderPrograms.d.ts +88 -0
  368. package/dist/esm/webgl/WebGLShaderPrograms.js +14 -0
  369. package/dist/esm/webgl/WebGLStereoUtil.d.ts +0 -27
  370. package/dist/esm/webgl/WebGLStereoUtil.js +3 -3
  371. package/dist/esm/webgl/WebGLStrategyDataUploader.d.ts +152 -0
  372. package/dist/esm/webgl/WebGLStrategyDataUploader.js +1 -0
  373. package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
  374. package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.js +1 -0
  375. package/dist/esm/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
  376. package/dist/esm/webgl/WebGLStrategyMeshDrawer.js +1 -0
  377. package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +7 -360
  378. package/dist/esm/webgl/WebGLStrategyWebGL2.js +1 -146
  379. package/dist/esm/webgl/WebGLTextureUnitState.d.ts +79 -0
  380. package/dist/esm/webgl/WebGLTextureUnitState.js +1 -0
  381. package/dist/esm/webgl/WebGLTextureUploads.d.ts +106 -0
  382. package/dist/esm/webgl/WebGLTextureUploads.js +1 -0
  383. package/dist/esm/webgl/WebGLTextures.d.ts +316 -0
  384. package/dist/esm/webgl/WebGLTextures.js +1 -0
  385. package/dist/esm/webgl/WebGLUniformBuffers.d.ts +35 -0
  386. package/dist/esm/webgl/WebGLUniformBuffers.js +1 -0
  387. package/dist/esm/webgl/WebGLUniforms.d.ts +117 -0
  388. package/dist/esm/webgl/WebGLUniforms.js +1 -0
  389. package/dist/esm/webgl/WebGLVertexBuffers.d.ts +172 -0
  390. package/dist/esm/webgl/WebGLVertexBuffers.js +1 -0
  391. package/dist/esm/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
  392. package/dist/esm/webgl/debug/BufferLayoutDecoder.js +1 -1
  393. package/dist/esm/webgl/debug/ShaderParameterDebugger.js +1 -1
  394. package/dist/esm/webgl/debug/types.d.ts +2 -2
  395. package/dist/esm/webgl/getRenderingStrategy.d.ts +2 -2
  396. package/dist/esm/webgl/getRenderingStrategy.js +1 -1
  397. package/dist/esm/webgl/main.d.ts +4 -17
  398. package/dist/esm/webgl/main.js +1 -1
  399. package/dist/esm/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
  400. package/dist/esm/webgl/readColorAttachmentAsRgba8.js +1 -0
  401. package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +17 -8
  402. package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +5 -5
  403. package/dist/esm/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +1 -1
  404. package/dist/esm/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
  405. package/dist/esm/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +3 -3
  406. package/dist/esm/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
  407. package/dist/esm/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
  408. package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +84 -0
  409. package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +34 -0
  410. package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +5 -5
  411. package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
  412. package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +7 -7
  413. package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +4 -4
  414. package/dist/esm/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +1 -1
  415. package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +8 -5
  416. package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +1 -1
  417. package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +43 -40
  418. package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +4 -4
  419. package/dist/esm/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +1 -1
  420. package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +3 -3
  421. package/dist/esm/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +1 -1
  422. package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +1 -1
  423. package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +4 -4
  424. package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +124 -112
  425. package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +6 -6
  426. package/dist/esm/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +5 -5
  427. package/dist/esm/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
  428. package/dist/esm/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +3 -3
  429. package/dist/esm/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +1 -1
  430. package/dist/esm/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
  431. package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +54 -1
  432. package/dist/esm/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
  433. package/dist/esm/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +4 -1
  434. package/dist/esm/webgl/shaderity_shaders/common/prerequisites.glsl.js +3 -3
  435. package/dist/esm/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +10 -1
  436. package/dist/esm/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +12 -0
  437. package/dist/esm/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
  438. package/dist/esm/webgl/shaders/RaymarchingShaderPart.js +30 -18
  439. package/dist/esm/webgl/shaders/RaymarchingShadowShaderPart.js +9 -9
  440. package/dist/esm/webgl/shaders/StandardShaderPart.d.ts +3 -3
  441. package/dist/esm/webgl/shaders/StandardShaderPart.js +16 -16
  442. package/dist/esm/webgl/shaders/glslCommonChunks.d.ts +2 -2
  443. package/dist/esm/webgl/shaders/nodes/BlockBeginShader.js +1 -1
  444. package/dist/esm/webgl/shaders/nodes/BlockEndShader.js +1 -1
  445. package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.d.ts +2 -2
  446. package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +7 -7
  447. package/dist/esm/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
  448. package/dist/esm/webgl/shaders/nodes/DiscardShader.js +3 -3
  449. package/dist/esm/webgl/shaders/nodes/EndShader.d.ts +2 -2
  450. package/dist/esm/webgl/shaders/nodes/EndShader.js +3 -3
  451. package/dist/esm/webgl/shaders/nodes/OutDistance.d.ts +1 -1
  452. package/dist/esm/webgl/shaders/nodes/OutDistance.js +1 -1
  453. package/dist/esm/webgl/shaders/nodes/OutUnion.js +1 -1
  454. package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
  455. package/dist/esm/webgl/shaders/nodes/SdApplyTransform.js +5 -5
  456. package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
  457. package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
  458. package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +18 -18
  459. package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +14 -14
  460. package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
  461. package/dist/esm/webgl/textureLoader/KTX2TextureLoader.js +1 -1
  462. package/dist/esm/webgpu/AttributeReader.d.ts +18 -0
  463. package/dist/esm/webgpu/AttributeReader.js +1 -0
  464. package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
  465. package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
  466. package/dist/esm/webgpu/RangeAllocator.js +1 -1
  467. package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.d.ts +11 -0
  468. package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.js +24 -0
  469. package/dist/esm/webgpu/WebGpuBindGroups.d.ts +131 -0
  470. package/dist/esm/webgpu/WebGpuBindGroups.js +1 -0
  471. package/dist/esm/webgpu/WebGpuBufferArena.js +1 -1
  472. package/dist/esm/webgpu/WebGpuCompressedTextures.d.ts +38 -0
  473. package/dist/esm/webgpu/WebGpuCompressedTextures.js +1 -0
  474. package/dist/esm/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
  475. package/dist/esm/webgpu/WebGpuCubeTextureShaders.js +60 -0
  476. package/dist/esm/webgpu/WebGpuCubeTextures.d.ts +72 -0
  477. package/dist/esm/webgpu/WebGpuCubeTextures.js +1 -0
  478. package/dist/esm/webgpu/WebGpuDraw.d.ts +63 -0
  479. package/dist/esm/webgpu/WebGpuDraw.js +1 -0
  480. package/dist/esm/webgpu/WebGpuDrawParameters.d.ts +61 -0
  481. package/dist/esm/webgpu/WebGpuDrawParameters.js +1 -0
  482. package/dist/esm/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
  483. package/dist/esm/webgpu/WebGpuExternalRenderPass.js +1 -0
  484. package/dist/esm/webgpu/WebGpuFrame.d.ts +55 -0
  485. package/dist/esm/webgpu/WebGpuFrame.js +1 -0
  486. package/dist/esm/webgpu/WebGpuFrameRenderer.d.ts +25 -0
  487. package/dist/esm/webgpu/WebGpuFrameRenderer.js +1 -0
  488. package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -236
  489. package/dist/esm/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
  490. package/dist/esm/webgpu/WebGpuGpuCullingShaders.js +236 -0
  491. package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
  492. package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -153
  493. package/dist/esm/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
  494. package/dist/esm/webgpu/WebGpuLightClusterShaders.js +153 -0
  495. package/dist/esm/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
  496. package/dist/esm/webgpu/WebGpuMipmapGenerator.js +1 -0
  497. package/dist/esm/webgpu/WebGpuMipmapShaders.d.ts +1 -0
  498. package/dist/esm/webgpu/WebGpuMipmapShaders.js +26 -0
  499. package/dist/esm/webgpu/WebGpuRenderBundles.d.ts +117 -0
  500. package/dist/esm/webgpu/WebGpuRenderBundles.js +1 -0
  501. package/dist/esm/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
  502. package/dist/esm/webgpu/WebGpuRenderPassEncoders.js +1 -0
  503. package/dist/esm/webgpu/WebGpuRenderPipelines.d.ts +75 -0
  504. package/dist/esm/webgpu/WebGpuRenderPipelines.js +3 -0
  505. package/dist/esm/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
  506. package/dist/esm/webgpu/WebGpuRenderTargetTextures.js +1 -0
  507. package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +52 -322
  508. package/dist/esm/webgpu/WebGpuResourceRepository.js +1 -116
  509. package/dist/esm/webgpu/WebGpuSamplers.d.ts +45 -0
  510. package/dist/esm/webgpu/WebGpuSamplers.js +1 -0
  511. package/dist/esm/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
  512. package/dist/esm/webgpu/WebGpuShaderProgramBuilder.js +9 -0
  513. package/dist/esm/webgpu/WebGpuStorageBuffers.d.ts +77 -0
  514. package/dist/esm/webgpu/WebGpuStorageBuffers.js +1 -0
  515. package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +2 -73
  516. package/dist/esm/webgpu/WebGpuStrategyBasic.js +1 -139
  517. package/dist/esm/webgpu/WebGpuStrategyStorage.d.ts +62 -0
  518. package/dist/esm/webgpu/WebGpuStrategyStorage.js +1 -0
  519. package/dist/esm/webgpu/WebGpuTextureReadback.d.ts +111 -0
  520. package/dist/esm/webgpu/WebGpuTextureReadback.js +1 -0
  521. package/dist/esm/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
  522. package/dist/esm/webgpu/WebGpuTextureReadbackShaders.js +26 -0
  523. package/dist/esm/webgpu/WebGpuTextureUploads.d.ts +109 -0
  524. package/dist/esm/webgpu/WebGpuTextureUploads.js +1 -0
  525. package/dist/esm/webgpu/WebGpuTextures.d.ts +196 -0
  526. package/dist/esm/webgpu/WebGpuTextures.js +1 -0
  527. package/dist/esm/webgpu/WebGpuVertexBuffers.d.ts +142 -0
  528. package/dist/esm/webgpu/WebGpuVertexBuffers.js +1 -0
  529. package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -124
  530. package/dist/esm/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
  531. package/dist/esm/webgpu/WebGpuVertexDeformerShaders.js +124 -0
  532. package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
  533. package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.js +84 -0
  534. package/dist/esm/webgpu/assertArrayBufferView.d.ts +9 -0
  535. package/dist/esm/webgpu/assertArrayBufferView.js +1 -0
  536. package/dist/esm/webgpu/main.d.ts +2 -16
  537. package/dist/esm/webgpu/main.js +1 -1
  538. package/dist/esm/webgpu/padCompressedRowsForUpload.d.ts +20 -0
  539. package/dist/esm/webgpu/padCompressedRowsForUpload.js +1 -0
  540. package/dist/esm/webgpu/removeRowPadding.d.ts +21 -0
  541. package/dist/esm/webgpu/removeRowPadding.js +1 -0
  542. package/dist/esm/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +15 -8
  543. package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +84 -0
  544. package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +19 -0
  545. package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +6 -6
  546. package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +3 -3
  547. package/dist/esm/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +5 -5
  548. package/dist/esm/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +3 -3
  549. package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +9 -6
  550. package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +44 -41
  551. package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
  552. package/dist/esm/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +1 -1
  553. package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
  554. package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +3 -3
  555. package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +125 -114
  556. package/dist/esm/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +5 -5
  557. package/dist/esm/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +1 -1
  558. package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +55 -1
  559. package/dist/esm/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +4 -1
  560. package/dist/esm/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +1 -1
  561. package/dist/esm/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +7 -0
  562. package/dist/esm/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +13 -2
  563. package/dist/esm/webgpu/wgslCommonChunks.d.ts +2 -2
  564. package/dist/esm/xr/WebARSystem.js +1 -1
  565. package/dist/esm/xr/WebXRSystem.d.ts +0 -4
  566. package/dist/esm/xr/WebXRSystem.js +1 -1
  567. package/dist/esmdev/effekseer/EffekseerComponent.js +3 -3
  568. package/dist/esmdev/foundation/components/Camera/CameraComponent.js +4 -4
  569. package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +14 -0
  570. package/dist/esmdev/foundation/components/Light/LightComponent.js +38 -11
  571. package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +47 -44
  572. package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +33 -5
  573. package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +152 -102
  574. package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +65 -65
  575. package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
  576. package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +250 -250
  577. package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +335 -335
  578. package/dist/esmdev/foundation/components/Shape/ShapeComponent.js +31 -31
  579. package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +5 -5
  580. package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +5 -5
  581. package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +9 -9
  582. package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.js +222 -222
  583. package/dist/esmdev/foundation/components/Transform/TransformComponent.js +66 -66
  584. package/dist/esmdev/foundation/components/Trigger/TriggerComponent.js +61 -61
  585. package/dist/esmdev/foundation/components/Vrm/VrmComponent.js +44 -44
  586. package/dist/esmdev/foundation/constraints/VrmAimConstraint.js +11 -11
  587. package/dist/esmdev/foundation/constraints/VrmRollConstraint.js +16 -16
  588. package/dist/esmdev/foundation/constraints/VrmRotationConstraint.js +10 -10
  589. package/dist/esmdev/foundation/core/Component.js +32 -32
  590. package/dist/esmdev/foundation/core/ComponentMemoryRegistry.js +41 -41
  591. package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
  592. package/dist/esmdev/foundation/core/Config.d.ts +15 -0
  593. package/dist/esmdev/foundation/core/Config.js +27 -10
  594. package/dist/esmdev/foundation/core/Entity.js +9 -9
  595. package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
  596. package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +3 -3
  597. package/dist/esmdev/foundation/core/GlobalDataRepository.js +33 -20
  598. package/dist/esmdev/foundation/core/MemoryManager.js +27 -27
  599. package/dist/esmdev/foundation/core/RnObject.js +36 -36
  600. package/dist/esmdev/foundation/definitions/Blend.js +3 -3
  601. package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
  602. package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
  603. package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
  604. package/dist/esmdev/foundation/definitions/RenderBackend.d.ts +21 -0
  605. package/dist/esmdev/foundation/definitions/RenderBackend.js +60 -0
  606. package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
  607. package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
  608. package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.js +1 -1
  609. package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
  610. package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
  611. package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
  612. package/dist/esmdev/foundation/definitions/index.d.ts +1 -1
  613. package/dist/esmdev/foundation/definitions/index.js +2 -2
  614. package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
  615. package/dist/esmdev/foundation/exporter/Gltf2Exporter.d.ts +6 -0
  616. package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +140 -110
  617. package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
  618. package/dist/esmdev/foundation/geometry/Frustum.js +40 -40
  619. package/dist/esmdev/foundation/geometry/Mesh.d.ts +33 -68
  620. package/dist/esmdev/foundation/geometry/Mesh.js +211 -405
  621. package/dist/esmdev/foundation/geometry/Primitive.d.ts +1 -1
  622. package/dist/esmdev/foundation/geometry/Primitive.js +141 -135
  623. package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
  624. package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
  625. package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
  626. package/dist/esmdev/foundation/gizmos/AABBGizmo.js +16 -16
  627. package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +23 -23
  628. package/dist/esmdev/foundation/gizmos/Gizmo.js +23 -23
  629. package/dist/esmdev/foundation/gizmos/JointGizmo.js +37 -37
  630. package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +108 -10
  631. package/dist/esmdev/foundation/gizmos/LightGizmo.js +248 -49
  632. package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +25 -25
  633. package/dist/esmdev/foundation/gizmos/RotationGizmo.js +212 -212
  634. package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +130 -130
  635. package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +43 -43
  636. package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +24 -24
  637. package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +129 -129
  638. package/dist/esmdev/foundation/helpers/BloomHelper.js +42 -38
  639. package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
  640. package/dist/esmdev/foundation/helpers/MaterialHelper.d.ts +2 -0
  641. package/dist/esmdev/foundation/helpers/MaterialHelper.js +3 -1
  642. package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
  643. package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
  644. package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.js +17 -0
  645. package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
  646. package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +126 -0
  647. package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
  648. package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
  649. package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.js +87 -0
  650. package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
  651. package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +100 -309
  652. package/dist/esmdev/foundation/helpers/materials/createClassicUberMaterial.js +13 -5
  653. package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
  654. package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +32 -0
  655. package/dist/esmdev/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +12 -4
  656. package/dist/esmdev/foundation/helpers/materials/createGaussianBlurMaterial.js +13 -5
  657. package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +7 -3
  658. package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +41 -18
  659. package/dist/esmdev/foundation/helpers/materials/createPbrUberMaterial.js +13 -5
  660. package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +22 -8
  661. package/dist/esmdev/foundation/helpers/materials/index.d.ts +1 -0
  662. package/dist/esmdev/foundation/helpers/materials/index.js +3 -1
  663. package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +26 -14
  664. package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
  665. package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +33 -33
  666. package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
  667. package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
  668. package/dist/esmdev/foundation/importer/ModelConverter.d.ts +19 -0
  669. package/dist/esmdev/foundation/importer/ModelConverter.js +183 -132
  670. package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
  671. package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
  672. package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
  673. package/dist/esmdev/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
  674. package/dist/esmdev/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -33
  675. package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
  676. package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +31 -30
  677. package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +15 -9
  678. package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
  679. package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +5 -20
  680. package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
  681. package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.js +5 -19
  682. package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
  683. package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.js +16 -28
  684. package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +200 -174
  685. package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +21 -22
  686. package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.d.ts +0 -16
  687. package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.js +7 -20
  688. package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +34 -21
  689. package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
  690. package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.js +5 -29
  691. package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +42 -26
  692. package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
  693. package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +61 -153
  694. package/dist/esmdev/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
  695. package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +31 -31
  696. package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
  697. package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -114
  698. package/dist/esmdev/foundation/materials/core/Material.js +116 -364
  699. package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
  700. package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +46 -1399
  701. package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
  702. package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.js +609 -0
  703. package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
  704. package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.js +95 -0
  705. package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +26 -20
  706. package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +29 -23
  707. package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +16 -16
  708. package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +16 -16
  709. package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +21 -21
  710. package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
  711. package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
  712. package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +18 -18
  713. package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
  714. package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
  715. package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
  716. package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
  717. package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
  718. package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
  719. package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
  720. package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
  721. package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
  722. package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
  723. package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +18 -18
  724. package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
  725. package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
  726. package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +17 -17
  727. package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
  728. package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +19 -19
  729. package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
  730. package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
  731. package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
  732. package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
  733. package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
  734. package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
  735. package/dist/esmdev/foundation/materials/nodes/CosShaderNode.d.ts +1 -1
  736. package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +17 -17
  737. package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
  738. package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
  739. package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +15 -15
  740. package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
  741. package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +14 -14
  742. package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
  743. package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
  744. package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +14 -14
  745. package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
  746. package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
  747. package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +14 -14
  748. package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
  749. package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +17 -17
  750. package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
  751. package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +14 -14
  752. package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
  753. package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +14 -14
  754. package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +23 -23
  755. package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +21 -21
  756. package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
  757. package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +25 -25
  758. package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
  759. package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
  760. package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +13 -13
  761. package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
  762. package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +14 -14
  763. package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
  764. package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
  765. package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
  766. package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
  767. package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
  768. package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
  769. package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
  770. package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
  771. package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
  772. package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
  773. package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
  774. package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
  775. package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
  776. package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
  777. package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
  778. package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
  779. package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
  780. package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
  781. package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.d.ts +1 -1
  782. package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +8 -8
  783. package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
  784. package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
  785. package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +15 -15
  786. package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +15 -15
  787. package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
  788. package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +21 -21
  789. package/dist/esmdev/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
  790. package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +17 -17
  791. package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
  792. package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +19 -19
  793. package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
  794. package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +22 -22
  795. package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +17 -17
  796. package/dist/esmdev/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
  797. package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +17 -17
  798. package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
  799. package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
  800. package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.d.ts +1 -1
  801. package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +14 -14
  802. package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
  803. package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
  804. package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
  805. package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
  806. package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
  807. package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
  808. package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
  809. package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
  810. package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
  811. package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
  812. package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
  813. package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
  814. package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
  815. package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
  816. package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
  817. package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
  818. package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +16 -16
  819. package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
  820. package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +16 -16
  821. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
  822. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
  823. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
  824. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
  825. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
  826. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
  827. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
  828. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
  829. package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
  830. package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
  831. package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
  832. package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
  833. package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
  834. package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
  835. package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
  836. package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
  837. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
  838. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
  839. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
  840. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
  841. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
  842. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
  843. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
  844. package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
  845. package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
  846. package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
  847. package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
  848. package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
  849. package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
  850. package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
  851. package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
  852. package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
  853. package/dist/esmdev/foundation/math/AABB.js +132 -132
  854. package/dist/esmdev/foundation/math/AnimatedQuaternion.js +54 -54
  855. package/dist/esmdev/foundation/math/AnimatedScalar.js +55 -55
  856. package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +20 -20
  857. package/dist/esmdev/foundation/math/AnimatedVector2.js +55 -55
  858. package/dist/esmdev/foundation/math/AnimatedVector3.js +55 -55
  859. package/dist/esmdev/foundation/math/AnimatedVector4.js +55 -55
  860. package/dist/esmdev/foundation/math/AnimatedVectorN.js +55 -55
  861. package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
  862. package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
  863. package/dist/esmdev/foundation/math/MathClassUtil.js +4 -4
  864. package/dist/esmdev/foundation/math/MathUtil.d.ts +11 -0
  865. package/dist/esmdev/foundation/math/MathUtil.js +5 -1
  866. package/dist/esmdev/foundation/math/Quaternion.js +20 -20
  867. package/dist/esmdev/foundation/math/Transform3D.js +74 -74
  868. package/dist/esmdev/foundation/math/shapes/MathSphere.js +7 -7
  869. package/dist/esmdev/foundation/memory/Accessor.js +369 -369
  870. package/dist/esmdev/foundation/memory/Buffer.js +40 -40
  871. package/dist/esmdev/foundation/memory/BufferView.js +33 -33
  872. package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
  873. package/dist/esmdev/foundation/misc/EnumIO.js +10 -10
  874. package/dist/esmdev/foundation/misc/Logger.js +14 -14
  875. package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
  876. package/dist/esmdev/foundation/misc/Time.js +27 -27
  877. package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
  878. package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
  879. package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
  880. package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +10 -10
  881. package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +190 -190
  882. package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +241 -241
  883. package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
  884. package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +42 -42
  885. package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +27 -27
  886. package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +10 -10
  887. package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +55 -55
  888. package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
  889. package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.js +4 -4
  890. package/dist/esmdev/foundation/renderer/Expression.js +6 -6
  891. package/dist/esmdev/foundation/renderer/Frame.js +12 -12
  892. package/dist/esmdev/foundation/renderer/FrameBuffer.js +28 -28
  893. package/dist/esmdev/foundation/renderer/FrameRenderer.d.ts +42 -0
  894. package/dist/esmdev/foundation/renderer/FrameRenderer.js +1 -0
  895. package/dist/esmdev/foundation/renderer/RenderPass.js +101 -101
  896. package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
  897. package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.js +61 -0
  898. package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +10 -10
  899. package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
  900. package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +97 -83
  901. package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
  902. package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +193 -155
  903. package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
  904. package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +6 -6
  905. package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +82 -176
  906. package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +440 -1108
  907. package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
  908. package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.js +858 -0
  909. package/dist/esmdev/foundation/system/Engine.d.ts +19 -44
  910. package/dist/esmdev/foundation/system/Engine.js +235 -601
  911. package/dist/esmdev/foundation/system/EngineState.d.ts +9 -3
  912. package/dist/esmdev/foundation/system/EngineState.js +4 -4
  913. package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
  914. package/dist/esmdev/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
  915. package/dist/esmdev/foundation/system/GpuDriverWorkarounds.js +93 -0
  916. package/dist/esmdev/foundation/system/InputManager.js +56 -56
  917. package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
  918. package/dist/esmdev/foundation/system/index.d.ts +1 -0
  919. package/dist/esmdev/foundation/system/index.js +2 -1
  920. package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
  921. package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.js +88 -0
  922. package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
  923. package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.js +59 -0
  924. package/dist/esmdev/foundation/textures/AbstractTexture.js +49 -49
  925. package/dist/esmdev/foundation/textures/CubeTexture.js +35 -42
  926. package/dist/esmdev/foundation/textures/RenderBuffer.js +16 -17
  927. package/dist/esmdev/foundation/textures/RenderTargetTexture.d.ts +5 -67
  928. package/dist/esmdev/foundation/textures/RenderTargetTexture.js +18 -140
  929. package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
  930. package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +34 -177
  931. package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
  932. package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +31 -88
  933. package/dist/esmdev/foundation/textures/Sampler.js +24 -24
  934. package/dist/esmdev/foundation/textures/Texture.d.ts +19 -1
  935. package/dist/esmdev/foundation/textures/Texture.js +133 -146
  936. package/dist/esmdev/foundation/textures/TextureArray.js +13 -16
  937. package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
  938. package/dist/esmdev/foundation/textures/VideoTexture.d.ts +11 -0
  939. package/dist/esmdev/foundation/textures/VideoTexture.js +47 -46
  940. package/dist/esmdev/foundation/textures/decodeBasisImage.d.ts +14 -0
  941. package/dist/esmdev/foundation/textures/decodeBasisImage.js +14 -0
  942. package/dist/esmdev/foundation/textures/index.d.ts +2 -0
  943. package/dist/esmdev/foundation/textures/index.js +3 -1
  944. package/dist/esmdev/types/glTF2.d.ts +9 -0
  945. package/dist/esmdev/types/glTF2.js +1 -1
  946. package/dist/esmdev/version.js +2 -2
  947. package/dist/esmdev/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
  948. package/dist/esmdev/webgl/ComponentDataAccessorGLSL.js +146 -0
  949. package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
  950. package/dist/esmdev/webgl/MultiDraw.d.ts +1 -1
  951. package/dist/esmdev/webgl/MultiDraw.js +4 -4
  952. package/dist/esmdev/webgl/MultiDrawRepository.js +34 -34
  953. package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
  954. package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.js +142 -0
  955. package/dist/esmdev/webgl/WebGLCompressedTextures.d.ts +48 -0
  956. package/dist/esmdev/webgl/WebGLCompressedTextures.js +105 -0
  957. package/dist/esmdev/webgl/WebGLContextWrapper.d.ts +9 -52
  958. package/dist/esmdev/webgl/WebGLContextWrapper.js +127 -229
  959. package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
  960. package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.js +178 -0
  961. package/dist/esmdev/webgl/WebGLCubeTextures.d.ts +92 -0
  962. package/dist/esmdev/webgl/WebGLCubeTextures.js +358 -0
  963. package/dist/esmdev/webgl/WebGLDataTexture.d.ts +108 -0
  964. package/dist/esmdev/webgl/WebGLDataTexture.js +337 -0
  965. package/dist/esmdev/webgl/WebGLDrawState.d.ts +84 -0
  966. package/dist/esmdev/webgl/WebGLDrawState.js +164 -0
  967. package/dist/esmdev/webgl/WebGLExternalState.d.ts +43 -0
  968. package/dist/esmdev/webgl/WebGLExternalState.js +70 -0
  969. package/dist/esmdev/webgl/WebGLFrameRenderer.d.ts +32 -0
  970. package/dist/esmdev/webgl/WebGLFrameRenderer.js +155 -0
  971. package/dist/esmdev/webgl/WebGLFramebuffers.d.ts +142 -0
  972. package/dist/esmdev/webgl/WebGLFramebuffers.js +245 -0
  973. package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
  974. package/dist/esmdev/webgl/WebGLMaterialParameters.d.ts +47 -0
  975. package/dist/esmdev/webgl/WebGLMaterialParameters.js +81 -0
  976. package/dist/esmdev/webgl/WebGLMeshResources.d.ts +115 -0
  977. package/dist/esmdev/webgl/WebGLMeshResources.js +303 -0
  978. package/dist/esmdev/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
  979. package/dist/esmdev/webgl/WebGLMorphUniformBuffers.js +272 -0
  980. package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +100 -178
  981. package/dist/esmdev/webgl/WebGLResourceRepository.js +345 -2592
  982. package/dist/esmdev/webgl/WebGLSamplers.d.ts +78 -0
  983. package/dist/esmdev/webgl/WebGLSamplers.js +143 -0
  984. package/dist/esmdev/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
  985. package/dist/esmdev/webgl/WebGLShaderProgramBuilder.js +208 -0
  986. package/dist/esmdev/webgl/WebGLShaderPrograms.d.ts +88 -0
  987. package/dist/esmdev/webgl/WebGLShaderPrograms.js +240 -0
  988. package/dist/esmdev/webgl/WebGLStereoUtil.d.ts +0 -27
  989. package/dist/esmdev/webgl/WebGLStereoUtil.js +36 -115
  990. package/dist/esmdev/webgl/WebGLStrategyDataUploader.d.ts +152 -0
  991. package/dist/esmdev/webgl/WebGLStrategyDataUploader.js +370 -0
  992. package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
  993. package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.js +213 -0
  994. package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
  995. package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.js +300 -0
  996. package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +7 -360
  997. package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +75 -1856
  998. package/dist/esmdev/webgl/WebGLTextureUnitState.d.ts +79 -0
  999. package/dist/esmdev/webgl/WebGLTextureUnitState.js +149 -0
  1000. package/dist/esmdev/webgl/WebGLTextureUploads.d.ts +106 -0
  1001. package/dist/esmdev/webgl/WebGLTextureUploads.js +168 -0
  1002. package/dist/esmdev/webgl/WebGLTextures.d.ts +316 -0
  1003. package/dist/esmdev/webgl/WebGLTextures.js +577 -0
  1004. package/dist/esmdev/webgl/WebGLUniformBuffers.d.ts +35 -0
  1005. package/dist/esmdev/webgl/WebGLUniformBuffers.js +89 -0
  1006. package/dist/esmdev/webgl/WebGLUniforms.d.ts +117 -0
  1007. package/dist/esmdev/webgl/WebGLUniforms.js +283 -0
  1008. package/dist/esmdev/webgl/WebGLVertexBuffers.d.ts +172 -0
  1009. package/dist/esmdev/webgl/WebGLVertexBuffers.js +391 -0
  1010. package/dist/esmdev/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
  1011. package/dist/esmdev/webgl/debug/BufferLayoutDecoder.js +52 -59
  1012. package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +17 -17
  1013. package/dist/esmdev/webgl/debug/types.d.ts +2 -2
  1014. package/dist/esmdev/webgl/getRenderingStrategy.d.ts +2 -2
  1015. package/dist/esmdev/webgl/getRenderingStrategy.js +5 -5
  1016. package/dist/esmdev/webgl/main.d.ts +4 -17
  1017. package/dist/esmdev/webgl/main.js +5 -3
  1018. package/dist/esmdev/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
  1019. package/dist/esmdev/webgl/readColorAttachmentAsRgba8.js +47 -0
  1020. package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
  1021. package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
  1022. package/dist/esmdev/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +2 -2
  1023. package/dist/esmdev/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
  1024. package/dist/esmdev/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +2 -2
  1025. package/dist/esmdev/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
  1026. package/dist/esmdev/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
  1027. package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +12 -0
  1028. package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +12 -0
  1029. package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
  1030. package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
  1031. package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
  1032. package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +2 -2
  1033. package/dist/esmdev/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
  1034. package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
  1035. package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +2 -2
  1036. package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
  1037. package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +2 -2
  1038. package/dist/esmdev/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +2 -2
  1039. package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +2 -2
  1040. package/dist/esmdev/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +2 -2
  1041. package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +2 -2
  1042. package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +2 -2
  1043. package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
  1044. package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +2 -2
  1045. package/dist/esmdev/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +2 -2
  1046. package/dist/esmdev/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
  1047. package/dist/esmdev/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +2 -2
  1048. package/dist/esmdev/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +2 -2
  1049. package/dist/esmdev/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
  1050. package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
  1051. package/dist/esmdev/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
  1052. package/dist/esmdev/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +5 -2
  1053. package/dist/esmdev/webgl/shaderity_shaders/common/prerequisites.glsl.js +2 -2
  1054. package/dist/esmdev/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +2 -2
  1055. package/dist/esmdev/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +2 -2
  1056. package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
  1057. package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +35 -23
  1058. package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +17 -17
  1059. package/dist/esmdev/webgl/shaders/StandardShaderPart.d.ts +3 -3
  1060. package/dist/esmdev/webgl/shaders/StandardShaderPart.js +15 -15
  1061. package/dist/esmdev/webgl/shaders/glslCommonChunks.d.ts +2 -2
  1062. package/dist/esmdev/webgl/shaders/glslCommonChunks.js +1 -1
  1063. package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
  1064. package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
  1065. package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.d.ts +2 -2
  1066. package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +27 -27
  1067. package/dist/esmdev/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
  1068. package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +8 -8
  1069. package/dist/esmdev/webgl/shaders/nodes/EndShader.d.ts +2 -2
  1070. package/dist/esmdev/webgl/shaders/nodes/EndShader.js +9 -9
  1071. package/dist/esmdev/webgl/shaders/nodes/OutDistance.d.ts +1 -1
  1072. package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +17 -17
  1073. package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +12 -12
  1074. package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +11 -11
  1075. package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +12 -12
  1076. package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
  1077. package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +13 -13
  1078. package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +27 -27
  1079. package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +27 -27
  1080. package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
  1081. package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +36 -30
  1082. package/dist/esmdev/webgpu/AttributeReader.d.ts +18 -0
  1083. package/dist/esmdev/webgpu/AttributeReader.js +57 -0
  1084. package/dist/esmdev/webgpu/GpuCullingRegistry.js +94 -94
  1085. package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
  1086. package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
  1087. package/dist/esmdev/webgpu/ShaderPropertyAccessorWGSL.d.ts +11 -0
  1088. package/dist/esmdev/webgpu/ShaderPropertyAccessorWGSL.js +131 -0
  1089. package/dist/esmdev/webgpu/WebGpuBindGroups.d.ts +131 -0
  1090. package/dist/esmdev/webgpu/WebGpuBindGroups.js +377 -0
  1091. package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
  1092. package/dist/esmdev/webgpu/WebGpuCompressedTextures.d.ts +38 -0
  1093. package/dist/esmdev/webgpu/WebGpuCompressedTextures.js +155 -0
  1094. package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
  1095. package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.js +68 -0
  1096. package/dist/esmdev/webgpu/WebGpuCubeTextures.d.ts +72 -0
  1097. package/dist/esmdev/webgpu/WebGpuCubeTextures.js +340 -0
  1098. package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
  1099. package/dist/esmdev/webgpu/WebGpuDraw.d.ts +63 -0
  1100. package/dist/esmdev/webgpu/WebGpuDraw.js +133 -0
  1101. package/dist/esmdev/webgpu/WebGpuDrawParameters.d.ts +61 -0
  1102. package/dist/esmdev/webgpu/WebGpuDrawParameters.js +120 -0
  1103. package/dist/esmdev/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
  1104. package/dist/esmdev/webgpu/WebGpuExternalRenderPass.js +115 -0
  1105. package/dist/esmdev/webgpu/WebGpuFrame.d.ts +55 -0
  1106. package/dist/esmdev/webgpu/WebGpuFrame.js +89 -0
  1107. package/dist/esmdev/webgpu/WebGpuFrameRenderer.d.ts +25 -0
  1108. package/dist/esmdev/webgpu/WebGpuFrameRenderer.js +248 -0
  1109. package/dist/esmdev/webgpu/WebGpuGpuCulling.js +200 -454
  1110. package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
  1111. package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.js +264 -0
  1112. package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
  1113. package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +39 -194
  1114. package/dist/esmdev/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
  1115. package/dist/esmdev/webgpu/WebGpuLightClusterShaders.js +161 -0
  1116. package/dist/esmdev/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
  1117. package/dist/esmdev/webgpu/WebGpuMipmapGenerator.js +187 -0
  1118. package/dist/esmdev/webgpu/WebGpuMipmapShaders.d.ts +1 -0
  1119. package/dist/esmdev/webgpu/WebGpuMipmapShaders.js +34 -0
  1120. package/dist/esmdev/webgpu/WebGpuRenderBundles.d.ts +117 -0
  1121. package/dist/esmdev/webgpu/WebGpuRenderBundles.js +299 -0
  1122. package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
  1123. package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.js +611 -0
  1124. package/dist/esmdev/webgpu/WebGpuRenderPipelines.d.ts +75 -0
  1125. package/dist/esmdev/webgpu/WebGpuRenderPipelines.js +249 -0
  1126. package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
  1127. package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.js +108 -0
  1128. package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +52 -322
  1129. package/dist/esmdev/webgpu/WebGpuResourceRepository.js +332 -3127
  1130. package/dist/esmdev/webgpu/WebGpuSamplers.d.ts +45 -0
  1131. package/dist/esmdev/webgpu/WebGpuSamplers.js +58 -0
  1132. package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
  1133. package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.js +108 -0
  1134. package/dist/esmdev/webgpu/WebGpuStorageBuffers.d.ts +77 -0
  1135. package/dist/esmdev/webgpu/WebGpuStorageBuffers.js +191 -0
  1136. package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +2 -73
  1137. package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +63 -781
  1138. package/dist/esmdev/webgpu/WebGpuStrategyStorage.d.ts +62 -0
  1139. package/dist/esmdev/webgpu/WebGpuStrategyStorage.js +267 -0
  1140. package/dist/esmdev/webgpu/WebGpuTextureReadback.d.ts +111 -0
  1141. package/dist/esmdev/webgpu/WebGpuTextureReadback.js +188 -0
  1142. package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
  1143. package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.js +34 -0
  1144. package/dist/esmdev/webgpu/WebGpuTextureUploads.d.ts +109 -0
  1145. package/dist/esmdev/webgpu/WebGpuTextureUploads.js +197 -0
  1146. package/dist/esmdev/webgpu/WebGpuTextures.d.ts +196 -0
  1147. package/dist/esmdev/webgpu/WebGpuTextures.js +344 -0
  1148. package/dist/esmdev/webgpu/WebGpuVertexBuffers.d.ts +142 -0
  1149. package/dist/esmdev/webgpu/WebGpuVertexBuffers.js +281 -0
  1150. package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +106 -284
  1151. package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
  1152. package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.js +134 -0
  1153. package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
  1154. package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.js +216 -0
  1155. package/dist/esmdev/webgpu/assertArrayBufferView.d.ts +9 -0
  1156. package/dist/esmdev/webgpu/assertArrayBufferView.js +10 -0
  1157. package/dist/esmdev/webgpu/main.d.ts +2 -16
  1158. package/dist/esmdev/webgpu/main.js +3 -3
  1159. package/dist/esmdev/webgpu/padCompressedRowsForUpload.d.ts +20 -0
  1160. package/dist/esmdev/webgpu/padCompressedRowsForUpload.js +20 -0
  1161. package/dist/esmdev/webgpu/removeRowPadding.d.ts +21 -0
  1162. package/dist/esmdev/webgpu/removeRowPadding.js +23 -0
  1163. package/dist/esmdev/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
  1164. package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +12 -0
  1165. package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +12 -0
  1166. package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
  1167. package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
  1168. package/dist/esmdev/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
  1169. package/dist/esmdev/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
  1170. package/dist/esmdev/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +2 -2
  1171. package/dist/esmdev/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +2 -2
  1172. package/dist/esmdev/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
  1173. package/dist/esmdev/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +2 -2
  1174. package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
  1175. package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +2 -2
  1176. package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
  1177. package/dist/esmdev/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +2 -2
  1178. package/dist/esmdev/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +2 -2
  1179. package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
  1180. package/dist/esmdev/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +5 -2
  1181. package/dist/esmdev/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +2 -2
  1182. package/dist/esmdev/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +2 -2
  1183. package/dist/esmdev/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +2 -2
  1184. package/dist/esmdev/webgpu/wgslCommonChunks.d.ts +2 -2
  1185. package/dist/esmdev/webgpu/wgslCommonChunks.js +1 -1
  1186. package/dist/esmdev/xr/WebARSystem.js +69 -69
  1187. package/dist/esmdev/xr/WebXRSystem.d.ts +0 -4
  1188. package/dist/esmdev/xr/WebXRSystem.js +155 -160
  1189. package/package.json +1 -1
  1190. package/dist/esm/foundation/definitions/ProcessApproach.d.ts +0 -21
  1191. package/dist/esm/foundation/definitions/ProcessApproach.js +0 -1
  1192. package/dist/esm/foundation/materials/core/ShaderHandler.d.ts +0 -125
  1193. package/dist/esm/foundation/materials/core/ShaderHandler.js +0 -48
  1194. package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +0 -21
  1195. package/dist/esmdev/foundation/definitions/ProcessApproach.js +0 -60
  1196. package/dist/esmdev/foundation/materials/core/ShaderHandler.d.ts +0 -125
  1197. package/dist/esmdev/foundation/materials/core/ShaderHandler.js +0 -416
@@ -1,139 +1 @@
1
- import{AnimationComponent as E}from"../foundation/components/Animation/AnimationComponent.js";import{BlendShapeComponent as B}from"../foundation/components/BlendShape/BlendShapeComponent.js";import{CameraComponent as $}from"../foundation/components/Camera/CameraComponent.js";import{_getCameraControllerUpdateCount as T}from"../foundation/components/CameraController/CameraControllerUpdateCount.js";import{LightComponent as U}from"../foundation/components/Light/LightComponent.js";import{MeshComponent as W}from"../foundation/components/Mesh/MeshComponent.js";import{SceneGraphComponent as V}from"../foundation/components/SceneGraph/SceneGraphComponent.js";import{TransformComponent as D}from"../foundation/components/Transform/TransformComponent.js";import{Component as M}from"../foundation/core/Component.js";import{AlphaMode as N}from"../foundation/definitions/AlphaMode.js";import{BufferUse as C}from"../foundation/definitions/BufferUse.js";import{ComponentType as I}from"../foundation/definitions/ComponentType.js";import{CompositionType as o}from"../foundation/definitions/CompositionType.js";import{ShaderType as R}from"../foundation/definitions/ShaderType.js";import{VertexAttribute as L}from"../foundation/definitions/VertexAttribute.js";import{Primitive as b}from"../foundation/geometry/Primitive.js";import{getTextureAndSamplerNames as w}from"../foundation/helpers/ShaderHelper.js";import{Logger as G}from"../foundation/misc/Logger.js";import{CGAPIResourceRepository as d}from"../foundation/renderer/CGAPIResourceRepository.js";import{isSkipDrawing as F}from"../foundation/renderer/RenderingCommonMethods.js";import{WebGpuLightClusterBuilder as z}from"./WebGpuLightClusterBuilder.js";var k=class g{constructor(t){this.IB=d.InvalidCGAPIResourceUid;this.SB=d.InvalidCGAPIResourceUid;this.VI=!0;this.XI=-1;this.YI=-1;this.or=-1;this.ZI=-1;this.MB=-1;this.nr=-1;this.qI=-1;this.dC=-1;this.sr=-1;this.HI=-1;this.jI=-1;this.JI=-1;this.LI=-1;this.QI=-1;this.gI=-1;this.yI=-1;this.OB=-1;this.LS=-1;this.i=t}static init(t){return new g(t)}static getVertexShaderMethodDefinitions_storageBuffer(t,e){let r="";return M.getMemberInfo(t).forEach((n,s)=>{n.forEach((l,p)=>{var f;if(l.shaderType!==e&&l.shaderType!==R.VertexAndPixelShader)return;let h=(f=M.getComponentCountPerBufferView(t).get(s))!=null?f:1;o.isArray(l.compositionType)?a(l,s,p,h):c(l,s,p,h)})}),r;function a(n,s,l,p){var O,_;let h="",f="";switch(n.compositionType){case o.Vec4Array:h="vec4<f32>",f="fetchVec4";break;case o.Mat4Array:h="mat4x4<f32>",f="fetchMat4";break;case o.Mat4x3Array:h="mat4x3<f32>",f="fetchMat4x3";break;default:throw new Error(`Unsupported composition type: ${n.compositionType.str}`)}let m=n.compositionType.getVec4SizeOfProperty();if(n.isVariableLength===!0){let P=M._variableLengthLocationRadix;r+=`
2
- fn get_${l}(instanceId: u32, idxOfArray: u32) -> ${h} {
3
- let location = get_${M._getVariableLengthLocationMemberName(l)}(instanceId);
4
- let index: u32 = u32(location.x) * ${P}u + u32(location.y) + ${m}u * idxOfArray;
5
- let value = ${f}(index);
6
- return value;
7
- }
8
- `;return}let y=M.getLocationOffsetOfMemberOfComponent(t,s,l),u=`let arrayLength: u32 = ${(_=(O=M.getArrayLengthOfMember(t).get(s))==null?void 0:O.get(l))!=null?_:0}u;`,x=`rnIndices_${l}`,A=`${x}[instanceIdOfBufferViews] + instanceIdInBufferView * ${m}u * arrayLength + ${m}u * idxOfArray;`,S="";n.convertToBool&&(S="if (value > 0.5) { return true; } else { return false; }"),r+=`
9
- const ${x}: array<u32, ${y.length}> = array<u32, ${y.length}>(${y.map(P=>`${P}u`).join(", ")});
10
- fn get_${l}(instanceId: u32, idxOfArray: u32) -> ${n.convertToBool?"bool":h} {
11
- let instanceIdOfBufferViews = instanceId / ${p};
12
- let instanceIdInBufferView = instanceId % ${p};
13
- ${u}
14
- let index: u32 = ${A};
15
- let value = ${f}(index);
16
- ${n.convertToBool?S:"return value;"}
17
- }
18
- `}function c(n,s,l,p){let h="",f="";switch(n.compositionType){case o.Mat4:h="mat4x4<f32>",f="fetchMat4";break;case o.Mat3:h="mat3x3<f32>",f="fetchMat3No16BytesAligned";break;case o.Vec4:h="vec4<f32>",f="fetchVec4";break;case o.Vec3:h="vec3<f32>",f="fetchVec3No16BytesAligned";break;case o.Scalar:h="f32",f="fetchScalarNo16BytesAligned";break;default:throw new Error(`Unsupported composition type: ${n.compositionType.str}`)}let m=M.getLocationOffsetOfMemberOfComponent(t,s,l),y=`rnIndices_${l}`,v="";switch(n.compositionType){case o.Mat4:v=`${y}[instanceIdOfBufferViews] + 4u * instanceIdInBufferView;`;break;case o.Mat3:v=`${y}[instanceIdOfBufferViews] * 4u + 9u * instanceIdInBufferView;`;break;case o.Vec4:v=`${y}[instanceIdOfBufferViews] + 1u * instanceIdInBufferView;`;break;case o.Vec3:v=`${y}[instanceIdOfBufferViews] * 4u + 3u * instanceIdInBufferView;`;break;case o.Scalar:v=`${y}[instanceIdOfBufferViews] * 4u + 1u * instanceIdInBufferView;`;break;default:throw new Error(`Unsupported composition type: ${n.compositionType.str}`)}let u="";n.convertToBool&&(u="if (value > 0.5) { return true; } else { return false; }"),r+=`
19
- const ${y}: array<u32, ${m.length}> = array<u32, ${m.length}>(${m.map(x=>`${x}u`).join(", ")});
20
- fn get_${l}(instanceId: u32) -> ${n.convertToBool?"bool":h} {
21
- let instanceIdOfBufferViews = instanceId / ${p};
22
- let instanceIdInBufferView = instanceId % ${p};
23
- let index: u32 = ${v};
24
- let value = ${f}(index);
25
- ${n.convertToBool?u:"return value;"}
26
- }
27
- `}}static C_(t){let e=b.getMorphUniformDataTargetNumbers(),r=`
28
- const rnMorphUniformDataTargetNumbers: array<u32, ${e.length}> = array<u32, ${e.length}>(${e.map(p=>`${p}u`).join(", ")});
29
- `,i=b.getMorphUniformDataOffsets(),a=`
30
- const rnMorphUniformDataOffsets: array<u32, ${i.length}> = array<u32, ${i.length}>(${i.map(p=>`${p}u`).join(", ")});
31
- `,c=B.getOffsetsInUniform(t),n=`
32
- const rnBlendShapeUniformDataOffsets: array<u32, ${c.length}> = array<u32, ${c.length}>(${c.map(p=>`${p}u`).join(", ")});
33
- `,s=t._isPreviousMorphWeightsEnabled?`
34
- fn get_previousMorphedPosition(vertexId: u32, basePosition: vec3<f32>, blendShapeComponentSID: u32) -> vec3<f32> {
35
- let currentPrimitiveIdx = uniformDrawParameters.currentPrimitiveIdx;
36
- let offsetInUniform = rnMorphUniformDataOffsets[currentPrimitiveIdx];
37
- let offsetInUniform2 = rnBlendShapeUniformDataOffsets[blendShapeComponentSID] + ${B._getPreviousMorphWeightsOffset(t)}u;
38
- var position = basePosition;
39
- let scalar_idx = 3u * vertexId;
40
- for (var i=0u; i<rnMorphUniformDataTargetNumbers[currentPrimitiveIdx]; i++) {
41
- let idx = offsetInUniform + i;
42
- let offsets = uniformMorphOffsets.data[ idx / 4u];
43
- let offsetPosition = offsets[idx % 4u];
44
- let basePosIn4bytes = offsetPosition * 4u + scalar_idx;
45
- let addPos = fetchVec3No16BytesAlignedFromBlendShapeBuffer(basePosIn4bytes);
46
- let idx2 = offsetInUniform2 + i;
47
- let morphWeights: vec4f = uniformMorphWeights.data[ idx2 / 4u];
48
- position += addPos * morphWeights[idx2 % 4u];
49
- }
50
- return position;
51
- }`:"";return`
52
-
53
- #ifdef RN_IS_VERTEX_SHADER
54
- #ifdef RN_IS_MORPHING
55
- ${r}
56
- ${a}
57
- ${n}
58
- fn get_position(vertexId: u32, basePosition: vec3<f32>, blendShapeComponentSID: u32) -> vec3<f32> {
59
- let currentPrimitiveIdx = uniformDrawParameters.currentPrimitiveIdx;
60
- let offsetInUniform = rnMorphUniformDataOffsets[currentPrimitiveIdx];
61
- let offsetInUniform2 = rnBlendShapeUniformDataOffsets[blendShapeComponentSID];
62
- var position = basePosition;
63
- let scalar_idx = 3u * vertexId;
64
- for (var i=0u; i<rnMorphUniformDataTargetNumbers[currentPrimitiveIdx]; i++) {
65
- let idx = offsetInUniform + i;
66
- let offsets = uniformMorphOffsets.data[ idx / 4u];
67
- let offsetPosition = offsets[idx % 4u];
68
-
69
- let basePosIn4bytes = offsetPosition * 4u + scalar_idx;
70
- let addPos = fetchVec3No16BytesAlignedFromBlendShapeBuffer(basePosIn4bytes);
71
-
72
- let idx2 = offsetInUniform2 + i;
73
- let morphWeights: vec4f = uniformMorphWeights.data[ idx2 / 4u];
74
- let morphWeight: f32 = morphWeights[idx2 % 4u];
75
-
76
- position += addPos * morphWeight;
77
- }
78
-
79
- return position;
80
- }
81
- ${s}
82
- #endif
83
- #endif
84
- `}static A_(t,e){var m,y;let r=e.compositionType.toWGSLType(e.componentType),i=e.semantic.replace(".","_");if(o.isTexture(e.compositionType)){let v="texture_2d<f32>";e.compositionType===o.TextureCube?v="texture_cube<f32>":e.compositionType===o.Texture2DArray&&(v="texture_2d_array<f32>");let{textureName:u,samplerName:x}=w(i);return`
85
- @group(1) @binding(${e.initialValue[0]}) var ${u}: ${v};
86
- @group(2) @binding(${e.initialValue[0]}) var ${x}: sampler;
87
- `}let c=e.compositionType.getVec4SizeOfProperty(),n=e.compositionType.getNumberOfComponents(),s=g.getOffsetOfPropertyOfGlobalDataRepository(t,e.semantic);s===-1&&G.default.error("Could not get the location offset of the property.");let l,p=c;if(l=` let vec4_idx: u32 = ${s}u + ${p}u * instanceId;
88
- `,o.isArray(e.compositionType)){p=c*((m=e.arrayLength)!=null?m:1);let u=Math.ceil(n/4)*4*((y=e.arrayLength)!=null?y:1);l=` let vec4_idx: u32 = ${s}u + ${p} * instanceId + ${c}u * idxOfArray;
89
- `,l+=` let scalar_idx: u32 = ${s*4} + ${u} * instanceId + ${n}u * idxOfArray;
90
- `}let f=`${`
91
- fn get_${i}(instanceId: u32, idxOfArray: u32) -> ${r} {
92
- ${l}
93
- `}`;switch(e.compositionType){case o.Vec4:case o.Vec4Array:f+=` let val = fetchElement(vec4_idx);
94
- `;break;case o.Vec3:f+=` let col0 = fetchElement(vec4_idx);
95
- `,f+=` let val = ${r}(col0.xyz);`;break;case o.Vec3Array:f+=` let val = fetchVec3No16BytesAligned(scalar_idx);
96
- `;break;case o.Vec2:f+=` let col0 = fetchElement(vec4_idx);
97
- `,f+=` let val = ${r}(col0.xy);`;break;case o.Vec2Array:f+=` let val = fetchVec2No16BytesAligned(scalar_idx);
98
- `;break;case o.Scalar:f+=` let col0 = fetchElement(vec4_idx);
99
- `,e.componentType===I.Int?f+=" let val = i32(col0.x);":e.componentType===I.UnsignedInt?f+=" let val = u32(col0.x);":e.componentType===I.Bool?f+=" let val = col0.x >= 0.5;":f+=" let val = col0.x;";break;case o.ScalarArray:f+=` let col0 = fetchScalarNo16BytesAligned(scalar_idx);
100
- `,e.componentType===I.Int?f+=" let val = i32(col0);":e.componentType===I.UnsignedInt?f+=" let val = u32(col0);":e.componentType===I.Bool?f+=" let val = col0 >= 0.5;":f+=" let val = col0;";break;case o.Mat4:f+=` let val = fetchMat4(vec4_idx);
101
- `;break;case o.Mat4Array:f+=` let val = fetchMat4(vec4_idx);
102
- `;break;case o.Mat3:f+=` let val = fetchMat3(vec4_idx);
103
- `;break;case o.Mat3Array:f+=` let val = fetchMat3No16BytesAligned(scalar_idx);
104
- `;break;case o.Mat2:f+=` let val = fetchMat2(vec4_idx);
105
- `;break;case o.Mat2Array:f+=` let val = fetchMat2No16BytesAligned(scalar_idx);
106
- `;break;case o.Mat4x3Array:f+=` let val = fetchMat4x3(vec4_idx);
107
- `;break;default:f+=""}return f+=`
108
- return val;
109
- }
110
- `,f}static B_(t,e,r){var x,A;let i=r.compositionType.toWGSLType(r.componentType),a=r.semantic.replace(".","_");if(o.isTexture(r.compositionType)){let S="texture_2d<f32>";r.compositionType===o.TextureCube?S="texture_cube<f32>":r.compositionType===o.Texture2DArray&&(S="texture_2d_array<f32>");let{textureName:O,samplerName:_}=w(a);return`
111
- @group(1) @binding(${r.initialValue[0]}) var ${O}: ${S};
112
- @group(2) @binding(${r.initialValue[0]}) var ${_}: sampler;
113
- `}let n=r.compositionType.getVec4SizeOfProperty(),s=r.compositionType.getNumberOfComponents(),l=g.getOffsetOfPropertyOfMaterial(t,r.semantic,e),p=t.materialRepository._getMaterialCountPerBufferView(e),h=`rnOffsets_${a}`,f=`const ${h}: array<u32, ${l.length}> = array<u32, ${l.length}>(${l.map(S=>`${S}u`).join(", ")});`,m,y=n;if(m=` let vec4_idx: u32 = ${h}[instanceIdOfBufferViews] + ${y}u * instanceIdInBufferView;
114
- `,o.isArray(r.compositionType)){y=n*((x=r.arrayLength)!=null?x:1);let O=Math.ceil(s/4)*4*((A=r.arrayLength)!=null?A:1);m=` let vec4_idx: u32 = ${h}[instanceIdOfBufferViews] + ${y} * instanceIdInBufferView + ${n}u * idxOfArray;
115
- `,m+=` let scalar_idx: u32 = ${h}[instanceIdOfBufferViews] * 4 + ${O} * instanceIdInBufferView + ${s}u * idxOfArray;
116
- `}let u=`${`
117
- ${f}
118
- fn get_${a}(instanceId: u32, idxOfArray: u32) -> ${i} {
119
- let instanceIdOfBufferViews = instanceId / ${p};
120
- let instanceIdInBufferView = instanceId % ${p};
121
- ${m}
122
- `}`;switch(r.compositionType){case o.Vec4:case o.Vec4Array:u+=` let val = fetchElement(vec4_idx);
123
- `;break;case o.Vec3:u+=` let col0 = fetchElement(vec4_idx);
124
- `,u+=` let val = ${i}(col0.xyz);`;break;case o.Vec3Array:u+=` let val = fetchVec3No16BytesAligned(scalar_idx);
125
- `;break;case o.Vec2:u+=` let col0 = fetchElement(vec4_idx);
126
- `,u+=` let val = ${i}(col0.xy);`;break;case o.Vec2Array:u+=` let val = fetchVec2No16BytesAligned(scalar_idx);
127
- `;break;case o.Scalar:u+=` let col0 = fetchElement(vec4_idx);
128
- `,r.componentType===I.Int?u+=" let val = i32(col0.x);":r.componentType===I.UnsignedInt?u+=" let val = u32(col0.x);":r.componentType===I.Bool?u+=" let val = col0.x >= 0.5;":u+=" let val = col0.x;";break;case o.ScalarArray:u+=` let col0 = fetchScalarNo16BytesAligned(scalar_idx);
129
- `,r.componentType===I.Int?u+=" let val = i32(col0);":r.componentType===I.UnsignedInt?u+=" let val = u32(col0);":r.componentType===I.Bool?u+=" let val = col0 >= 0.5;":u+=" let val = col0;";break;case o.Mat4:u+=` let val = fetchMat4(vec4_idx);
130
- `;break;case o.Mat4Array:u+=` let val = fetchMat4(vec4_idx);
131
- `;break;case o.Mat3:u+=` let val = fetchMat3(vec4_idx);
132
- `;break;case o.Mat3Array:u+=` let val = fetchMat3No16BytesAligned(scalar_idx);
133
- `;break;case o.Mat2:u+=` let val = fetchMat2(vec4_idx);
134
- `;break;case o.Mat2Array:u+=` let val = fetchMat2No16BytesAligned(scalar_idx);
135
- `;break;case o.Mat4x3Array:u+=` let val = fetchMat4x3(vec4_idx);
136
- `;break;default:u+=""}return u+=`
137
- return val;
138
- }
139
- `,u}static getOffsetOfPropertyOfMaterial(t,e,r){return t.materialRepository.getLocationOffsetOfMemberOfMaterial(t,r,e)}static getOffsetOfPropertyOfGlobalDataRepository(t,e){return t.globalDataRepository.getLocationOffsetOfProperty(e)}$load(t){let e=t.mesh;return e==null?!1:(e.isSetUpDone()||e._updateVBOAndVAO(),!0)}common_$load(){this.D_()}D_(){let t=b.getMorphUniformDataOffsets(),e=Math.max(Math.ceil(t[t.length-1]/4)*4*4,4);if(e!==this.LI){let i=this.i.webGpuResourceRepository;if(this.gI!==d.InvalidCGAPIResourceUid&&(i.flush(),i.clearCache(),i.deleteUniformBuffer(this.gI),this.gI=d.InvalidCGAPIResourceUid),this.LI=e,this.gI===d.InvalidCGAPIResourceUid){let a=new Uint32Array(e);this.wI=a,this.gI=i.createUniformMorphOffsetsBuffer(e*4),this.AB()}this.LI=e}let r=B._getMorphWeightsUniformBufferFloatCount(this.i);if(r!==this.QI){let i=this.i.webGpuResourceRepository;if(this.yI!==d.InvalidCGAPIResourceUid&&(i.flush(),i.clearCache(),i.deleteUniformBuffer(this.yI),this.yI=d.InvalidCGAPIResourceUid),this.yI===d.InvalidCGAPIResourceUid){let a=new Float32Array(r);this.II=a,this.yI=i.createUniformMorphWeightsBuffer(r*4),this.XS(!0)}this.QI=r}}kB(t){if(t.mesh==null){W.alertNoMeshSet(t);return}let e=t.mesh.getPrimitiveNumber();for(let r=0;r<e;r++){let i=t.mesh.getPrimitiveAt(r),a=i.material;this._setupShaderProgram(a,i)}}_setupShaderProgram(t,e){if(t!=null&&!t.isShaderProgramReady(e))try{this.setupShaderForMaterial(t,e,g.getVertexShaderMethodDefinitions_storageBuffer(this.i,R.VertexShader),g.getVertexShaderMethodDefinitions_storageBuffer(this.i,R.PixelShader),g.A_,g.B_,g.C_(this.i)),e._backupMaterial()}catch(r){G.default.error(r),e._restoreMaterial(),this.setupShaderForMaterial(e.material,e,g.getVertexShaderMethodDefinitions_storageBuffer(this.i,R.VertexShader),g.getVertexShaderMethodDefinitions_storageBuffer(this.i,R.PixelShader),g.A_,g.B_,g.C_(this.i))}}setupShaderForMaterial(t,e,r,i,a,c,n){t._createProgramWebGpu(this.i,e,r,i,a,c,n)}prerender(){if(E.getIsAnimating(this.i)||D.getUpdateCount(this.i)!==this.nr||V.getUpdateCount(this.i)!==this.qI||$.getCurrentCameraUpdateCount(this.i)!==this.dC||T(this.i)!==this.sr||this.i.materialRepository.stateVersion!==this.XI||this.i.lightClusterSystem.dataVersion!==this.YI||U.getUpdateCount(this.i)!==this.or||this.i._gpuInstanceDataVersion!==this.ZI){let e=this.$B();this.i.webGpuResourceRepository._markGpuCullingInputsDirty();let r=this.i.lightClusterSystem.dataVersion;(e||r!==this.MB)&&(this.VB(),this.MB=r),this.nr=D.getUpdateCount(this.i),this.qI=V.getUpdateCount(this.i),this.dC=$.getCurrentCameraUpdateCount(this.i),this.sr=T(this.i),this.XI=this.i.materialRepository.stateVersion,this.YI=this.i.lightClusterSystem.dataVersion,this.or=U.getUpdateCount(this.i),this.ZI=this.i._gpuInstanceDataVersion}let t=b.getPrimitiveCountHasMorph();t!==this.jI&&(this.DB(),this.jI=t,this.i.webGpuResourceRepository._markGpuCullingInputsDirty()),B.updateCount!==this.HI||B.getCountOfBlendShapeComponents(this.i)!==this.LS?(this.XS(),this.i.webGpuResourceRepository._markGpuCullingInputsDirty(),this.HI=B.updateCount,this.LS=B.getCountOfBlendShapeComponents(this.i),this.i.materialRepository._makeShaderInvalidateToMorphMaterials()):this.V_()}common_$render(t,e,r,i){if(e.isBufferLessRenderingMode())return this.$_(e),!0;let a=!1,c=e.isDepthTest&&e.depthWriteMask,n=this.wB(e);if(n)for(let s=e._lastOpaqueIndex;s>=0;s--)this.renderInner(t[s],e,!0,i,{depthOnly:!0});if(e._toRenderOpaquePrimitives)for(let s=e._lastOpaqueIndex;s>=0;s--){let l=t[s],p=this.renderInner(l,e,c,i,{allowEqualDepth:n});a||(a=p)}if(e._toRenderTranslucentPrimitives)for(let s=e._lastOpaqueIndex+1;s<=e._lastTranslucentIndex;s++){let l=t[s],p=this.renderInner(l,e,c,i);a||(a=p)}if(e._toRenderBlendWithZWritePrimitives)for(let s=e._lastTranslucentIndex+1;s<=e._lastBlendWithZWriteIndex;s++){let l=t[s],p=this.renderInner(l,e,c,i);a||(a=p)}if(e._toRenderBlendWithoutZWritePrimitives)for(let s=e._lastBlendWithZWriteIndex+1;s<=e._lastBlendWithoutZWriteIndex;s++){let l=t[s],p=this.renderInner(l,e,!1,i);a||(a=p)}return a}$_(t){let e=t.material,r=t._dummyPrimitiveForBufferLessRendering;this._setupShaderProgram(e,r);let i=this.i.webGpuResourceRepository,a=this._B(t,0,!1);i.setDrawParameters(e.materialSID,a,0,0);let c=t.isDepthTest&&t.depthWriteMask;i.draw(this.i,r,e,t,a,c,0)}wB(t){let e=t.getFramebuffer();return this.i.config.isDepthPrepassEnabled&&t.material==null&&t.isDepthTest&&t.depthWriteMask&&(e==null||e.depthAttachment!=null)&&t._toRenderOpaquePrimitives&&t._lastOpaqueIndex>=0}renderInner(t,e,r,i,a={}){var f,m;if(t===-1)return!1;let c=b.getPrimitive(t);if(c==null)return!1;let n=e.getAppropriateMaterial(c);if(this._setupShaderProgram(n,c),F(n,c)||a.depthOnly&&(n.alphaMode===N.Mask||n.alphaToCoverage||n.isShaderDefine("RN_USE_WIREFRAME")))return!1;let s=this.i.webGpuResourceRepository,l=this.i._webXRSystemIfEnabled,p=this._B(e,i,((f=l==null?void 0:l.isWebXRMode)!=null?f:!1)&&e.isVrRendering),h=(m=b.getPrimitiveIdxHasMorph(c.primitiveUid))!=null?m:0;return s.setDrawParameters(n.materialSID,p,h,c.targets.length),s.draw(this.i,c,n,e,p,r,i,a),!0}$B(){let e=this.i.memoryManager.getBuffers(C.GPUInstanceData),r=e.length,i=this.i.webGpuResourceRepository;if(r!==this.JI&&(this.JI=r,i.destroyStorageBuffer(this.IB),this.IB=d.InvalidCGAPIResourceUid),this.IB!==d.InvalidCGAPIResourceUid){let a=this.i.lightClusterSystem;i.updateStorageBuffer(this.IB,e,a._getExcludedByteRanges());let c=a._takeDirtyByteRanges();return c.length>0&&i.updateStorageBufferRanges(this.IB,e,c),!1}return this.IB=i.createStorageBuffer(e),this.i.lightClusterSystem._takeDirtyByteRanges(),!0}VB(){var a,c;let t=this.i.lightClusterSystem._getGpuBuildParams();if(t==null)return;let e=this.i.webGpuResourceRepository,r=e._getStorageBuffer();if(r==null)return;(c=this[a="BB"])!=null||(this[a]=new z(e.getWebGpuDeviceWrapper().gpuDevice));let i=this.i.gpuTimerEnabled?e._getGpuTimer():void 0;this.BB.build(r,t,i)}DB(){let e=this.i.memoryManager.getBuffers(C.GPUVertexData);if(e.length===0)return;let r=e.reduce((n,s)=>n+s.byteLength,0);r!==this.OB&&(this.i.webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.SB),this.SB=d.InvalidCGAPIResourceUid,this.OB=r);let i=this.i.webGpuResourceRepository,a=new Float32Array(r/4),c=0;for(let n=0;n<e.length;n++){let s=e[n];a.set(new Float32Array(s.getArrayBuffer()),c),c+=s.byteLength/4}if(this.SB!==d.InvalidCGAPIResourceUid){let n=r/4;i.updateStorageBlendShapeBuffer(this.SB,a,n)}else this.SB=i.createStorageBlendShapeBuffer(a);this.AB()}AB(){let t=this.i.webGpuResourceRepository,e=b.getMorphUniformDataOffsets();for(let i=0;i<b.getPrimitiveCountHasMorph();i++){let a=b.getPrimitiveHasMorph(i);if(a!=null)for(let c=0;c<a.targets.length;c++){let s=a.targets[c].get(L.Position.XYZ),l=this.i.memoryManager.getByteOffsetOfExistingBuffers(C.GPUVertexData,s.bufferView.buffer.indexOfTheBufferUsage);this.wI[e[i]+c]=(l+s.byteOffsetInBuffer)/4/4}else break}let r=e[e.length-1];t.updateUniformMorphOffsetsBuffer(this.wI,r)}XS(t=!1){let r=this.i.memoryManager.getBuffer(C.GPUVertexData);if(r==null||r.takenSizeInByte===0)return;let i=B._writeMorphWeightsUniformArray(this.i,this.II,t);this.VI=!1,i>0&&this.YS(i)}YS(t){this.i.webGpuResourceRepository.updateUniformMorphWeightsBuffer(this.II,t)}V_(){if(this.VI||this.II==null)return;this.VI=!0;let t=B._settlePreviousMorphWeights(this.i,this.II);t>0&&this.YS(t)}_B(t,e,r){if(r){let a=this.i._webXRSystemIfEnabled,c=-1;return a!=null&&a.isWebXRMode&&(a.isMultiView()?c=a._getCameraComponentSIDAt(0):c=a._getCameraComponentSIDAt(e)),c}let i=t.cameraComponent;return i==null&&(i=this.i.componentRepository.getComponent($,$.getCurrent(this.i))),i?i.componentSID:-1}destroy(){var e;let t=this.i.webGpuResourceRepository;(e=this.BB)==null||e.destroy(),this.BB=void 0,t._destroyGpuCulling(),this.IB!==d.InvalidCGAPIResourceUid&&(t.destroyStorageBuffer(this.IB),this.IB=d.InvalidCGAPIResourceUid),this.SB!==d.InvalidCGAPIResourceUid&&(t.deleteStorageBlendShapeBuffer(this.SB),this.SB=d.InvalidCGAPIResourceUid),this.gI!==d.InvalidCGAPIResourceUid&&(t.deleteUniformBuffer(this.gI),this.gI=d.InvalidCGAPIResourceUid),this.yI!==d.InvalidCGAPIResourceUid&&(t.deleteUniformBuffer(this.yI),this.yI=d.InvalidCGAPIResourceUid)}};export{k as WebGpuStrategyBasic};
1
+ import{AnimationComponent as W}from"../foundation/components/Animation/AnimationComponent.js";import{BlendShapeComponent as m}from"../foundation/components/BlendShape/BlendShapeComponent.js";import{CameraComponent as l}from"../foundation/components/Camera/CameraComponent.js";import{_getCameraControllerUpdateCount as C}from"../foundation/components/CameraController/CameraControllerUpdateCount.js";import{LightComponent as S}from"../foundation/components/Light/LightComponent.js";import{MeshComponent as G}from"../foundation/components/Mesh/MeshComponent.js";import{SceneGraphComponent as R}from"../foundation/components/SceneGraph/SceneGraphComponent.js";import{TransformComponent as y}from"../foundation/components/Transform/TransformComponent.js";import{AlphaMode as U}from"../foundation/definitions/AlphaMode.js";import{ShaderType as f}from"../foundation/definitions/ShaderType.js";import{Primitive as d}from"../foundation/geometry/Primitive.js";import{Logger as w}from"../foundation/misc/Logger.js";import{isSkipDrawing as B}from"../foundation/renderer/RenderingCommonMethods.js";import{getWgslGlobalPropertyAccessor as M,getWgslMaterialPropertyAccessor as _}from"./ShaderPropertyAccessorWGSL.js";import{_createWebGpuShaderProgram as O}from"./WebGpuShaderProgramBuilder.js";import{WebGpuStrategyStorage as V}from"./WebGpuStrategyStorage.js";import{getMorphedPositionGetter as v,getVertexShaderMethodDefinitions_storageBuffer as u}from"./WebGpuVertexShaderDefinitions.js";var I=class b{constructor(e){this.RW=-1;this.WW=-1;this.or=-1;this.GW=-1;this.nr=-1;this.SW=-1;this.GC=-1;this.sr=-1;this.GI=-1;this.WI=-1;this.NI=-1;this.i=e,this.WM=new V(e)}static init(e){return new b(e)}static getVertexShaderMethodDefinitions_storageBuffer(e,t){return u(e,t)}$load(e){let t=e.mesh;return t==null?!1:(t.isSetUpDone()||t._updateVBOAndVAO(),!0)}common_$load(){this.WM.initMorphUniformBuffers()}ZM(e){if(e.mesh==null){G.alertNoMeshSet(e);return}let t=e.mesh.getPrimitiveNumber();for(let n=0;n<t;n++){let o=e.mesh.getPrimitiveAt(n),r=o.material;this._setupShaderProgram(r,o)}}_setupShaderProgram(e,t){if(e!=null&&!e.isShaderProgramReady(t))try{this.setupShaderForMaterial(e,t,u(this.i,f.VertexShader),u(this.i,f.PixelShader),M,_,v(this.i)),t._backupMaterial()}catch(n){w.default.error(n),t._restoreMaterial(),this.setupShaderForMaterial(t.material,t,u(this.i,f.VertexShader),u(this.i,f.PixelShader),M,_,v(this.i))}}setupShaderForMaterial(e,t,n,o,r,a,s){let i=O(this.i,e,t,n,o,r,a,s);e._registerShaderProgram(t,i)}prerender(){if(W.getIsAnimating(this.i)||y.getUpdateCount(this.i)!==this.nr||R.getUpdateCount(this.i)!==this.SW||l.getCurrentCameraUpdateCount(this.i)!==this.GC||C(this.i)!==this.sr||this.i.materialRepository.stateVersion!==this.RW||this.i.lightClusterSystem.dataVersion!==this.WW||S.getUpdateCount(this.i)!==this.or||this.i._gpuInstanceDataVersion!==this.GW){let t=this.WM.createAndUpdateStorageBuffer();this.i.webGpuResourceRepository._markGpuCullingInputsDirty();let n=this.i.lightClusterSystem.dataVersion;this.WM.updateLightClusters(n,t),this.nr=y.getUpdateCount(this.i),this.SW=R.getUpdateCount(this.i),this.GC=l.getCurrentCameraUpdateCount(this.i),this.sr=C(this.i),this.RW=this.i.materialRepository.stateVersion,this.WW=this.i.lightClusterSystem.dataVersion,this.or=S.getUpdateCount(this.i),this.GW=this.i._gpuInstanceDataVersion}let e=d.getPrimitiveCountHasMorph();e!==this.WI&&(this.WM.createOrUpdateStorageBlendShapeBuffer(),this.WI=e,this.i.webGpuResourceRepository._markGpuCullingInputsDirty()),m.updateCount!==this.GI||m.getCountOfBlendShapeComponents(this.i)!==this.NI?(this.WM.updateMorphWeightsUniformBuffer(),this.i.webGpuResourceRepository._markGpuCullingInputsDirty(),this.GI=m.updateCount,this.NI=m.getCountOfBlendShapeComponents(this.i),this.i.materialRepository._makeShaderInvalidateToMorphMaterials()):this.WM.settlePreviousMorphWeights()}common_$render(e,t,n,o){if(t.isBufferLessRenderingMode())return this.VM(t,o),!0;let r=!1,a=t.isDepthTest&&t.depthWriteMask,s=this.qM(t);if(s)for(let i=t._lastOpaqueIndex;i>=0;i--)this.renderInner(e[i],t,!0,o,{depthOnly:!0});if(t._toRenderOpaquePrimitives)for(let i=t._lastOpaqueIndex;i>=0;i--){let p=e[i],h=this.renderInner(p,t,a,o,{allowEqualDepth:s});r||(r=h)}if(t._toRenderTranslucentPrimitives)for(let i=t._lastOpaqueIndex+1;i<=t._lastTranslucentIndex;i++){let p=e[i],h=this.renderInner(p,t,a,o);r||(r=h)}if(t._toRenderBlendWithZWritePrimitives)for(let i=t._lastTranslucentIndex+1;i<=t._lastBlendWithZWriteIndex;i++){let p=e[i],h=this.renderInner(p,t,a,o);r||(r=h)}if(t._toRenderBlendWithoutZWritePrimitives)for(let i=t._lastBlendWithZWriteIndex+1;i<=t._lastBlendWithoutZWriteIndex;i++){let p=e[i],h=this.renderInner(p,t,!1,o);r||(r=h)}return r}VM(e,t){var h;let n=e.material,o=e._dummyPrimitiveForBufferLessRendering;this._setupShaderProgram(n,o);let r=this.i.webGpuResourceRepository,a=this.i._webXRSystemIfEnabled,s=((h=a==null?void 0:a.isWebXRMode)!=null?h:!1)&&e.isVrRendering,i=this.OM(e,t,s);r.setDrawParameters(n.materialSID,i,0,0);let p=e.isDepthTest&&e.depthWriteMask;r.draw(this.i,o,n,e,i,p,t)}qM(e){let t=e.getFramebuffer();return this.i.config.isDepthPrepassEnabled&&e.material==null&&e.isDepthTest&&e.depthWriteMask&&(t==null||t.depthAttachment!=null)&&e._toRenderOpaquePrimitives&&e._lastOpaqueIndex>=0}renderInner(e,t,n,o,r={}){var g,c;if(e===-1)return!1;let a=d.getPrimitive(e);if(a==null)return!1;let s=t.getAppropriateMaterial(a);if(this._setupShaderProgram(s,a),B(s,a)||r.depthOnly&&(s.alphaMode===U.Mask||s.alphaToCoverage||s.isShaderDefine("RN_USE_WIREFRAME")))return!1;let i=this.i.webGpuResourceRepository,p=this.i._webXRSystemIfEnabled,h=this.OM(t,o,((g=p==null?void 0:p.isWebXRMode)!=null?g:!1)&&t.isVrRendering),D=(c=d.getPrimitiveIdxHasMorph(a.primitiveUid))!=null?c:0;return i.setDrawParameters(s.materialSID,h,D,a.targets.length),i.draw(this.i,a,s,t,h,n,o,r),!0}OM(e,t,n){if(n){let r=this.i._webXRSystemIfEnabled,a=-1;return r!=null&&r.isWebXRMode&&(r.isMultiView()?a=r._getCameraComponentSIDAt(0):a=r._getCameraComponentSIDAt(t)),a}let o=e.cameraComponent;return o==null&&(o=this.i.componentRepository.getComponent(l,l.getCurrent(this.i))),o?o.componentSID:-1}destroy(){this.WM.destroy(),this.i.webGpuResourceRepository._destroyGpuCulling()}};export{I as WebGpuStrategyBasic};
@@ -0,0 +1,62 @@
1
+ import type { Engine } from '../foundation/system/Engine';
2
+ /**
3
+ * Uploads the per-frame storage buffers of the WebGPU strategy: the GPU instance data (with the light
4
+ * clusters built on the GPU), the blend shape data and the morph target offsets and weights.
5
+ *
6
+ * Owned by `WebGpuStrategyBasic`, which calls it from common_$load, prerender and destroy.
7
+ */
8
+ export declare class WebGpuStrategyStorage {
9
+ private __engine;
10
+ private __storageBufferUid;
11
+ private __storageBlendShapeBufferUid;
12
+ private __uniformMorphOffsetsTypedArray?;
13
+ private __uniformMorphWeightsTypedArray?;
14
+ private __isPreviousMorphWeightsSettled;
15
+ private __lightClusterBuilder?;
16
+ private __lastLightClusterBuildDataVersion;
17
+ private __lastGpuInstanceDataBufferCount;
18
+ private __lastMorphOffsetsUniformDataSize;
19
+ private __lastMorphWeightsUniformDataSize;
20
+ private __morphOffsetsUniformBufferUid;
21
+ private __morphWeightsUniformBufferUid;
22
+ private __storageBlendShapeBufferByteLength;
23
+ constructor(engine: Engine);
24
+ /**
25
+ * Rebuilds the light clusters when their inputs changed, or after a new storage buffer was created
26
+ * from the CPU data (which does not contain the clusters built on the GPU).
27
+ */
28
+ updateLightClusters(lightClusterDataVersion: number, wasStorageBufferRecreated: boolean): void;
29
+ /**
30
+ * Destroys the storage buffers and the light cluster builder.
31
+ */
32
+ destroy(): void;
33
+ initMorphUniformBuffers(): void;
34
+ /**
35
+ * Creates or updates the main storage buffer containing all GPU instance data.
36
+ * This buffer holds transform matrices, material properties, and other per-instance data
37
+ * required for rendering all objects in the scene.
38
+ */
39
+ createAndUpdateStorageBuffer(): boolean;
40
+ /**
41
+ * Builds the Clustered Forward light cluster tables with compute shaders when the LightClusterSystem
42
+ * builds them on the GPU. It must run after every upload of the GPU instance data, which overwrites the tables.
43
+ */
44
+ private __buildLightClustersOnGpu;
45
+ /**
46
+ * Creates or updates the storage buffer containing blend shape vertex data.
47
+ * This buffer holds morph target positions and other vertex attributes needed for blend shape animation.
48
+ */
49
+ createOrUpdateStorageBlendShapeBuffer(): void;
50
+ private __updateMorphOffsetsUniformBuffer;
51
+ /**
52
+ * Updates uniform buffers containing morph target weights for blend shape animation.
53
+ * Copies weight values from blend shape components to GPU-accessible uniform buffers.
54
+ */
55
+ updateMorphWeightsUniformBuffer(isNewBuffer?: boolean): void;
56
+ private __uploadMorphWeights;
57
+ /**
58
+ * Makes the weights of the previous frame in the morph weights uniform buffer equal to the current weights once
59
+ * the weights stopped changing (temporal anti-aliasing only).
60
+ */
61
+ settlePreviousMorphWeights(): void;
62
+ }
@@ -0,0 +1 @@
1
+ import{BlendShapeComponent as p}from"../foundation/components/BlendShape/BlendShapeComponent.js";import{BufferUse as u}from"../foundation/definitions/BufferUse.js";import{VertexAttribute as d}from"../foundation/definitions/VertexAttribute.js";import{Primitive as h}from"../foundation/geometry/Primitive.js";import{CGAPIResourceRepository as s}from"../foundation/renderer/CGAPIResourceRepository.js";import{WebGpuLightClusterBuilder as m}from"./WebGpuLightClusterBuilder.js";var c=class{constructor(r){this.IU=s.InvalidCGAPIResourceUid;this.MU=s.InvalidCGAPIResourceUid;this.BI=!0;this.EU=-1;this.uB=-1;this.OI=-1;this.EI=-1;this.PI=-1;this.SI=-1;this.LU=-1;this.i=r}updateLightClusters(r,e){(e||r!==this.EU)&&(this.NU(),this.EU=r)}destroy(){var e;let r=this.i.webGpuResourceRepository;(e=this._U)==null||e.destroy(),this._U=void 0,this.IU!==s.InvalidCGAPIResourceUid&&(r.destroyStorageBuffer(this.IU),this.IU=s.InvalidCGAPIResourceUid),this.MU!==s.InvalidCGAPIResourceUid&&(r.deleteStorageBlendShapeBuffer(this.MU),this.MU=s.InvalidCGAPIResourceUid),this.PI!==s.InvalidCGAPIResourceUid&&(r.deleteUniformBuffer(this.PI),this.PI=s.InvalidCGAPIResourceUid),this.SI!==s.InvalidCGAPIResourceUid&&(r.deleteUniformBuffer(this.SI),this.SI=s.InvalidCGAPIResourceUid)}initMorphUniformBuffers(){let r=h.getMorphUniformDataOffsets(),e=Math.max(Math.ceil(r[r.length-1]/4)*4*4,4);if(e!==this.OI){let t=this.i.webGpuResourceRepository;if(this.PI!==s.InvalidCGAPIResourceUid&&(t.flush(),t.clearCache(),t.deleteUniformBuffer(this.PI),this.PI=s.InvalidCGAPIResourceUid),this.OI=e,this.PI===s.InvalidCGAPIResourceUid){let o=new Uint32Array(e);this.CI=o,this.PI=t.createUniformMorphOffsetsBuffer(e*4),this.VU()}this.OI=e}let i=p._getMorphWeightsUniformBufferFloatCount(this.i);if(i!==this.EI){let t=this.i.webGpuResourceRepository;if(this.SI!==s.InvalidCGAPIResourceUid&&(t.flush(),t.clearCache(),t.deleteUniformBuffer(this.SI),this.SI=s.InvalidCGAPIResourceUid),this.SI===s.InvalidCGAPIResourceUid){let o=new Float32Array(i);this.MI=o,this.SI=t.createUniformMorphWeightsBuffer(i*4),this.updateMorphWeightsUniformBuffer(!0)}this.EI=i}}createAndUpdateStorageBuffer(){let e=this.i.memoryManager.getBuffers(u.GPUInstanceData),i=e.length,t=this.i.webGpuResourceRepository;if(i!==this.uB&&(this.uB=i,t.destroyStorageBuffer(this.IU),this.IU=s.InvalidCGAPIResourceUid),this.IU!==s.InvalidCGAPIResourceUid){let o=this.i.lightClusterSystem;t.updateStorageBuffer(this.IU,e,o._getExcludedByteRanges());let f=o._takeDirtyByteRanges();return f.length>0&&t.updateStorageBufferRanges(this.IU,e,f),!1}return this.IU=t.createStorageBuffer(e),this.i.lightClusterSystem._takeDirtyByteRanges(),!0}NU(){var o,f;let r=this.i.lightClusterSystem._getGpuBuildParams();if(r==null)return;let e=this.i.webGpuResourceRepository,i=e._getStorageBuffer();if(i==null)return;(f=this[o="_U"])!=null||(this[o]=new m(e.getWebGpuDeviceWrapper().gpuDevice));let t=this.i.gpuTimerEnabled?e._getGpuTimer():void 0;this._U.build(i,r,t)}createOrUpdateStorageBlendShapeBuffer(){let e=this.i.memoryManager.getBuffers(u.GPUVertexData);if(e.length===0)return;let i=e.reduce((a,n)=>a+n.byteLength,0);i!==this.LU&&(this.i.webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.MU),this.MU=s.InvalidCGAPIResourceUid,this.LU=i);let t=this.i.webGpuResourceRepository,o=new Float32Array(i/4),f=0;for(let a=0;a<e.length;a++){let n=e[a];o.set(new Float32Array(n.getArrayBuffer()),f),f+=n.byteLength/4}if(this.MU!==s.InvalidCGAPIResourceUid){let a=i/4;t.updateStorageBlendShapeBuffer(this.MU,o,a)}else this.MU=t.createStorageBlendShapeBuffer(o);this.VU()}VU(){let r=this.i.webGpuResourceRepository,e=h.getMorphUniformDataOffsets();for(let t=0;t<h.getPrimitiveCountHasMorph();t++){let o=h.getPrimitiveHasMorph(t);if(o!=null)for(let f=0;f<o.targets.length;f++){let n=o.targets[f].get(d.Position.XYZ),l=this.i.memoryManager.getByteOffsetOfExistingBuffers(u.GPUVertexData,n.bufferView.buffer.indexOfTheBufferUsage);this.CI[e[t]+f]=(l+n.byteOffsetInBuffer)/4/4}else break}let i=e[e.length-1];r.updateUniformMorphOffsetsBuffer(this.CI,i)}updateMorphWeightsUniformBuffer(r=!1){let i=this.i.memoryManager.getBuffer(u.GPUVertexData);if(i==null||i.takenSizeInByte===0)return;let t=p._writeMorphWeightsUniformArray(this.i,this.MI,r);this.BI=!1,t>0&&this.HI(t)}HI(r){this.i.webGpuResourceRepository.updateUniformMorphWeightsBuffer(this.MI,r)}settlePreviousMorphWeights(){if(this.BI||this.MI==null)return;this.BI=!0;let r=p._settlePreviousMorphWeights(this.i,this.MI);r>0&&this.HI(r)}};export{c as WebGpuStrategyStorage};
@@ -0,0 +1,111 @@
1
+ import type { WebGPUResourceHandle } from '../types/CommonTypes';
2
+ import type { WebGpuDeviceWrapper } from './WebGpuDeviceWrapper';
3
+ import type { WebGpuResource } from './WebGpuResourceRepository';
4
+ /**
5
+ * What `WebGpuTextureReadback` needs from the resource repository that owns it.
6
+ */
7
+ export interface WebGpuTextureReadbackResources {
8
+ /** The device wrapper, which is set when the repository is given a device. */
9
+ getDeviceWrapper(): WebGpuDeviceWrapper | undefined;
10
+ /** Returns the WebGPU object of a resource handle. */
11
+ getResource(handle: WebGPUResourceHandle): WebGpuResource | undefined;
12
+ /** Whether the texture was created as a render target, which the engine renders into with row 0 at the top. */
13
+ isRenderTarget(texture: GPUTexture): boolean;
14
+ }
15
+ /** How `copyRgba8TextureToCpu` reads the rows. */
16
+ export interface RowReadOptions {
17
+ /** The first texel row to read (row 0 is the first row of the texture). */
18
+ originY?: number;
19
+ /** Return the last row read first. */
20
+ bottomRowFirst?: boolean;
21
+ }
22
+ /**
23
+ * Copies `height` rows of an rgba8unorm (or rgba8unorm-srgb) texture, starting at row `originY`, into a mapped
24
+ * buffer and returns them tightly packed.
25
+ *
26
+ * The rows are copied at the 256-byte aligned `bytesPerRow` WebGPU requires, and the padding is removed afterwards.
27
+ * The texture needs COPY_SRC usage. The commands recorded in `commandEncoder` are submitted with the copy.
28
+ *
29
+ * @param gpuDevice - The device
30
+ * @param commandEncoder - The encoder to record the copy into; it is finished and submitted here
31
+ * @param texture - The texture to read
32
+ * @param width - Width of the region to read
33
+ * @param height - Height of the region to read
34
+ * @param options - The first row to read and the order of the returned rows
35
+ * @returns The texels, `width * 4` bytes per row
36
+ */
37
+ export declare function copyRgba8TextureToCpu(gpuDevice: GPUDevice, commandEncoder: GPUCommandEncoder, texture: GPUTexture, width: number, height: number, { originY, bottomRowFirst }?: RowReadOptions): Promise<Uint8Array>;
38
+ /**
39
+ * Draws a full-screen triangle strip into a temporary rgba8unorm texture and reads the texture back.
40
+ *
41
+ * `shaderCode` must have the entry points `vertexMain` (drawn with 4 vertices as a triangle strip) and
42
+ * `fragmentMain` (one rgba8unorm target), and its bind group 0 gets `bindGroupEntries`. Reading a texture through a
43
+ * draw works for textures without COPY_SRC usage, and converts any color format into rgba8unorm.
44
+ *
45
+ * @param gpuDevice - The device
46
+ * @param shaderCode - WGSL of the vertex and fragment shader
47
+ * @param width - Width of the image to draw and read
48
+ * @param height - Height of the image to draw and read
49
+ * @param bindGroupEntries - The entries of bind group 0
50
+ * @param bottomRowFirst - Return the last row of the drawn image (the bottom of the framebuffer) first
51
+ * @returns The drawn texels, `width * 4` bytes per row
52
+ */
53
+ export declare function drawRgba8AndReadBack(gpuDevice: GPUDevice, shaderCode: string, width: number, height: number, bindGroupEntries: GPUBindGroupEntry[], bottomRowFirst?: boolean): Promise<Uint8Array>;
54
+ /**
55
+ * Reads the pixels of 2D textures of the WebGPU backend back to the CPU.
56
+ *
57
+ * The rows come back in the order of the WebGL backend. The engine renders into a WebGPU render target with row 0 at
58
+ * the top of the image, and into a WebGL one with row 0 at the bottom (readPixels returns the bottom row first). So
59
+ * a render target is read bottom row first, and `y` counts from its bottom row. Other textures are read from texel
60
+ * row 0 (the first row of the uploaded image or data), as on WebGL.
61
+ *
62
+ * Owned by `WebGpuResourceRepository`, which exposes these operations through its public methods.
63
+ */
64
+ export declare class WebGpuTextureReadback {
65
+ private __resources;
66
+ constructor(resources: WebGpuTextureReadbackResources);
67
+ private get __webGpuDeviceWrapper();
68
+ private __getResource;
69
+ /**
70
+ * Converts a region given in the row order of the WebGL backend into texel rows of the texture.
71
+ *
72
+ * @param texture - The texture to read
73
+ * @param y - Y offset of the region: from the bottom row of a render target, from texel row 0 otherwise
74
+ * @param height - Height of the region
75
+ * @returns The first texel row to read and whether the rows must be returned in reverse order
76
+ */
77
+ private __rowsToRead;
78
+ /**
79
+ * Reads the pixels of a texture (typically a render target) as RGBA8.
80
+ *
81
+ * rgba8unorm and rgba8unorm-srgb textures with COPY_SRC usage are copied as they are stored. Other color formats
82
+ * are converted to rgba8unorm through a draw, so floating-point values are clamped to [0, 1]. Reads the region at
83
+ * (0, 0) in the row order of the WebGL backend (see the class description).
84
+ *
85
+ * @param textureHandle - Handle to the texture resource
86
+ * @param width - Width of the texture region to read
87
+ * @param height - Height of the texture region to read
88
+ * @param _frameBufferUid - Not used by WebGPU
89
+ * @param _colorAttachmentIndex - Not used by WebGPU
90
+ * @returns Promise that resolves to the pixel data, `width * 4` bytes per row, starting from the bottom row for a
91
+ * render target
92
+ */
93
+ getTexturePixelData(textureHandle: WebGPUResourceHandle, width: number, height: number, _frameBufferUid: WebGPUResourceHandle, _colorAttachmentIndex: number): Promise<Uint8Array>;
94
+ /**
95
+ * Reads a region of mip level 0 of a 2D texture as RGBA8.
96
+ *
97
+ * The texels are copied through a draw into a temporary rgba8unorm texture, so the source texture does not need
98
+ * COPY_SRC usage and any color format can be read; floating-point values are clamped to [0, 1]. Texels outside the
99
+ * texture are returned as zero. The rows come in the order of the WebGL backend (see the class description).
100
+ *
101
+ * @param textureHandle - Handle to the texture to read from
102
+ * @param x - X offset of the region, in texels from the left
103
+ * @param y - Y offset of the region, in texels from the bottom row of a render target, or from texel row 0 of
104
+ * another texture
105
+ * @param width - Width of the region to read
106
+ * @param height - Height of the region to read
107
+ * @returns Promise resolving to the pixel data, `width * 4` bytes per row, starting from the bottom row for a
108
+ * render target
109
+ */
110
+ getPixelDataFromTextureAsync(textureHandle: WebGPUResourceHandle, x: number, y: number, width: number, height: number): Promise<Uint8Array>;
111
+ }
@@ -0,0 +1 @@
1
+ import{alignBytesPerRow as f,removeRowPadding as R}from"./removeRowPadding.js";import{COPY_REGION_SHADER as l}from"./WebGpuTextureReadbackShaders.js";var P=4;async function b(t,r,a,n,i,{originY:c=0,bottomRowFirst:e=!1}={}){let s=n*P,o=f(s),u=t.createBuffer({size:o*i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});r.copyTextureToBuffer({texture:a,origin:{x:0,y:c}},{buffer:u,bytesPerRow:o},{width:n,height:i,depthOrArrayLayers:1}),t.queue.submit([r.finish()]);try{await u.mapAsync(GPUMapMode.READ);let p=R(new Uint8Array(u.getMappedRange()),s,i,o,e);return u.unmap(),p}finally{u.destroy()}}async function g(t,r,a,n,i,c=!1){let e=t.createShaderModule({code:r}),s=t.createRenderPipeline({layout:"auto",vertex:{module:e,entryPoint:"vertexMain"},fragment:{module:e,entryPoint:"fragmentMain",targets:[{format:"rgba8unorm"}]},primitive:{topology:"triangle-strip"}}),o=t.createTexture({size:[a,n],format:"rgba8unorm",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC});try{let u=t.createBindGroup({layout:s.getBindGroupLayout(0),entries:i}),p=t.createCommandEncoder(),d=p.beginRenderPass({colorAttachments:[{view:o.createView(),clearValue:{r:0,g:0,b:0,a:1},loadOp:"clear",storeOp:"store"}]});return d.setPipeline(s),d.setBindGroup(0,u),d.draw(4),d.end(),await b(t,p,o,a,n,{bottomRowFirst:c})}finally{o.destroy()}}function y(t){return!(t.startsWith("depth")||t.startsWith("stencil")||t.includes("uint")||t.includes("sint"))}var m=class{constructor(r){this.x_=r}get yG(){return this.x_.getDeviceWrapper()}KG(r){return this.x_.getResource(r)}YU(r,a,n){return this.x_.isRenderTarget(r)?{originY:r.height-a-n,bottomRowFirst:!0}:{originY:a,bottomRowFirst:!1}}async getTexturePixelData(r,a,n,i,c){let e=this.KG(r);if(!e||a<=0||n<=0)return new Uint8Array(0);let s=e.format==="rgba8unorm"||e.format==="rgba8unorm-srgb",o=this.YU(e,0,n);if(!s||(e.usage&GPUTextureUsage.COPY_SRC)===0||o.originY<0)return this.getPixelDataFromTextureAsync(r,0,0,a,n);let u=this.yG.gpuDevice;return b(u,u.createCommandEncoder(),e,a,n,o)}async getPixelDataFromTextureAsync(r,a,n,i,c){let e=this.KG(r);if(!e||i<=0||c<=0)return new Uint8Array(0);if(!y(e.format))throw new Error(`WebGpuTextureReadback: cannot read back a texture of the ${e.format} format.`);let s=this.yG.gpuDevice,o=s.createBuffer({size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),{originY:u,bottomRowFirst:p}=this.YU(e,n,c);s.queue.writeBuffer(o,0,new Int32Array([a,u]));try{return await g(s,l,i,c,[{binding:0,resource:e.createView({dimension:"2d",baseMipLevel:0,mipLevelCount:1})},{binding:1,resource:{buffer:o}}],p)}finally{o.destroy()}}};export{m as WebGpuTextureReadback,b as copyRgba8TextureToCpu,g as drawRgba8AndReadBack};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Copies a region of a 2D texture into an rgba8unorm image, texel by texel. Texels outside the texture are zero.
3
+ */
4
+ export declare const COPY_REGION_SHADER = "\n @group(0) @binding(0) var inputTexture: texture_2d<f32>;\n @group(0) @binding(1) var<uniform> origin: vec2i;\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex: u32) -> @builtin(position) vec4f {\n var pos = array<vec2f, 4>(\n vec2f(-1.0, -1.0),\n vec2f( 1.0, -1.0),\n vec2f(-1.0, 1.0),\n vec2f( 1.0, 1.0)\n );\n return vec4f(pos[vertexIndex], 0.0, 1.0);\n }\n\n @fragment\n fn fragmentMain(@builtin(position) position: vec4f) -> @location(0) vec4f {\n // Row 0 of the output (the top of the framebuffer) is row origin.y of the texture.\n let texel = vec2i(floor(position.xy)) + origin;\n let size = vec2i(textureDimensions(inputTexture));\n if (any(texel < vec2i(0)) || any(texel >= size)) {\n return vec4f(0.0);\n }\n return textureLoad(inputTexture, texel, 0);\n }\n";
@@ -0,0 +1,26 @@
1
+ var e=`
2
+ @group(0) @binding(0) var inputTexture: texture_2d<f32>;
3
+ @group(0) @binding(1) var<uniform> origin: vec2i;
4
+
5
+ @vertex
6
+ fn vertexMain(@builtin(vertex_index) vertexIndex: u32) -> @builtin(position) vec4f {
7
+ var pos = array<vec2f, 4>(
8
+ vec2f(-1.0, -1.0),
9
+ vec2f( 1.0, -1.0),
10
+ vec2f(-1.0, 1.0),
11
+ vec2f( 1.0, 1.0)
12
+ );
13
+ return vec4f(pos[vertexIndex], 0.0, 1.0);
14
+ }
15
+
16
+ @fragment
17
+ fn fragmentMain(@builtin(position) position: vec4f) -> @location(0) vec4f {
18
+ // Row 0 of the output (the top of the framebuffer) is row origin.y of the texture.
19
+ let texel = vec2i(floor(position.xy)) + origin;
20
+ let size = vec2i(textureDimensions(inputTexture));
21
+ if (any(texel < vec2i(0)) || any(texel >= size)) {
22
+ return vec4f(0.0);
23
+ }
24
+ return textureLoad(inputTexture, texel, 0);
25
+ }
26
+ `;export{e as COPY_REGION_SHADER};
@@ -0,0 +1,109 @@
1
+ import type { ComponentTypeEnum } from '../foundation/definitions/ComponentType';
2
+ import { type TextureFormatEnum } from '../foundation/definitions/TextureFormat';
3
+ import type { TextureParameterEnum } from '../foundation/definitions/TextureParameter';
4
+ import type { ImageBitmapData } from '../foundation/renderer/CGAPIResourceRepository';
5
+ import type { Index, Size, TypedArray, WebGLResourceHandle, WebGPUResourceHandle } from '../types/CommonTypes';
6
+ import type { WebGpuDeviceWrapper } from './WebGpuDeviceWrapper';
7
+ import type { WebGpuResource } from './WebGpuResourceRepository';
8
+ /**
9
+ * What `WebGpuTextureUploads` needs from the textures module that owns it.
10
+ */
11
+ export interface WebGpuTextureUploadResources {
12
+ /** The device wrapper, which is set when the repository is given a device. */
13
+ getDeviceWrapper(): WebGpuDeviceWrapper | undefined;
14
+ /** Registers a WebGPU object and returns its resource handle. */
15
+ registerResource(obj: WebGpuResource): WebGPUResourceHandle;
16
+ /** Returns the WebGPU object of a resource handle. */
17
+ getResource(handle: WebGPUResourceHandle): WebGpuResource | undefined;
18
+ /** Generates the mip levels of a texture this module created. */
19
+ generateMipmaps(texture: GPUTexture, textureDescriptor?: GPUTextureDescriptor): void;
20
+ }
21
+ /**
22
+ * Creates textures from image sources (ImageBitmap, data URI and HTMLImageElement) and uploads image data to the mip
23
+ * levels of 2D textures.
24
+ *
25
+ * Owned by `WebGpuTextures`, which exposes these operations through its public methods.
26
+ */
27
+ export declare class WebGpuTextureUploads {
28
+ private __resources;
29
+ constructor(resources: WebGpuTextureUploadResources);
30
+ private get __webGpuDeviceWrapper();
31
+ private __registerResource;
32
+ private __getResource;
33
+ /**
34
+ * Creates a WebGPU texture from ImageBitmap data with specified parameters.
35
+ * This method handles texture creation, data upload, and optional mipmap generation.
36
+ *
37
+ * @param imageData - The ImageBitmap data to create the texture from
38
+ * @param params - Configuration object containing texture parameters
39
+ * @param params.level - Mipmap level (typically 0 for base level)
40
+ * @param params.internalFormat - Internal format of the texture
41
+ * @param params.width - Width of the texture in pixels
42
+ * @param params.height - Height of the texture in pixels
43
+ * @param params.border - Border width (must be 0 for WebGPU)
44
+ * @param params.format - Pixel format of the source data
45
+ * @param params.type - Component type of the source data
46
+ * @param params.generateMipmap - Whether to generate mipmaps automatically
47
+ * @returns Promise that resolves to the texture resource handle
48
+ */
49
+ createTextureFromImageBitmapData(imageData: ImageBitmapData, { internalFormat, width, height, generateMipmap, }: {
50
+ internalFormat: TextureParameterEnum;
51
+ width: Size;
52
+ height: Size;
53
+ generateMipmap: boolean;
54
+ }): Promise<WebGPUResourceHandle>;
55
+ /**
56
+ * Creates a WebGPU texture from a data URI string.
57
+ * This method loads the image from the data URI and creates a texture from it.
58
+ *
59
+ * @param dataUri - The data URI string containing the image data
60
+ * @param params - Configuration object containing texture parameters
61
+ * @param params.internalFormat - Internal format of the texture
62
+ * @param params.generateMipmap - Whether to generate mipmaps automatically
63
+ * @returns Promise that resolves to the texture resource handle
64
+ */
65
+ createTextureFromDataUri(dataUri: string, { internalFormat, generateMipmap, }: {
66
+ internalFormat: TextureParameterEnum;
67
+ generateMipmap: boolean;
68
+ }): Promise<WebGPUResourceHandle>;
69
+ /**
70
+ * create a Texture
71
+ * @param imageData
72
+ * @param param1
73
+ * @returns
74
+ */
75
+ createTextureFromHTMLImageElement(imageData: HTMLImageElement, { internalFormat, width, height, generateMipmap, }: {
76
+ internalFormat: TextureParameterEnum;
77
+ width: Size;
78
+ height: Size;
79
+ generateMipmap: boolean;
80
+ }): Promise<WebGPUResourceHandle>;
81
+ /**
82
+ * Creates the texture of an image bitmap (or another image source) and registers it.
83
+ */
84
+ private __createTextureInner;
85
+ /**
86
+ * Load an image to a specific mip level of a texture
87
+ * @param mipLevel - the mip level to load the image to
88
+ * @param textureUid - the handle of the texture
89
+ * @param format - the format of the image
90
+ * @param type - the type of the data
91
+ * @param xOffset - the x offset of copy region
92
+ * @param yOffset - the y offset of copy region
93
+ * @param width - the width of the image
94
+ * @param height - the height of the image
95
+ * @param data - the typedarray data of the image
96
+ */
97
+ loadImageToMipLevelOfTexture2D({ mipLevel, textureUid, format, type, xOffset, yOffset, width, height, rowSizeByPixel, data, }: {
98
+ mipLevel: Index;
99
+ textureUid: WebGLResourceHandle;
100
+ format: TextureFormatEnum;
101
+ type: ComponentTypeEnum;
102
+ xOffset: number;
103
+ yOffset: number;
104
+ width: number;
105
+ height: number;
106
+ rowSizeByPixel: number;
107
+ data: TypedArray;
108
+ }): Promise<void>;
109
+ }
@@ -0,0 +1 @@
1
+ import{PixelFormat as U}from"../foundation/definitions/PixelFormat.js";import{TextureFormat as h}from"../foundation/definitions/TextureFormat.js";import{MathUtil as w}from"../foundation/math/MathUtil.js";import{Logger as v}from"../foundation/misc/Logger.js";var g=class{constructor(e){this.x_=e}get yG(){return this.x_.getDeviceWrapper()}T_(e){return this.x_.registerResource(e)}KG(e){return this.x_.getResource(e)}async createTextureFromImageBitmapData(e,{internalFormat:o,width:u,height:a,generateMipmap:r}){return await this.qW(u,a,o,r,e)}async createTextureFromDataUri(e,{internalFormat:o,generateMipmap:u}){return new Promise(a=>{let r=new Image;e.match(/^data:/)||(r.crossOrigin="Anonymous"),r.onload=async()=>{let n=r.width,i=r.height,t=await this.createTextureFromHTMLImageElement(r,{internalFormat:o,width:n,height:i,generateMipmap:u});a(t)},r.src=e})}async createTextureFromHTMLImageElement(e,{internalFormat:o,width:u,height:a,generateMipmap:r}){e.crossOrigin="Anonymous",(!e.complete||e.naturalWidth===0)&&await new Promise((t,m)=>{e.onload=()=>t(),e.onerror=()=>m(new Error("Failed to load image"))}),await e.decode();let n=await createImageBitmap(e);return await this.qW(u,a,o,r,n)}async qW(e,o,u,a,r){let n=this.yG.gpuDevice,i={size:[e,o,1],format:u.webgpu,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT};a&&(i.mipLevelCount=w.getMipLevelCount(e,o));let t=n.createTexture(i);return n.queue.copyExternalImageToTexture({source:r},{texture:t},[e,o]),a&&this.x_.generateMipmaps(t,i),await n.queue.onSubmittedWorkDone(),this.T_(t)}async loadImageToMipLevelOfTexture2D({mipLevel:e,textureUid:o,format:u,type:a,xOffset:r,yOffset:n,width:i,height:t,rowSizeByPixel:m,data:T}){let p=this.yG.gpuDevice,b=this.KG(o),y=h.getPixelFormatFromTextureFormat(u),P=U.getCompositionNumFromPixelFormat(y),c=m*P*a.getSizeInBytes(),d=Math.ceil(c/256)*256,x=new Uint8Array(d*t);for(let s=0;s<t;s++){let G=s*c,W=s*d;x.set(new Uint8Array(T.buffer,G,c),W)}let l=p.createBuffer({size:x.byteLength,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0});new Uint8Array(l.getMappedRange()).set(x),l.unmap();let f=p.createCommandEncoder();f.copyBufferToTexture({buffer:l,offset:0,bytesPerRow:d,rowsPerImage:t},{texture:b,mipLevel:e,origin:{x:r,y:n,z:0}},{width:i,height:t,depthOrArrayLayers:1});let R=f.finish();p.queue.submit([R]);try{await p.queue.onSubmittedWorkDone()}catch(s){v.default.error(s)}}};export{g as WebGpuTextureUploads};