ris-framework 0.1.0-dev.6 → 0.1.0-dev.9

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 (640) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE +202 -21
  3. package/LICENSES/Apache-2.0.txt +202 -0
  4. package/NOTICE +2 -0
  5. package/README.md +46 -47
  6. package/THIRD_PARTY_NOTICES.md +27 -0
  7. package/dist/Framework.d.ts +81 -0
  8. package/dist/Framework.d.ts.map +1 -0
  9. package/dist/api/FrameworkConfiguration.d.ts +23 -0
  10. package/dist/api/FrameworkConfiguration.d.ts.map +1 -0
  11. package/dist/api/IFramework.d.ts +125 -0
  12. package/dist/api/IFramework.d.ts.map +1 -0
  13. package/dist/api/IFrameworkConfiguration.d.ts +25 -0
  14. package/dist/api/IFrameworkConfiguration.d.ts.map +1 -0
  15. package/dist/api/_export.d.ts +27 -0
  16. package/dist/api/_export.d.ts.map +1 -0
  17. package/dist/api/camera/CameraFactory.d.ts +25 -0
  18. package/dist/api/camera/CameraFactory.d.ts.map +1 -0
  19. package/dist/api/camera/ICamera.d.ts +43 -0
  20. package/dist/api/camera/ICamera.d.ts.map +1 -0
  21. package/dist/api/camera/ICameraFactory.d.ts +46 -0
  22. package/dist/api/camera/ICameraFactory.d.ts.map +1 -0
  23. package/dist/api/camera/IOrthographicCamera.d.ts +31 -0
  24. package/dist/api/camera/IOrthographicCamera.d.ts.map +1 -0
  25. package/dist/api/camera/OrbitCamera.d.ts +120 -0
  26. package/dist/api/camera/OrbitCamera.d.ts.map +1 -0
  27. package/dist/api/camera/OrthographicCamera.d.ts +96 -0
  28. package/dist/api/camera/OrthographicCamera.d.ts.map +1 -0
  29. package/dist/api/camera/PerspectiveCamera.d.ts +108 -0
  30. package/dist/api/camera/PerspectiveCamera.d.ts.map +1 -0
  31. package/dist/api/camera/_export.d.ts +8 -0
  32. package/dist/api/camera/_export.d.ts.map +1 -0
  33. package/dist/api/content/ContentConfig.d.ts +11 -0
  34. package/dist/api/content/ContentConfig.d.ts.map +1 -0
  35. package/dist/api/content/ContentManager.d.ts +27 -0
  36. package/dist/api/content/ContentManager.d.ts.map +1 -0
  37. package/dist/api/content/IContent.d.ts +8 -0
  38. package/dist/api/content/IContent.d.ts.map +1 -0
  39. package/dist/api/content/IContentManager.d.ts +37 -0
  40. package/dist/api/content/IContentManager.d.ts.map +1 -0
  41. package/dist/api/content/IContentModule.d.ts +58 -0
  42. package/dist/api/content/IContentModule.d.ts.map +1 -0
  43. package/dist/api/content/ShaderModuleContent.d.ts +14 -0
  44. package/dist/api/content/ShaderModuleContent.d.ts.map +1 -0
  45. package/dist/api/content/_export-content.d.ts +5 -0
  46. package/dist/api/content/_export-content.d.ts.map +1 -0
  47. package/dist/api/core/IDisposable.d.ts +10 -0
  48. package/dist/api/core/IDisposable.d.ts.map +1 -0
  49. package/dist/api/core/_export-core.d.ts +2 -0
  50. package/dist/api/core/_export-core.d.ts.map +1 -0
  51. package/dist/api/data/Color.d.ts +119 -0
  52. package/dist/api/data/Color.d.ts.map +1 -0
  53. package/dist/api/data/Rect.d.ts +61 -0
  54. package/dist/api/data/Rect.d.ts.map +1 -0
  55. package/dist/api/data/State.d.ts +11 -0
  56. package/dist/api/data/State.d.ts.map +1 -0
  57. package/dist/api/data/_export.d.ts +4 -0
  58. package/dist/api/data/_export.d.ts.map +1 -0
  59. package/dist/api/geometry/BaseGeometry.d.ts +44 -0
  60. package/dist/api/geometry/BaseGeometry.d.ts.map +1 -0
  61. package/dist/api/geometry/GeometryBuilder.d.ts +11 -0
  62. package/dist/api/geometry/GeometryBuilder.d.ts.map +1 -0
  63. package/dist/api/geometry/GeometryFormat.d.ts +34 -0
  64. package/dist/api/geometry/GeometryFormat.d.ts.map +1 -0
  65. package/dist/api/geometry/IGeometry.d.ts +54 -0
  66. package/dist/api/geometry/IGeometry.d.ts.map +1 -0
  67. package/dist/api/geometry/IGeometryBuilder.d.ts +15 -0
  68. package/dist/api/geometry/IGeometryBuilder.d.ts.map +1 -0
  69. package/dist/api/geometry/VertexFormat.d.ts +14 -0
  70. package/dist/api/geometry/VertexFormat.d.ts.map +1 -0
  71. package/dist/api/geometry/_export-geometry.d.ts +5 -0
  72. package/dist/api/geometry/_export-geometry.d.ts.map +1 -0
  73. package/dist/api/image/CpuImageProcessor.d.ts +16 -0
  74. package/dist/api/image/CpuImageProcessor.d.ts.map +1 -0
  75. package/dist/api/image/IImageProcessor.d.ts +26 -0
  76. package/dist/api/image/IImageProcessor.d.ts.map +1 -0
  77. package/dist/api/image/RawImageData.d.ts +34 -0
  78. package/dist/api/image/RawImageData.d.ts.map +1 -0
  79. package/dist/api/image/_export.d.ts +4 -0
  80. package/dist/api/image/_export.d.ts.map +1 -0
  81. package/dist/api/index.d.ts +2 -0
  82. package/dist/api/index.d.ts.map +1 -0
  83. package/dist/api/input/IInputManager.d.ts +53 -0
  84. package/dist/api/input/IInputManager.d.ts.map +1 -0
  85. package/dist/api/input/InputDeviceType.d.ts +18 -0
  86. package/dist/api/input/InputDeviceType.d.ts.map +1 -0
  87. package/dist/api/input/InputManager.d.ts +73 -0
  88. package/dist/api/input/InputManager.d.ts.map +1 -0
  89. package/dist/api/input/Key.d.ts +36 -0
  90. package/dist/api/input/Key.d.ts.map +1 -0
  91. package/dist/api/input/KeyboardState.d.ts +37 -0
  92. package/dist/api/input/KeyboardState.d.ts.map +1 -0
  93. package/dist/api/input/_export.d.ts +14 -0
  94. package/dist/api/input/_export.d.ts.map +1 -0
  95. package/dist/api/input/gamepad/Button.d.ts +22 -0
  96. package/dist/api/input/gamepad/Button.d.ts.map +1 -0
  97. package/dist/api/input/gamepad/GamePadState.d.ts +48 -0
  98. package/dist/api/input/gamepad/GamePadState.d.ts.map +1 -0
  99. package/dist/api/input/gamepad/GamePadThumbSticks.d.ts +17 -0
  100. package/dist/api/input/gamepad/GamePadThumbSticks.d.ts.map +1 -0
  101. package/dist/api/input/mouse/MouseButton.d.ts +10 -0
  102. package/dist/api/input/mouse/MouseButton.d.ts.map +1 -0
  103. package/dist/api/input/mouse/MouseState.d.ts +52 -0
  104. package/dist/api/input/mouse/MouseState.d.ts.map +1 -0
  105. package/dist/api/input/touch/TouchCollection.d.ts +79 -0
  106. package/dist/api/input/touch/TouchCollection.d.ts.map +1 -0
  107. package/dist/api/input/touch/TouchLocation.d.ts +80 -0
  108. package/dist/api/input/touch/TouchLocation.d.ts.map +1 -0
  109. package/dist/api/input/touch/TouchLocationState.d.ts +16 -0
  110. package/dist/api/input/touch/TouchLocationState.d.ts.map +1 -0
  111. package/dist/api/input/touch/TouchPanelCapabilities.d.ts +24 -0
  112. package/dist/api/input/touch/TouchPanelCapabilities.d.ts.map +1 -0
  113. package/dist/api/loaders/IImageLoader.d.ts +20 -0
  114. package/dist/api/loaders/IImageLoader.d.ts.map +1 -0
  115. package/dist/api/loaders/ImageLoader.d.ts +36 -0
  116. package/dist/api/loaders/ImageLoader.d.ts.map +1 -0
  117. package/dist/api/loaders/_export.d.ts +3 -0
  118. package/dist/api/loaders/_export.d.ts.map +1 -0
  119. package/dist/api/material/IMaterial.d.ts +35 -0
  120. package/dist/api/material/IMaterial.d.ts.map +1 -0
  121. package/dist/api/material/IMaterialFactory.d.ts +19 -0
  122. package/dist/api/material/IMaterialFactory.d.ts.map +1 -0
  123. package/dist/api/material/InspectTextureMipsMaterial.d.ts +58 -0
  124. package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -0
  125. package/dist/api/material/MaterialFactory.d.ts +20 -0
  126. package/dist/api/material/MaterialFactory.d.ts.map +1 -0
  127. package/dist/api/material/UnlitMaterial.d.ts +76 -0
  128. package/dist/api/material/UnlitMaterial.d.ts.map +1 -0
  129. package/dist/api/material/_export.d.ts +6 -0
  130. package/dist/api/material/_export.d.ts.map +1 -0
  131. package/dist/api/meshes/IMesh.d.ts +17 -0
  132. package/dist/api/meshes/IMesh.d.ts.map +1 -0
  133. package/dist/api/meshes/IMeshFactory.d.ts +25 -0
  134. package/dist/api/meshes/IMeshFactory.d.ts.map +1 -0
  135. package/dist/api/meshes/Mesh.d.ts +93 -0
  136. package/dist/api/meshes/Mesh.d.ts.map +1 -0
  137. package/dist/api/meshes/MeshFactory.d.ts +23 -0
  138. package/dist/api/meshes/MeshFactory.d.ts.map +1 -0
  139. package/dist/api/meshes/MeshParameters.d.ts +22 -0
  140. package/dist/api/meshes/MeshParameters.d.ts.map +1 -0
  141. package/dist/api/meshes/QuadMesh.d.ts +33 -0
  142. package/dist/api/meshes/QuadMesh.d.ts.map +1 -0
  143. package/dist/api/meshes/_export.d.ts +7 -0
  144. package/dist/api/meshes/_export.d.ts.map +1 -0
  145. package/dist/api/rendering/IGPUInfo.d.ts +35 -0
  146. package/dist/api/rendering/IGPUInfo.d.ts.map +1 -0
  147. package/dist/api/rendering/IGraphicsDevice.d.ts +88 -0
  148. package/dist/api/rendering/IGraphicsDevice.d.ts.map +1 -0
  149. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +27 -0
  150. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -0
  151. package/dist/api/rendering/IRenderer.d.ts +71 -0
  152. package/dist/api/rendering/IRenderer.d.ts.map +1 -0
  153. package/dist/api/rendering/PowerPreference.d.ts +13 -0
  154. package/dist/api/rendering/PowerPreference.d.ts.map +1 -0
  155. package/dist/api/rendering/RenderingBackend.d.ts +18 -0
  156. package/dist/api/rendering/RenderingBackend.d.ts.map +1 -0
  157. package/dist/api/rendering/_export-rendering.d.ts +7 -0
  158. package/dist/api/rendering/_export-rendering.d.ts.map +1 -0
  159. package/dist/api/rendering/blending/IBlendState.d.ts +16 -0
  160. package/dist/api/rendering/blending/IBlendState.d.ts.map +1 -0
  161. package/dist/api/rendering/blending/_export.d.ts +2 -0
  162. package/dist/api/rendering/blending/_export.d.ts.map +1 -0
  163. package/dist/api/rendering/buffers/BufferUsage.d.ts +57 -0
  164. package/dist/api/rendering/buffers/BufferUsage.d.ts.map +1 -0
  165. package/dist/api/rendering/buffers/IBuffer.d.ts +20 -0
  166. package/dist/api/rendering/buffers/IBuffer.d.ts.map +1 -0
  167. package/dist/api/rendering/buffers/IBufferFactory.d.ts +34 -0
  168. package/dist/api/rendering/buffers/IBufferFactory.d.ts.map +1 -0
  169. package/dist/api/rendering/buffers/IIndexBuffer.d.ts +31 -0
  170. package/dist/api/rendering/buffers/IIndexBuffer.d.ts.map +1 -0
  171. package/dist/api/rendering/buffers/IUniformBuffer.d.ts +18 -0
  172. package/dist/api/rendering/buffers/IUniformBuffer.d.ts.map +1 -0
  173. package/dist/api/rendering/buffers/IVertexBuffer.d.ts +26 -0
  174. package/dist/api/rendering/buffers/IVertexBuffer.d.ts.map +1 -0
  175. package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts +23 -0
  176. package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts.map +1 -0
  177. package/dist/api/rendering/buffers/IndexBufferType.d.ts +14 -0
  178. package/dist/api/rendering/buffers/IndexBufferType.d.ts.map +1 -0
  179. package/dist/api/rendering/buffers/VertexAttribute.d.ts +22 -0
  180. package/dist/api/rendering/buffers/VertexAttribute.d.ts.map +1 -0
  181. package/dist/api/rendering/buffers/VertexStepMode.d.ts +14 -0
  182. package/dist/api/rendering/buffers/VertexStepMode.d.ts.map +1 -0
  183. package/dist/api/rendering/buffers/_export-buffers.d.ts +11 -0
  184. package/dist/api/rendering/buffers/_export-buffers.d.ts.map +1 -0
  185. package/dist/api/rendering/enums.d.ts +18 -0
  186. package/dist/api/rendering/enums.d.ts.map +1 -0
  187. package/dist/api/rendering/primitive/CullMode.d.ts +18 -0
  188. package/dist/api/rendering/primitive/CullMode.d.ts.map +1 -0
  189. package/dist/api/rendering/primitive/FrontFace.d.ts +14 -0
  190. package/dist/api/rendering/primitive/FrontFace.d.ts.map +1 -0
  191. package/dist/api/rendering/primitive/IPrimitiveState.d.ts +22 -0
  192. package/dist/api/rendering/primitive/IPrimitiveState.d.ts.map +1 -0
  193. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts +24 -0
  194. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts.map +1 -0
  195. package/dist/api/rendering/primitive/PrimitiveTopology.d.ts +26 -0
  196. package/dist/api/rendering/primitive/PrimitiveTopology.d.ts.map +1 -0
  197. package/dist/api/rendering/primitive/_export.d.ts +6 -0
  198. package/dist/api/rendering/primitive/_export.d.ts.map +1 -0
  199. package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts +33 -0
  200. package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts.map +1 -0
  201. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts +18 -0
  202. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts.map +1 -0
  203. package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts +39 -0
  204. package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts.map +1 -0
  205. package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts +42 -0
  206. package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts.map +1 -0
  207. package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts +22 -0
  208. package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts.map +1 -0
  209. package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts +33 -0
  210. package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts.map +1 -0
  211. package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts +7 -0
  212. package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts.map +1 -0
  213. package/dist/api/rendering/renderer-interface.d.ts +81 -0
  214. package/dist/api/rendering/renderer-interface.d.ts.map +1 -0
  215. package/dist/api/rendering/rendering-limits.d.ts +16 -0
  216. package/dist/api/rendering/rendering-limits.d.ts.map +1 -0
  217. package/dist/api/rendering/renderpass/IRenderPass.d.ts +15 -0
  218. package/dist/api/rendering/renderpass/IRenderPass.d.ts.map +1 -0
  219. package/dist/api/rendering/renderpass/LoadAction.d.ts +33 -0
  220. package/dist/api/rendering/renderpass/LoadAction.d.ts.map +1 -0
  221. package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts +53 -0
  222. package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts.map +1 -0
  223. package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts +56 -0
  224. package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts.map +1 -0
  225. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +22 -0
  226. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -0
  227. package/dist/api/rendering/renderpass/StoreAction.d.ts +24 -0
  228. package/dist/api/rendering/renderpass/StoreAction.d.ts.map +1 -0
  229. package/dist/api/rendering/renderpass/_export.d.ts +7 -0
  230. package/dist/api/rendering/renderpass/_export.d.ts.map +1 -0
  231. package/dist/api/rendering/sampler/ISampler.d.ts +43 -0
  232. package/dist/api/rendering/sampler/ISampler.d.ts.map +1 -0
  233. package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts +18 -0
  234. package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts.map +1 -0
  235. package/dist/api/rendering/sampler/SamplerAddressMode.d.ts +24 -0
  236. package/dist/api/rendering/sampler/SamplerAddressMode.d.ts.map +1 -0
  237. package/dist/api/rendering/sampler/SamplerDescriptor.d.ts +40 -0
  238. package/dist/api/rendering/sampler/SamplerDescriptor.d.ts.map +1 -0
  239. package/dist/api/rendering/sampler/SamplerFilter.d.ts +14 -0
  240. package/dist/api/rendering/sampler/SamplerFilter.d.ts.map +1 -0
  241. package/dist/api/rendering/sampler/_export.d.ts +6 -0
  242. package/dist/api/rendering/sampler/_export.d.ts.map +1 -0
  243. package/dist/api/rendering/sampler/sampler-enums.d.ts +15 -0
  244. package/dist/api/rendering/sampler/sampler-enums.d.ts.map +1 -0
  245. package/dist/api/rendering/swapchain/ISwapChain.d.ts +29 -0
  246. package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -0
  247. package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts +23 -0
  248. package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts.map +1 -0
  249. package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts +20 -0
  250. package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts.map +1 -0
  251. package/dist/api/rendering/swapchain/_export.d.ts +4 -0
  252. package/dist/api/rendering/swapchain/_export.d.ts.map +1 -0
  253. package/dist/api/rendering/texture/ITexture2D.d.ts +83 -0
  254. package/dist/api/rendering/texture/ITexture2D.d.ts.map +1 -0
  255. package/dist/api/rendering/texture/ITextureFactory.d.ts +42 -0
  256. package/dist/api/rendering/texture/ITextureFactory.d.ts.map +1 -0
  257. package/dist/api/rendering/texture/ITextureView.d.ts +17 -0
  258. package/dist/api/rendering/texture/ITextureView.d.ts.map +1 -0
  259. package/dist/api/rendering/texture/TextureDescriptor.d.ts +42 -0
  260. package/dist/api/rendering/texture/TextureDescriptor.d.ts.map +1 -0
  261. package/dist/api/rendering/texture/TextureFormat.d.ts +54 -0
  262. package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -0
  263. package/dist/api/rendering/texture/TextureUsage.d.ts +42 -0
  264. package/dist/api/rendering/texture/TextureUsage.d.ts.map +1 -0
  265. package/dist/api/rendering/texture/TextureUtilities.d.ts +54 -0
  266. package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -0
  267. package/dist/api/rendering/texture/TextureViewDescriptor.d.ts +22 -0
  268. package/dist/api/rendering/texture/TextureViewDescriptor.d.ts.map +1 -0
  269. package/dist/api/rendering/texture/TextureViewDimension.d.ts +17 -0
  270. package/dist/api/rendering/texture/TextureViewDimension.d.ts.map +1 -0
  271. package/dist/api/rendering/texture/_export-texture.d.ts +10 -0
  272. package/dist/api/rendering/texture/_export-texture.d.ts.map +1 -0
  273. package/dist/api/shader/IShaderModule.d.ts +21 -0
  274. package/dist/api/shader/IShaderModule.d.ts.map +1 -0
  275. package/dist/api/shader/IShaderModuleLoader.d.ts +13 -0
  276. package/dist/api/shader/IShaderModuleLoader.d.ts.map +1 -0
  277. package/dist/api/shader/ShaderStage.d.ts +10 -0
  278. package/dist/api/shader/ShaderStage.d.ts.map +1 -0
  279. package/dist/api/shader/_export-shader.d.ts +4 -0
  280. package/dist/api/shader/_export-shader.d.ts.map +1 -0
  281. package/dist/api/shader/shader-loader.d.ts +12 -0
  282. package/dist/api/shader/shader-loader.d.ts.map +1 -0
  283. package/dist/api/sprites/ISpriteBatch.d.ts +114 -0
  284. package/dist/api/sprites/ISpriteBatch.d.ts.map +1 -0
  285. package/dist/api/sprites/SpriteBatch.d.ts +50 -0
  286. package/dist/api/sprites/SpriteBatch.d.ts.map +1 -0
  287. package/dist/api/sprites/SpriteBatchDrawable.d.ts +57 -0
  288. package/dist/api/sprites/SpriteBatchDrawable.d.ts.map +1 -0
  289. package/dist/api/sprites/SpriteBatchMesh.d.ts +32 -0
  290. package/dist/api/sprites/SpriteBatchMesh.d.ts.map +1 -0
  291. package/dist/api/sprites/_export_sprites.d.ts +2 -0
  292. package/dist/api/sprites/_export_sprites.d.ts.map +1 -0
  293. package/dist/api/time/GameTime.d.ts +23 -0
  294. package/dist/api/time/GameTime.d.ts.map +1 -0
  295. package/dist/api/time/ITimeManager.d.ts +19 -0
  296. package/dist/api/time/ITimeManager.d.ts.map +1 -0
  297. package/dist/api/time/TimeManager.d.ts +15 -0
  298. package/dist/api/time/TimeManager.d.ts.map +1 -0
  299. package/dist/api/time/_export_time.d.ts +4 -0
  300. package/dist/api/time/_export_time.d.ts.map +1 -0
  301. package/dist/api/utilities/AlignUtilities.d.ts +20 -0
  302. package/dist/api/utilities/AlignUtilities.d.ts.map +1 -0
  303. package/dist/api/utilities/GeometryUtilities.d.ts +13 -0
  304. package/dist/api/utilities/GeometryUtilities.d.ts.map +1 -0
  305. package/dist/api/utilities/MathHelper.d.ts +162 -0
  306. package/dist/api/utilities/MathHelper.d.ts.map +1 -0
  307. package/dist/api/utilities/_export.d.ts +4 -0
  308. package/dist/api/utilities/_export.d.ts.map +1 -0
  309. package/dist/api/window/IWindowManager.d.ts +64 -0
  310. package/dist/api/window/IWindowManager.d.ts.map +1 -0
  311. package/dist/api/window/WindowBounds.d.ts +16 -0
  312. package/dist/api/window/WindowBounds.d.ts.map +1 -0
  313. package/dist/api/window/WindowManager.d.ts +32 -0
  314. package/dist/api/window/WindowManager.d.ts.map +1 -0
  315. package/dist/api/window/_export.d.ts +3 -0
  316. package/dist/api/window/_export.d.ts.map +1 -0
  317. package/dist/core/rendering/AGraphicsDevice.d.ts +73 -0
  318. package/dist/core/rendering/AGraphicsDevice.d.ts.map +1 -0
  319. package/dist/core/rendering/ARenderer.d.ts +74 -0
  320. package/dist/core/rendering/ARenderer.d.ts.map +1 -0
  321. package/dist/core/rendering/blending/blend-component-descriptor.d.ts +25 -0
  322. package/dist/core/rendering/blending/blend-component-descriptor.d.ts.map +1 -0
  323. package/dist/core/rendering/blending/blend-state-descriptor.d.ts +29 -0
  324. package/dist/core/rendering/blending/blend-state-descriptor.d.ts.map +1 -0
  325. package/dist/core/rendering/blending/enums.d.ts +43 -0
  326. package/dist/core/rendering/blending/enums.d.ts.map +1 -0
  327. package/dist/core/rendering/enums.d.ts +20 -0
  328. package/dist/core/rendering/enums.d.ts.map +1 -0
  329. package/dist/core/rendering/sampler/sampler-descriptor.d.ts +28 -0
  330. package/dist/core/rendering/sampler/sampler-descriptor.d.ts.map +1 -0
  331. package/dist/core/rendering/texture/texture.d.ts +69 -0
  332. package/dist/core/rendering/texture/texture.d.ts.map +1 -0
  333. package/dist/core/rendering/vertex-buffer-layout.d.ts +22 -0
  334. package/dist/core/rendering/vertex-buffer-layout.d.ts.map +1 -0
  335. package/dist/index.d.ts +5 -0
  336. package/dist/index.d.ts.map +1 -0
  337. package/dist/index.js +8054 -0
  338. package/dist/libktx-Cjh8w7XG-DhnH9lxr.js +4 -0
  339. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +31 -0
  340. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -0
  341. package/dist/webgl/WebGlGpuInfo.d.ts +25 -0
  342. package/dist/webgl/WebGlGpuInfo.d.ts.map +1 -0
  343. package/dist/webgl/WebGlGraphicsDevice.d.ts +47 -0
  344. package/dist/webgl/WebGlGraphicsDevice.d.ts.map +1 -0
  345. package/dist/webgl/WebGlRenderer.d.ts +18 -0
  346. package/dist/webgl/WebGlRenderer.d.ts.map +1 -0
  347. package/dist/webgl/blending/webgl-blend-state.d.ts +33 -0
  348. package/dist/webgl/blending/webgl-blend-state.d.ts.map +1 -0
  349. package/dist/webgl/buffers/WebGlBuffersFactory.d.ts +16 -0
  350. package/dist/webgl/buffers/WebGlBuffersFactory.d.ts.map +1 -0
  351. package/dist/webgl/buffers/WebGlUniformBuffer.d.ts +34 -0
  352. package/dist/webgl/buffers/WebGlUniformBuffer.d.ts.map +1 -0
  353. package/dist/webgl/buffers/WebGlVertexBuffer.d.ts +48 -0
  354. package/dist/webgl/buffers/WebGlVertexBuffer.d.ts.map +1 -0
  355. package/dist/webgl/buffers/webgl-index-buffer.d.ts +43 -0
  356. package/dist/webgl/buffers/webgl-index-buffer.d.ts.map +1 -0
  357. package/dist/webgl/cast/cast.d.ts +52 -0
  358. package/dist/webgl/cast/cast.d.ts.map +1 -0
  359. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts +29 -0
  360. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts.map +1 -0
  361. package/dist/webgl/render-pass/WebGlRenderPass.d.ts +34 -0
  362. package/dist/webgl/render-pass/WebGlRenderPass.d.ts.map +1 -0
  363. package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts +53 -0
  364. package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts.map +1 -0
  365. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +30 -0
  366. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -0
  367. package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts +24 -0
  368. package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts.map +1 -0
  369. package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts +57 -0
  370. package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts.map +1 -0
  371. package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts +57 -0
  372. package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts.map +1 -0
  373. package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts +40 -0
  374. package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts.map +1 -0
  375. package/dist/webgl/rendering/webgl-vertex-attribute.d.ts +10 -0
  376. package/dist/webgl/rendering/webgl-vertex-attribute.d.ts.map +1 -0
  377. package/dist/webgl/rendering/webgl-vertex-buffer-layout.d.ts +27 -0
  378. package/dist/webgl/rendering/webgl-vertex-buffer-layout.d.ts.map +1 -0
  379. package/dist/webgl/sampler/webgl-sampler.d.ts +48 -0
  380. package/dist/webgl/sampler/webgl-sampler.d.ts.map +1 -0
  381. package/dist/webgl/shader/WebGlShaderModule.d.ts +34 -0
  382. package/dist/webgl/shader/WebGlShaderModule.d.ts.map +1 -0
  383. package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts +19 -0
  384. package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts.map +1 -0
  385. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +27 -0
  386. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -0
  387. package/dist/webgl/texture/WebGlTexture2D.d.ts +37 -0
  388. package/dist/webgl/texture/WebGlTexture2D.d.ts.map +1 -0
  389. package/dist/webgl/texture/WebGlTextureFactory.d.ts +17 -0
  390. package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -0
  391. package/dist/webgl/utilities/WebGlBufferUtilities.d.ts +45 -0
  392. package/dist/webgl/utilities/WebGlBufferUtilities.d.ts.map +1 -0
  393. package/dist/webgl/utilities/WebGlConverter.d.ts +108 -0
  394. package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -0
  395. package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts +54 -0
  396. package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts.map +1 -0
  397. package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts +23 -0
  398. package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts.map +1 -0
  399. package/dist/webgl/utilities/WebGlShaderUtilities.d.ts +28 -0
  400. package/dist/webgl/utilities/WebGlShaderUtilities.d.ts.map +1 -0
  401. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts +33 -0
  402. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -0
  403. package/dist/webgl/utilities/WebGlUtilities.d.ts +60 -0
  404. package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -0
  405. package/dist/webgl/utilities/spector-js-utilities.d.ts +9 -0
  406. package/dist/webgl/utilities/spector-js-utilities.d.ts.map +1 -0
  407. package/dist/webgl/utilities/webgl-blending-utilities.d.ts +17 -0
  408. package/dist/webgl/utilities/webgl-blending-utilities.d.ts.map +1 -0
  409. package/dist/webgl/utilities/webgl-culling-utilities.d.ts +13 -0
  410. package/dist/webgl/utilities/webgl-culling-utilities.d.ts.map +1 -0
  411. package/dist/webgl/utilities/webgl-filter-anisotropic-utilities.d.ts +24 -0
  412. package/dist/webgl/utilities/webgl-filter-anisotropic-utilities.d.ts.map +1 -0
  413. package/dist/webgl/utilities/webgl-program-utilities.d.ts +14 -0
  414. package/dist/webgl/utilities/webgl-program-utilities.d.ts.map +1 -0
  415. package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts +17 -0
  416. package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts.map +1 -0
  417. package/package.json +19 -12
  418. package/shaders/glsl/sprite_fs.glsl +1 -1
  419. package/src/{core/Framework.ts → Framework.ts} +78 -38
  420. package/src/api/FrameworkConfiguration.ts +29 -0
  421. package/src/api/IFramework.ts +153 -0
  422. package/src/api/IFrameworkConfiguration.ts +30 -0
  423. package/src/api/_export.ts +26 -0
  424. package/src/api/camera/CameraFactory.ts +56 -0
  425. package/src/api/camera/ICamera.ts +52 -0
  426. package/src/api/camera/ICameraFactory.ts +69 -0
  427. package/src/api/camera/IOrthographicCamera.ts +38 -0
  428. package/src/api/camera/OrbitCamera.ts +402 -0
  429. package/src/api/camera/OrthographicCamera.ts +257 -0
  430. package/src/api/camera/PerspectiveCamera.ts +206 -0
  431. package/src/api/camera/_export.ts +7 -0
  432. package/src/api/content/ContentConfig.ts +11 -0
  433. package/src/{core → api}/content/ContentManager.ts +4 -3
  434. package/src/api/content/IContent.ts +9 -0
  435. package/src/api/content/IContentManager.ts +41 -0
  436. package/src/api/content/IContentModule.ts +67 -0
  437. package/src/{content → api/content}/ShaderModuleContent.ts +8 -8
  438. package/src/api/content/_export-content.ts +4 -0
  439. package/src/api/core/IDisposable.ts +10 -0
  440. package/src/api/core/_export-core.ts +1 -0
  441. package/src/api/data/Color.ts +228 -0
  442. package/src/api/data/Rect.ts +92 -0
  443. package/src/api/data/State.ts +10 -0
  444. package/src/api/data/_export.ts +3 -0
  445. package/src/{geometry → api/geometry}/BaseGeometry.ts +15 -2
  446. package/src/{geometry → api/geometry}/GeometryBuilder.ts +1 -1
  447. package/src/api/geometry/GeometryFormat.ts +33 -0
  448. package/src/api/geometry/IGeometry.ts +66 -0
  449. package/src/api/geometry/IGeometryBuilder.ts +17 -0
  450. package/src/{VertexFormat.ts → api/geometry/VertexFormat.ts} +3 -7
  451. package/src/api/geometry/_export-geometry.ts +4 -0
  452. package/src/api/image/CpuImageProcessor.ts +125 -0
  453. package/src/api/image/IImageProcessor.ts +28 -0
  454. package/src/api/image/RawImageData.ts +47 -0
  455. package/src/api/image/_export.ts +3 -0
  456. package/src/api/index.ts +1 -0
  457. package/src/api/input/IInputManager.ts +62 -0
  458. package/src/api/input/InputDeviceType.ts +20 -0
  459. package/src/api/input/InputManager.ts +513 -0
  460. package/src/api/input/Key.ts +35 -0
  461. package/src/api/input/KeyboardState.ts +44 -0
  462. package/src/api/input/_export.ts +13 -0
  463. package/src/api/input/gamepad/Button.ts +21 -0
  464. package/src/api/input/gamepad/GamePadState.ts +65 -0
  465. package/src/api/input/gamepad/GamePadThumbSticks.ts +18 -0
  466. package/src/api/input/mouse/MouseButton.ts +9 -0
  467. package/src/api/input/mouse/MouseState.ts +70 -0
  468. package/src/api/input/touch/TouchCollection.ts +164 -0
  469. package/src/api/input/touch/TouchLocation.ts +159 -0
  470. package/src/api/input/touch/TouchLocationState.ts +15 -0
  471. package/src/api/input/touch/TouchPanelCapabilities.ts +31 -0
  472. package/src/api/loaders/IImageLoader.ts +22 -0
  473. package/src/api/loaders/ImageLoader.ts +93 -0
  474. package/src/api/loaders/_export.ts +2 -0
  475. package/src/api/material/IMaterial.ts +41 -0
  476. package/src/api/material/IMaterialFactory.ts +21 -0
  477. package/src/api/material/InspectTextureMipsMaterial.ts +113 -0
  478. package/src/api/material/MaterialFactory.ts +27 -0
  479. package/src/api/material/UnlitMaterial.ts +143 -0
  480. package/src/api/material/_export.ts +5 -0
  481. package/src/api/meshes/IMesh.ts +20 -0
  482. package/src/api/meshes/IMeshFactory.ts +28 -0
  483. package/src/api/meshes/Mesh.ts +256 -0
  484. package/src/api/meshes/MeshFactory.ts +36 -0
  485. package/src/api/meshes/MeshParameters.ts +25 -0
  486. package/src/api/meshes/QuadMesh.ts +104 -0
  487. package/src/api/meshes/_export.ts +6 -0
  488. package/src/api/rendering/IGPUInfo.ts +42 -0
  489. package/src/api/rendering/IGraphicsDevice.ts +103 -0
  490. package/src/api/rendering/IGraphicsDeviceFeatures.ts +32 -0
  491. package/src/api/rendering/IRenderer.ts +84 -0
  492. package/src/api/rendering/PowerPreference.ts +15 -0
  493. package/src/api/rendering/RenderingBackend.ts +20 -0
  494. package/src/api/rendering/_export-rendering.ts +6 -0
  495. package/src/api/rendering/blending/IBlendState.ts +17 -0
  496. package/src/api/rendering/blending/_export.ts +1 -0
  497. package/src/api/rendering/buffers/BufferUsage.ts +56 -0
  498. package/src/api/rendering/buffers/IBuffer.ts +24 -0
  499. package/src/api/rendering/buffers/IBufferFactory.ts +38 -0
  500. package/src/api/rendering/buffers/IIndexBuffer.ts +37 -0
  501. package/src/api/rendering/buffers/IUniformBuffer.ts +21 -0
  502. package/src/api/rendering/buffers/IVertexBuffer.ts +32 -0
  503. package/src/api/rendering/buffers/IVertexBufferLayout.ts +27 -0
  504. package/src/api/rendering/buffers/IndexBufferType.ts +13 -0
  505. package/src/api/rendering/buffers/VertexAttribute.ts +26 -0
  506. package/src/api/rendering/buffers/VertexStepMode.ts +13 -0
  507. package/src/api/rendering/buffers/_export-buffers.ts +11 -0
  508. package/src/api/rendering/primitive/CullMode.ts +17 -0
  509. package/src/api/rendering/primitive/FrontFace.ts +13 -0
  510. package/src/api/rendering/primitive/IPrimitiveState.ts +25 -0
  511. package/src/api/rendering/primitive/PrimitiveStateDescriptor.ts +27 -0
  512. package/src/api/rendering/primitive/PrimitiveTopology.ts +25 -0
  513. package/src/api/rendering/primitive/_export.ts +5 -0
  514. package/src/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.ts +38 -0
  515. package/src/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.ts +21 -0
  516. package/src/api/rendering/render-pipelines/IRenderPipeline.ts +47 -0
  517. package/src/api/rendering/render-pipelines/IRenderPipelineFactory.ts +52 -0
  518. package/src/api/rendering/render-pipelines/ISpriteRenderPipeline.ts +25 -0
  519. package/src/api/rendering/render-pipelines/IUnlitRenderPipeline.ts +38 -0
  520. package/src/api/rendering/render-pipelines/_export-render-pipelines.ts +6 -0
  521. package/src/{core/renderer → api/rendering}/renderer-interface.ts +15 -9
  522. package/src/api/rendering/renderpass/IRenderPass.ts +18 -0
  523. package/src/api/rendering/renderpass/LoadAction.ts +32 -0
  524. package/src/api/rendering/renderpass/RenderPassColorAttachment.ts +61 -0
  525. package/src/api/rendering/renderpass/RenderPassDepthStencilAttachment.ts +76 -0
  526. package/src/api/rendering/renderpass/RenderPassDescriptor.ts +26 -0
  527. package/src/api/rendering/renderpass/StoreAction.ts +23 -0
  528. package/src/api/rendering/renderpass/_export.ts +6 -0
  529. package/src/api/rendering/sampler/ISampler.ts +52 -0
  530. package/src/api/rendering/sampler/MipMapSamplerFilter.ts +17 -0
  531. package/src/api/rendering/sampler/SamplerAddressMode.ts +23 -0
  532. package/src/api/rendering/sampler/SamplerDescriptor.ts +46 -0
  533. package/src/api/rendering/sampler/SamplerFilter.ts +13 -0
  534. package/src/api/rendering/sampler/_export.ts +5 -0
  535. package/src/api/rendering/sampler/sampler-enums.ts +20 -0
  536. package/src/api/rendering/swapchain/ISwapChain.ts +33 -0
  537. package/src/api/rendering/swapchain/SurfacePresentMode.ts +22 -0
  538. package/src/api/rendering/swapchain/SwapChainDescriptor.ts +23 -0
  539. package/src/api/rendering/swapchain/_export.ts +3 -0
  540. package/src/api/rendering/texture/ITexture2D.ts +100 -0
  541. package/src/api/rendering/texture/ITextureFactory.ts +56 -0
  542. package/src/api/rendering/texture/ITextureView.ts +20 -0
  543. package/src/api/rendering/texture/TextureDescriptor.ts +52 -0
  544. package/src/api/rendering/texture/TextureFormat.ts +58 -0
  545. package/src/api/rendering/texture/TextureUsage.ts +41 -0
  546. package/src/api/rendering/texture/TextureUtilities.ts +149 -0
  547. package/src/api/rendering/texture/TextureViewDescriptor.ts +25 -0
  548. package/src/api/rendering/texture/TextureViewDimension.ts +16 -0
  549. package/src/api/rendering/texture/_export-texture.ts +9 -0
  550. package/src/api/shader/IShaderModule.ts +23 -0
  551. package/src/api/shader/IShaderModuleLoader.ts +15 -0
  552. package/src/api/shader/ShaderStage.ts +9 -0
  553. package/src/api/shader/_export-shader.ts +3 -0
  554. package/src/{core → api}/shader/shader-loader.ts +1 -1
  555. package/src/api/sprites/ISpriteBatch.ts +144 -0
  556. package/src/{core/sprite-batch → api/sprites}/SpriteBatch.ts +8 -5
  557. package/src/{core/sprite-batch → api/sprites}/SpriteBatchDrawable.ts +6 -6
  558. package/src/{core/sprite-batch → api/sprites}/SpriteBatchMesh.ts +8 -4
  559. package/src/api/sprites/_export_sprites.ts +1 -0
  560. package/src/api/time/GameTime.ts +30 -0
  561. package/src/api/time/ITimeManager.ts +22 -0
  562. package/src/api/time/TimeManager.ts +33 -0
  563. package/src/api/time/_export_time.ts +3 -0
  564. package/src/api/utilities/AlignUtilities.ts +39 -0
  565. package/src/api/utilities/GeometryUtilities.ts +20 -0
  566. package/src/api/utilities/MathHelper.ts +256 -0
  567. package/src/api/utilities/_export.ts +3 -0
  568. package/src/api/window/IWindowManager.ts +78 -0
  569. package/src/api/window/WindowBounds.ts +17 -0
  570. package/src/{core/window/window-manager.ts → api/window/WindowManager.ts} +2 -2
  571. package/src/api/window/_export.ts +2 -0
  572. package/src/core/rendering/AGraphicsDevice.ts +15 -9
  573. package/src/core/rendering/ARenderer.ts +7 -7
  574. package/src/core/rendering/blending/enums.ts +5 -5
  575. package/src/core/rendering/sampler/sampler-descriptor.ts +1 -1
  576. package/src/core/rendering/texture/texture.ts +4 -3
  577. package/src/core/rendering/vertex-buffer-layout.ts +3 -4
  578. package/src/glsl-raw.d.ts +4 -0
  579. package/src/index.ts +3 -2
  580. package/src/main.ts +5 -10
  581. package/src/webgl/WebGLGraphicsDeviceFeatures.ts +1 -1
  582. package/src/webgl/WebGlGpuInfo.ts +1 -1
  583. package/src/webgl/WebGlGraphicsDevice.ts +19 -15
  584. package/src/webgl/WebGlRenderer.ts +7 -5
  585. package/src/webgl/blending/webgl-blend-state.ts +1 -1
  586. package/src/webgl/buffers/WebGlBuffersFactory.ts +1 -1
  587. package/src/webgl/buffers/WebGlUniformBuffer.ts +1 -1
  588. package/src/webgl/buffers/WebGlVertexBuffer.ts +8 -7
  589. package/src/webgl/buffers/webgl-index-buffer.ts +2 -2
  590. package/src/webgl/cast/cast.ts +2 -2
  591. package/src/webgl/primitive/WebGlPrimitiveState.ts +7 -3
  592. package/src/webgl/render-pass/WebGlRenderPass.ts +17 -8
  593. package/src/webgl/render-pipelines/AWebGlRenderPipeline.ts +1 -1
  594. package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +10 -2
  595. package/src/webgl/render-pipelines/WebGlRenderPipelineFactory.ts +1 -1
  596. package/src/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.ts +3 -3
  597. package/src/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.ts +2 -2
  598. package/src/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.ts +2 -2
  599. package/src/webgl/sampler/webgl-sampler.ts +2 -2
  600. package/src/webgl/shader/WebGlShaderModule.ts +2 -2
  601. package/src/webgl/shader/WebGlShaderModuleLoader.ts +1 -1
  602. package/src/webgl/swap-chain/WebGlSwapChain.ts +1 -1
  603. package/src/webgl/texture/WebGlTexture2D.ts +6 -4
  604. package/src/webgl/texture/WebGlTextureFactory.ts +7 -7
  605. package/src/webgl/utilities/WebGlBufferUtilities.ts +1 -1
  606. package/src/webgl/utilities/WebGlConverter.ts +19 -62
  607. package/src/webgl/utilities/WebGlFrameBufferUtilities.ts +1 -1
  608. package/src/webgl/utilities/WebGlSamplerUtilities.ts +4 -4
  609. package/src/webgl/utilities/WebGlTextureUtilities.ts +29 -20
  610. package/src/webgl/utilities/webgl-culling-utilities.ts +1 -1
  611. package/src/webgl/utilities/webgl-filter-anisotropic-utilities.ts +1 -1
  612. package/src/webgl/utilities/webgl-renderbuffer-utilities.ts +1 -1
  613. package/dist/assets/_ris-ktx2-node-module-stub-DwDS30PT.js +0 -1
  614. package/dist/assets/cat.jpg +0 -0
  615. package/dist/assets/index-BmeGit54.css +0 -1
  616. package/dist/assets/index-qyn4pzGw.js +0 -151
  617. package/dist/assets/libktx-Cjh8w7XG-Ci1Fm_MH.js +0 -1
  618. package/dist/assets/test.png +0 -0
  619. package/dist/index.html +0 -16
  620. package/dist/vite.svg +0 -1
  621. package/src/TextureFormat.ts +0 -0
  622. package/src/common/sampler-enums.ts +0 -21
  623. package/src/common/vertex-step-mode.ts +0 -12
  624. package/src/core/FrameworkConfig.ts +0 -31
  625. package/src/core/buffers/buffers-factory-interface.ts +0 -0
  626. package/src/core/buffers/vertex-buffer-interface.ts +0 -0
  627. package/src/core/dependency-injection/register-services-interface.ts +0 -15
  628. package/src/core/framework-interface.ts +0 -0
  629. package/src/core/input/InputManager.ts +0 -115
  630. package/src/core/rendering/primitive/PrimitiveStateDescriptor.ts +0 -32
  631. package/src/core/rendering/primitive/enums.ts +0 -68
  632. package/src/core/rendering/render-pass/render-pass-descriptor.ts +0 -0
  633. package/src/core/rendering/render-pass/render-pass-interface.ts +0 -17
  634. package/src/core/rendering/vertex-attribute.ts +0 -20
  635. package/src/core/shader/shader-module-interface.ts +0 -1
  636. package/src/counter.ts +0 -9
  637. package/src/geometry/GeometryFormat.ts +0 -37
  638. package/src/webgl/utilities/webgl-render-buffer-utilities.ts +0 -23
  639. /package/src/{core/renderer → api/rendering}/enums.ts +0 -0
  640. /package/src/{core/renderer → api/rendering}/rendering-limits.ts +0 -0
@@ -1,18 +1,18 @@
1
- import type { IRenderPass } from "../../core/rendering/render-pass/render-pass-interface";
2
1
  import { asWebGLTexture2D } from "../cast/cast";
3
2
  import { WebGlUtilities } from "../utilities/WebGlUtilities.ts";
4
3
  import type { WebGlGraphicsDevice } from "../WebGlGraphicsDevice.ts";
5
4
  import {
6
5
  Color,
6
+ type IRenderPass,
7
7
  LoadAction,
8
8
  RenderPassColorAttachment, RenderPassDepthStencilAttachment,
9
9
  RenderPassDescriptor,
10
10
  StoreAction,
11
11
  TextureFormat
12
- } from "ris-framework-api"
12
+ } from "../../api/index.ts"
13
13
 
14
14
  /**
15
- * The WeGL implementation of the IRenderPass interface.
15
+ * The WebGL implementation of the IRenderPass interface.
16
16
  */
17
17
  export class WebGlRenderPass implements IRenderPass {
18
18
 
@@ -20,6 +20,7 @@ export class WebGlRenderPass implements IRenderPass {
20
20
 
21
21
  private _colorAttachmentsCount = 0;
22
22
  private _clearColors: Color[] = [];
23
+ private _clearColorAttachment: boolean[] = [];
23
24
  private _frameBuffer: WebGLFramebuffer | null = null;
24
25
  private _depthStencilRenderBuffer: WebGLRenderbuffer | null = null;
25
26
  private _clearBufferMask: GLbitfield = 0;
@@ -46,11 +47,14 @@ export class WebGlRenderPass implements IRenderPass {
46
47
  private _setupFrameBuffer(colorAttachments: RenderPassColorAttachment[]): void {
47
48
  this._colorAttachmentsCount = colorAttachments.length;
48
49
  this._clearColors = [];
50
+ this._clearColorAttachment = [];
49
51
 
50
52
  for (let i = 0; i < this._colorAttachmentsCount; i++) {
51
53
  const colorAttachment = colorAttachments[i];
52
54
  this._clearColors.push(colorAttachment.clearColor);
53
- if (colorAttachment.loadAction == LoadAction.CLEAR) {
55
+ const clear = colorAttachment.loadAction == LoadAction.CLEAR;
56
+ this._clearColorAttachment.push(clear);
57
+ if (clear) {
54
58
  this._clearBufferMask |= this._gl.COLOR_BUFFER_BIT;
55
59
  }
56
60
  if (colorAttachment.storeAction == StoreAction.DISCARD) {
@@ -138,9 +142,6 @@ export class WebGlRenderPass implements IRenderPass {
138
142
  const gl = this._gl;
139
143
 
140
144
  gl.bindFramebuffer(gl.FRAMEBUFFER, this._frameBuffer);
141
-
142
- // COLOR
143
- gl.clear(this._clearBufferMask);
144
145
 
145
146
  if (this._enableDepthTest) {
146
147
  gl.enable(gl.DEPTH_TEST);
@@ -158,8 +159,16 @@ export class WebGlRenderPass implements IRenderPass {
158
159
  gl.disable(gl.STENCIL_TEST);
159
160
  }
160
161
 
162
+ // Clear after clearDepth and clearStencil are set, so gl.clear uses this pass's values.
163
+ if (this._clearBufferMask !== 0) {
164
+ gl.clear(this._clearBufferMask);
165
+ }
166
+
167
+ // COLOR. Attachments with LoadAction.LOAD keep their contents.
161
168
  for (let i = 0; i < this._colorAttachmentsCount; i++) {
162
- gl.clearBufferfv(gl.COLOR, i, this._clearColors[i]);
169
+ if (this._clearColorAttachment[i]) {
170
+ gl.clearBufferfv(gl.COLOR, i, this._clearColors[i]);
171
+ }
163
172
  }
164
173
  }
165
174
 
@@ -1,4 +1,4 @@
1
- import type {IBlendState, IFramework, IIndexBuffer, IPrimitiveState, IRenderPipeline, IVertexBuffer} from "ris-framework-api";
1
+ import type {IBlendState, IFramework, IIndexBuffer, IPrimitiveState, IRenderPipeline, IVertexBuffer} from "../../api/index.ts";
2
2
  import type {VertexBufferLayout} from '../../core/rendering/vertex-buffer-layout';
3
3
  import type {WebGlBlendState} from '../blending/webgl-blend-state';
4
4
  import type {WebGlPrimitiveState} from '../primitive/WebGlPrimitiveState.ts';
@@ -1,12 +1,12 @@
1
1
  import {vec2} from "gl-matrix";
2
2
  import type {WebGlVertexBuffer} from "../buffers/WebGlVertexBuffer.ts";
3
- import {GeometryFormat} from "../../geometry/GeometryFormat.ts";
3
+ import {GeometryFormat} from "../../api/geometry/GeometryFormat.ts";
4
4
  import type {WebGLIndexBuffer} from "../buffers/webgl-index-buffer";
5
5
  import {VertexBufferLayout} from "../../core/rendering/vertex-buffer-layout";
6
6
  import type {WebGlTexture2D} from "../texture/WebGlTexture2D.ts";
7
7
  import WebGlShaderModule from "../shader/WebGlShaderModule.ts";
8
8
  import {AWebGlRenderPipeline} from "./AWebGlRenderPipeline.ts";
9
- import {BufferUsage, type IFramework, type IMainRenderTargetRenderPipeline, type ITexture2D} from "ris-framework-api";
9
+ import {BufferUsage, type IFramework, type IMainRenderTargetRenderPipeline, type ITexture2D} from "../../api/index.ts";
10
10
 
11
11
  /**
12
12
  * The WebGL implementation of the main render target render pipeline.
@@ -92,4 +92,12 @@ export class WebGlMainRenderTargetRenderPipeline extends AWebGlRenderPipeline im
92
92
 
93
93
  this._gl.drawElements(this._gl.TRIANGLES, this._indexBuffer.indicesCount, this._gl.UNSIGNED_SHORT, 0);
94
94
  }
95
+
96
+ /** @inheritdoc */
97
+ public override dispose(): void {
98
+ // ARenderer recreates this pipeline on every resize, so release the quad buffers too.
99
+ this._vertexBuffer?.dispose();
100
+ this._indexBuffer?.dispose();
101
+ super.dispose();
102
+ }
95
103
  }
@@ -7,7 +7,7 @@ import type {
7
7
  ISpriteRenderPipeline, ITexture2D,
8
8
  IUniformBuffer,
9
9
  IUnlitRenderPipeline
10
- } from "ris-framework-api";
10
+ } from "../../api/index.ts";
11
11
  import {WebGlInspectTextureMipsRenderPipeline} from "./inspect/WebGlInspectTextureMipsRenderPipeline.ts";
12
12
  import {WebGlUnlitRenderPipeline} from "./material/WebGlUnlitRenderPipeline.ts";
13
13
 
@@ -4,7 +4,7 @@ import type {
4
4
  ITexture2D,
5
5
  IUniformBuffer,
6
6
  IVertexBuffer
7
- } from "ris-framework-api";
7
+ } from "../../../api/index.ts";
8
8
  import {VertexBufferLayout} from "../../../core/rendering/vertex-buffer-layout";
9
9
  import type {WebGlUniformBuffer} from "../../buffers/WebGlUniformBuffer.ts";
10
10
  import {asWebGLTexture2D, asWebGLUniformBuffer} from "../../cast/cast";
@@ -13,11 +13,11 @@ import {WebGlTexture2D} from "../../texture/WebGlTexture2D.ts";
13
13
  import {WebGlVertexBuffer} from '../../buffers/WebGlVertexBuffer.ts';
14
14
  import {AWebGlRenderPipeline} from "../AWebGlRenderPipeline.ts";
15
15
  import type {WebGLIndexBuffer} from "../../buffers/webgl-index-buffer";
16
- import {type IIndexBuffer, IndexBufferType} from "ris-framework-api";
16
+ import {type IIndexBuffer, IndexBufferType} from "../../../api/index.ts";
17
17
  import type {WebGlSampler} from "../../sampler/webgl-sampler.ts";
18
18
  import type {
19
19
  IInspectTextureMipsRenderPipeline
20
- } from "ris-framework-api";
20
+ } from "../../../api/index.ts";
21
21
 
22
22
  /**
23
23
  * The WebGL implementation of the sprite render pipeline.
@@ -4,7 +4,7 @@ import type {
4
4
  ITexture2D,
5
5
  IUniformBuffer, IUnlitRenderPipeline,
6
6
  IVertexBuffer
7
- } from "ris-framework-api";
7
+ } from "../../../api/index.ts";
8
8
  import {VertexBufferLayout} from "../../../core/rendering/vertex-buffer-layout";
9
9
  import type {WebGlUniformBuffer} from "../../buffers/WebGlUniformBuffer.ts";
10
10
  import { asWebGLUniformBuffer} from "../../cast/cast";
@@ -13,7 +13,7 @@ import {WebGlTexture2D} from "../../texture/WebGlTexture2D.ts";
13
13
  import {WebGlVertexBuffer} from '../../buffers/WebGlVertexBuffer.ts';
14
14
  import {AWebGlRenderPipeline} from "../AWebGlRenderPipeline.ts";
15
15
  import type {WebGLIndexBuffer} from "../../buffers/webgl-index-buffer";
16
- import {type IIndexBuffer, IndexBufferType} from "ris-framework-api";
16
+ import {type IIndexBuffer, IndexBufferType} from "../../../api/index.ts";
17
17
  import type {WebGlSampler} from "../../sampler/webgl-sampler.ts";
18
18
 
19
19
  /**
@@ -5,7 +5,7 @@ import type {
5
5
  ITexture2D,
6
6
  IUniformBuffer,
7
7
  IVertexBuffer
8
- } from "ris-framework-api";
8
+ } from "../../../api/index.ts";
9
9
  import {VertexBufferLayout} from "../../../core/rendering/vertex-buffer-layout";
10
10
  import type {WebGlUniformBuffer} from "../../buffers/WebGlUniformBuffer.ts";
11
11
  import {asWebGLTexture2D, asWebGLUniformBuffer} from "../../cast/cast";
@@ -14,7 +14,7 @@ import {WebGlTexture2D} from "../../texture/WebGlTexture2D.ts";
14
14
  import {WebGlVertexBuffer} from '../../buffers/WebGlVertexBuffer.ts';
15
15
  import {AWebGlRenderPipeline} from "../AWebGlRenderPipeline.ts";
16
16
  import type {WebGLIndexBuffer} from "../../buffers/webgl-index-buffer";
17
- import {type IIndexBuffer, IndexBufferType} from "ris-framework-api";
17
+ import {type IIndexBuffer, IndexBufferType} from "../../../api/index.ts";
18
18
  import type {WebGlSampler} from "../../sampler/webgl-sampler.ts";
19
19
 
20
20
  /**
@@ -1,8 +1,8 @@
1
- import { SamplerCompareFunction } from "../../common/sampler-enums";
1
+ import { SamplerCompareFunction } from "../../api/rendering/sampler/sampler-enums";
2
2
  import { SamplerDescriptor } from "../../core/rendering/sampler/sampler-descriptor";
3
3
  import { WebGlUtilities } from "../utilities/WebGlUtilities.ts";
4
4
  import type { WebGlGraphicsDevice } from "../WebGlGraphicsDevice.ts";
5
- import {type ISampler, MipMapSamplerFilter, SamplerAddressMode, SamplerFilter} from "ris-framework-api";
5
+ import {type ISampler, MipMapSamplerFilter, SamplerAddressMode, SamplerFilter} from "../../api/index.ts";
6
6
 
7
7
  /**
8
8
  * The WebGL implementation of the ISampler interface.
@@ -1,7 +1,7 @@
1
1
  import type {WebGlGraphicsDevice} from "../WebGlGraphicsDevice.ts";
2
2
  import {WebGlUtilities} from "../utilities/WebGlUtilities.ts";
3
- import {type IFramework, type IShaderModule, ShaderStage} from "ris-framework-api";
4
- import {ShaderModuleContent} from "../../content/ShaderModuleContent.ts";
3
+ import {type IFramework, type IShaderModule, ShaderStage} from "../../api/index.ts";
4
+ import {ShaderModuleContent} from "../../api/content/ShaderModuleContent.ts";
5
5
 
6
6
  interface WebGlInternalShader {
7
7
  vertex: string;
@@ -1,5 +1,5 @@
1
1
  import WebGlShaderModule from "./WebGlShaderModule.ts";
2
- import type {IFramework, IShaderModule} from "ris-framework-api";
2
+ import type {IFramework, IShaderModule} from "../../api/index.ts";
3
3
 
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { vec2 } from "gl-matrix";
2
- import {type IGraphicsDevice, type ISwapChain, TextureFormat} from "ris-framework-api";
2
+ import {type IGraphicsDevice, type ISwapChain, TextureFormat} from "../../api/index.ts";
3
3
  import type {WebGlGraphicsDevice} from "../WebGlGraphicsDevice.ts";
4
4
 
5
5
  /**
@@ -4,7 +4,7 @@ import {
4
4
  type IFramework, State,
5
5
  type ITextureView,
6
6
  type TextureViewDescriptor, TextureUtilities
7
- } from "ris-framework-api";
7
+ } from "../../api/index.ts";
8
8
  import type {WebGlGraphicsDevice} from "../WebGlGraphicsDevice.ts";
9
9
  import {ATexture2D} from "../../core/rendering/texture/texture.ts";
10
10
  import {vec2} from "gl-matrix";
@@ -78,8 +78,9 @@ export class WebGlTexture2D extends ATexture2D {
78
78
 
79
79
  for (let i = 0; i < this.mipLevels; i++) {
80
80
  this._size += TextureUtilities.getVRamSize(this.textureFormat, width, height);
81
- width /= 2;
82
- height /= 2;
81
+ // Each mip is at least 1x1 and has whole-pixel dimensions.
82
+ width = Math.max(1, Math.floor(width / 2));
83
+ height = Math.max(1, Math.floor(height / 2));
83
84
  }
84
85
  }
85
86
 
@@ -100,7 +101,8 @@ export class WebGlTexture2D extends ATexture2D {
100
101
  this._glTexture = null;
101
102
  this._state = State.DISPOSED;
102
103
 
103
- for (const listener of this._disposedListeners) {
104
+ // Iterate a copy. A listener may remove itself while this loop runs.
105
+ for (const listener of this._disposedListeners.slice()) {
104
106
  listener(this);
105
107
  }
106
108
  }
@@ -7,15 +7,15 @@ import {
7
7
  TextureFormat,
8
8
  TextureUsage,
9
9
  TextureUtilities
10
- } from "ris-framework-api"
10
+ } from "../../api/index.ts"
11
11
  import {WebGlTexture2D} from "./WebGlTexture2D.ts";
12
- import {type IKtx2Texture, KtxTranscodeFlags, KtxTranscodeFormat, TextureFormatInfo, VkFormat} from "ris-ktx2-api";
12
+ import {type IKtx2Texture, KtxTranscodeFlags, KtxTranscodeFormat, TextureFormatInfo, VkFormat} from "ris-ktx2";
13
13
  import {vec2} from "gl-matrix";
14
14
 
15
15
  export class WebGlTextureFactory implements ITextureFactory {
16
16
 
17
17
  /**
18
- * The constructor for the WebGLTextureFactory class.
18
+ * The constructor for the WebGlTextureFactory class.
19
19
  * @param _framework The framework instance.
20
20
  */
21
21
  constructor(private readonly _framework: IFramework) {
@@ -65,7 +65,7 @@ export class WebGlTextureFactory implements ITextureFactory {
65
65
  }
66
66
 
67
67
  ktxTexture.transcodeBasis(transcodeFormat, KtxTranscodeFlags.HIGH_QUALITY);
68
- texFormatInfo = ktxTexture.getTextureFormatInfo(transcodeFormat);
68
+ texFormatInfo = ktxTexture.getTextureFormatInfo(TextureUtilities.convertKtxTranscodeFormatToVkFormat(transcodeFormat));
69
69
  }
70
70
  else {
71
71
  // No transcoding path, but still get info about the texture format.
@@ -168,14 +168,14 @@ export class WebGlTextureFactory implements ITextureFactory {
168
168
  return texture;
169
169
  }
170
170
 
171
- // Fill CPU-side pixels (BGRA layout to match TextureFormat.BGRA_8_Unorm usage elsewhere).
171
+ // Fill CPU-side pixels in RGBA order. WebGL uploads these bytes as gl.RGBA.
172
172
  const byteSize = width * height * 4;
173
173
  const bytes = new Uint8Array(byteSize);
174
174
 
175
175
  for (let i = 0; i < byteSize; i += 4) {
176
- bytes[i + 0] = color.b * 255;
176
+ bytes[i] = color.r * 255;
177
177
  bytes[i + 1] = color.g * 255;
178
- bytes[i + 2] = color.r * 255;
178
+ bytes[i + 2] = color.b * 255;
179
179
  bytes[i + 3] = color.a * 255;
180
180
  }
181
181
 
@@ -1,5 +1,5 @@
1
1
  import { WebGlConverter } from "./WebGlConverter.ts";
2
- import type {BufferUsage} from "ris-framework-api";
2
+ import type {BufferUsage} from "../../api/index.ts";
3
3
 
4
4
  /**
5
5
  * This file contains utility functions for working with WebGL buffers,
@@ -1,8 +1,16 @@
1
- import {Culling} from "../../core/renderer/enums";
1
+ import {Culling} from "../../api/rendering/enums.ts";
2
2
  import {BlendFactor, BlendOperation} from "../../core/rendering/blending/enums";
3
- import {CullMode, FrontFace, PrimitiveTopology} from "../../core/rendering/primitive/enums";
4
- import {VertexFormat} from "../../VertexFormat.ts";
5
- import {BufferUsage, MipMapSamplerFilter, SamplerAddressMode, SamplerFilter, TextureFormat} from "ris-framework-api";
3
+ import {VertexFormat} from "../../api/geometry/VertexFormat.ts";
4
+ import {
5
+ BufferUsage,
6
+ CullMode,
7
+ FrontFace,
8
+ MipMapSamplerFilter,
9
+ PrimitiveTopology,
10
+ SamplerAddressMode,
11
+ SamplerFilter,
12
+ TextureFormat
13
+ } from "../../api/index.ts";
6
14
 
7
15
  export class WebGlConverter {
8
16
 
@@ -36,6 +44,8 @@ export class WebGlConverter {
36
44
  return WebGL2RenderingContext.LINE_STRIP;
37
45
  case PrimitiveTopology.POINT_LIST:
38
46
  return WebGL2RenderingContext.POINTS;
47
+ case PrimitiveTopology.TRIANGLE_STRIP:
48
+ return WebGL2RenderingContext.TRIANGLE_STRIP;
39
49
  default:
40
50
  throw new Error("Method not implemented.");
41
51
  }
@@ -93,8 +103,8 @@ export class WebGlConverter {
93
103
  return bufferUsage;
94
104
  }
95
105
  /**
96
- * Conversts BlendOperation to WebGL enum.
97
- * @parma gl The WebGL2RenderingContext.
106
+ * Converts BlendOperation to WebGL enum.
107
+ * @param gl The WebGL2RenderingContext.
98
108
  * @param blendOperation The BlendOperation.
99
109
  * @return The WebGL enum.
100
110
  */
@@ -227,6 +237,7 @@ export class WebGlConverter {
227
237
  public static convertToTextureType(gl: WebGL2RenderingContext, textureFormat: TextureFormat): number {
228
238
  switch (textureFormat) {
229
239
  case TextureFormat.RGBA_8_UNORM:
240
+ case TextureFormat.RGBA_8_UNORM_SRGB:
230
241
  return gl.UNSIGNED_BYTE;
231
242
  case TextureFormat.DEPTH_32_FLOAT:
232
243
  return gl.FLOAT;
@@ -237,61 +248,6 @@ export class WebGlConverter {
237
248
  }
238
249
  }
239
250
 
240
- /**
241
- * Converts SamplerMinFilter to WebGL enum.
242
- * @param gl The WebGL2RenderingContext.
243
- * @param minFilter The SamplerMinFilter.
244
- * @param mipMapFilter The MipmapSamplerFilter.
245
- * @returns The WebGL enum.
246
- */
247
- public static convertToMinFilter(gl: WebGL2RenderingContext,
248
- minFilter: SamplerFilter,
249
- mipMapFilter: MipMapSamplerFilter): number {
250
- if (mipMapFilter == MipMapSamplerFilter.NONE) {
251
- return this.convertMagFilter(gl, minFilter);
252
- }
253
-
254
- if (minFilter == SamplerFilter.NEAREST) {
255
- switch (mipMapFilter) {
256
- case MipMapSamplerFilter.NEAREST:
257
- return gl.NEAREST_MIPMAP_NEAREST;
258
- case MipMapSamplerFilter.LINEAR:
259
- return gl.NEAREST_MIPMAP_LINEAR;
260
- default:
261
- throw new Error("NotImplementedException");
262
- }
263
- }
264
- else if (minFilter == SamplerFilter.LINEAR) {
265
- switch (mipMapFilter) {
266
- case MipMapSamplerFilter.NEAREST:
267
- return gl.LINEAR_MIPMAP_NEAREST;
268
- case MipMapSamplerFilter.LINEAR:
269
- return gl.LINEAR_MIPMAP_LINEAR;
270
- default:
271
- throw new Error("NotImplementedException");
272
- }
273
- }
274
-
275
- throw new Error("NotImplementedException");
276
- }
277
-
278
- /**
279
- * Converts SamplerMagFilter to WebGL enum.
280
- * @param gl The WebGL2RenderingContext.
281
- * @param magFilter The SamplerMagFilter.
282
- * @returns The WebGL enum.
283
- */
284
- public static convertToMagFilter(gl: WebGL2RenderingContext, magFilter: SamplerFilter): number {
285
- switch (magFilter) {
286
- case SamplerFilter.NEAREST:
287
- return gl.NEAREST;
288
- case SamplerFilter.LINEAR:
289
- return gl.LINEAR;
290
- default:
291
- throw new Error("NotImplementedException");
292
- }
293
- }
294
-
295
251
  /**
296
252
  * Converts VertexFormat to the number of components for WebGL vertex attribute pointer.
297
253
  * @param vertexFormat The VertexFormat.
@@ -338,7 +294,7 @@ export class WebGlConverter {
338
294
  * @param mipMapFilter The MipmapSamplerFilter.
339
295
  * @returns The WebGL enum.
340
296
  */
341
- public static convertMinFIlter(gl: WebGL2RenderingContext, filter: SamplerFilter, mipMapFilter: MipMapSamplerFilter): number {
297
+ public static convertMinFilter(gl: WebGL2RenderingContext, filter: SamplerFilter, mipMapFilter: MipMapSamplerFilter): number {
342
298
 
343
299
  if (mipMapFilter == MipMapSamplerFilter.NONE) {
344
300
  return this.convertMagFilter(gl, filter);
@@ -382,6 +338,7 @@ export class WebGlConverter {
382
338
  case SamplerAddressMode.MIRROR_REPEAT:
383
339
  return gl.MIRRORED_REPEAT;
384
340
  case SamplerAddressMode.CLAMP_TO_BORDER:
341
+ // WebGL2 has no clamp-to-border wrap mode. Clamp to edge is the closest match.
385
342
  return gl.CLAMP_TO_EDGE;
386
343
  default:
387
344
  throw new Error("NotImplementedException");
@@ -1,4 +1,4 @@
1
- import {TextureFormat} from "ris-framework-api";
1
+ import {TextureFormat} from "../../api/index.ts";
2
2
 
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { SamplerCompareFunction } from '../../common/sampler-enums';
1
+ import { SamplerCompareFunction } from '../../api/rendering/sampler/sampler-enums';
2
2
  import { SpectorJSUtilities } from './spector-js-utilities';
3
3
  import { WebGlConverter } from './WebGlConverter.ts';
4
- import {MipMapSamplerFilter, SamplerAddressMode, SamplerFilter} from "ris-framework-api";
4
+ import {MipMapSamplerFilter, SamplerAddressMode, SamplerFilter} from "../../api/index.ts";
5
5
 
6
6
  /**
7
7
  * The utility class for working with WebGLSampler object.
@@ -20,7 +20,7 @@ export class WebGlSamplerUtilities {
20
20
  * @param compareFunction The compare function of the sampler. This is used for shadow samplers.
21
21
  * @param _anisotropy The anisotropy level of the sampler. This is used for anisotropic filtering. The default value is 1, which means no anisotropic filtering.
22
22
  * @param label The label of the sampler. This is used for debugging purposes and can be viewed in graphics debuggers like SpectorJS.
23
- * @returns
23
+ * @returns The created WebGLSampler.
24
24
  */
25
25
  public create(gl: WebGL2RenderingContext,
26
26
  minFilter: SamplerFilter = SamplerFilter.LINEAR,
@@ -35,7 +35,7 @@ export class WebGlSamplerUtilities {
35
35
  {
36
36
  const sampler = gl.createSampler();
37
37
 
38
- const glMinFilter = WebGlConverter.convertMinFIlter(gl, minFilter, mipMapFilter);
38
+ const glMinFilter = WebGlConverter.convertMinFilter(gl, minFilter, mipMapFilter);
39
39
  const glMagFilter = WebGlConverter.convertMagFilter(gl, magFilter);
40
40
  const glAddressModeU = WebGlConverter.convertAddressMode(gl, addressModeU);
41
41
  const glAddressModeV = WebGlConverter.convertAddressMode(gl, addressModeV);
@@ -1,5 +1,5 @@
1
1
  import {WebGlConverter} from "./WebGlConverter.ts";
2
- import {TextureFormat} from "ris-framework-api";
2
+ import {AlignUtilities, TextureFormat} from "../../api/index.ts";
3
3
  import {vec2} from "gl-matrix";
4
4
 
5
5
  /**
@@ -13,7 +13,7 @@ export class WebGlTextureUtilities {
13
13
  * @param width The width of the texture.
14
14
  * @param height The height of the texture.
15
15
  * @param data The texture data. If null, an uninitialized texture will be created.
16
- * @param textureFormat The format of the texture. If not specified, BGRA_8_UNORM will be used.
16
+ * @param textureFormat The format of the texture. If not specified, RGBA_8_UNORM will be used.
17
17
  * @param useMipMaps True to generate mipmaps for the texture, false otherwise. By default, it is false.
18
18
  * @param anisotropy The level of anisotropic filtering to use when sampling the texture. A value of 1 means no anisotropic filtering, while higher values (e.g., 4, 8, 16) indicate increasing levels of anisotropic filtering. By default, it is 1 (no anisotropic filtering).
19
19
  * @param label The label for the texture. This can be used for debugging purposes to identify the texture in graphics debuggers.
@@ -51,7 +51,7 @@ export class WebGlTextureUtilities {
51
51
 
52
52
  gl.texStorage2D(gl.TEXTURE_2D, mipLevels, internalFormat, width, height);
53
53
 
54
- if(data) {
54
+ if (data) {
55
55
  for (let i = 0; i < mipLevels; i++) {
56
56
 
57
57
  const mipLevelData = data[i];
@@ -64,11 +64,9 @@ export class WebGlTextureUtilities {
64
64
  gl.texSubImage2D(gl.TEXTURE_2D, i, 0, 0, levelWidth, levelHeight, format, gl.UNSIGNED_BYTE, mipLevelData);
65
65
  } else if (mipLevelData) {
66
66
  gl.texSubImage2D(gl.TEXTURE_2D, i, 0, 0, levelWidth, levelHeight, format, gl.UNSIGNED_BYTE, mipLevelData);
67
- }
68
- else if(!mipLevelData) {
67
+ } else if (!mipLevelData) {
69
68
  // If not must be empty array, so we can safely ignore it.
70
- }
71
- else {
69
+ } else {
72
70
  throw new Error("unsupported data type");
73
71
  }
74
72
  }
@@ -94,14 +92,14 @@ export class WebGlTextureUtilities {
94
92
  * @param dimension The dimensions of the texture.
95
93
  * @param blockSize The block size of a compressed format.
96
94
  * @param data The texture data. If null, an uninitialized texture will be created.
97
- * @param textureFormat The format of the texture. If not specified, BGRA_8_UNORM will be used.
98
- * @param anisotropy The level of anisotropic filtering to use when sampling the texture. A value of 1 means no anisotropic filtering, while higher values (e.g., 4, 8, 16) indicate increasing levels of anisotropic filtering. By default, it is 1 (no anisotropic filtering).
99
95
  * @param label The label for the texture. This can be used for debugging purposes to identify the texture in graphics debuggers.
96
+ * @param textureFormat The format of the texture. If not specified, RGBA_8_UNORM will be used.
97
+ * @param anisotropy The level of anisotropic filtering to use when sampling the texture. A value of 1 means no anisotropic filtering, while higher values (e.g., 4, 8, 16) indicate increasing levels of anisotropic filtering. By default, it is 1 (no anisotropic filtering).
100
98
  * @returns The created WebGL texture.
101
99
  */
102
100
  public createCompressedTexture2D(
103
101
  gl: WebGL2RenderingContext,
104
- dimension: vec2, _blockSize: vec2,
102
+ dimension: vec2, blockSize: vec2,
105
103
  data: Uint8Array[] | null = null,
106
104
  label: string | null = null,
107
105
  textureFormat = TextureFormat.RGBA_8_UNORM,
@@ -111,7 +109,6 @@ export class WebGlTextureUtilities {
111
109
  const baseWidth = dimension[0];
112
110
  const baseHeight = dimension[1];
113
111
  const mipLevels = data?.length ?? 1;
114
-
115
112
  const texture = gl.createTexture();
116
113
 
117
114
  if (label != null) {
@@ -124,9 +121,12 @@ export class WebGlTextureUtilities {
124
121
 
125
122
  const internalFormat = WebGlConverter.convertInternalFormat(gl, textureFormat);
126
123
 
127
- gl.texStorage2D(gl.TEXTURE_2D, mipLevels, internalFormat, baseWidth, baseHeight);
124
+ const useTexStorage = baseWidth % blockSize[0] == 0 && baseHeight % blockSize[1] == 0;
125
+ if (useTexStorage) {
126
+ gl.texStorage2D(gl.TEXTURE_2D, mipLevels, internalFormat, baseWidth, baseHeight);
127
+ }
128
128
 
129
- if(data && data.length > 0) {
129
+ if (data && data.length > 0) {
130
130
 
131
131
  let width = baseWidth;
132
132
  let height = baseHeight;
@@ -136,20 +136,24 @@ export class WebGlTextureUtilities {
136
136
  const mipLevelData = data[i];
137
137
 
138
138
  if (mipLevelData instanceof Uint8Array) {
139
- gl.compressedTexSubImage2D(gl.TEXTURE_2D, i, 0, 0, width, height, internalFormat, mipLevelData, 0);
139
+ if (useTexStorage) {
140
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, i, 0, 0, width, height, internalFormat, mipLevelData, 0);
141
+ } else {
142
+ const alignedWidth = AlignUtilities.align(width, blockSize[0]);
143
+ const alignedHeight = AlignUtilities.align(height, blockSize[1]);
144
+ gl.compressedTexImage2D(gl.TEXTURE_2D, i, internalFormat, alignedWidth, alignedHeight, 0, mipLevelData, 0);
145
+ }
140
146
  } else {
141
147
  throw new Error("unsupported data type");
142
148
  }
143
149
 
144
- width /= 2;
145
- height /= 2;
150
+ width = Math.max(1, Math.floor(width / 2));
151
+ height = Math.max(1, Math.floor(height / 2));
146
152
  }
147
153
  }
148
154
 
149
- // Generate mipmaps.
150
- if (mipLevels > 1) {
151
- gl.generateMipmap(gl.TEXTURE_2D);
152
- }
155
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
156
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
153
157
 
154
158
  // Set anisotropy.
155
159
  if (anisotropy > 1.0) {
@@ -157,6 +161,11 @@ export class WebGlTextureUtilities {
157
161
  //OpenGLESUtilities.Anisotropy.SetAnisotropy(gl, texture, anisotropy);
158
162
  }
159
163
 
164
+ const error = gl.getError();
165
+ if (error != gl.NO_ERROR) {
166
+ throw new Error("WebGlTextureUtilities error " + error.toString());
167
+ }
168
+
160
169
  return texture;
161
170
  }
162
171
  }
@@ -1,4 +1,4 @@
1
- import { Culling } from "../../core/renderer/enums";
1
+ import { Culling } from "../../api/rendering/enums.ts";
2
2
  import { WebGlConverter } from "./WebGlConverter.ts";
3
3
 
4
4
  /**
@@ -12,7 +12,7 @@ export class WebGLFilterAnisotropicUtilities {
12
12
  /**
13
13
  * Gets the max anisotropy.
14
14
  * @param gl The WebGL2 rendering context.
15
- * @returns The maximum supported level of anisotropic filtering. <c>0</c> if not supported.
15
+ * @returns The maximum supported level of anisotropic filtering. `0` if not supported.
16
16
  */
17
17
  public getMaxAnisotropy(gl: WebGL2RenderingContext): number {
18
18
  this._extension = gl.getExtension(this.MAX_ANISOTROPY_EXT);
@@ -1,4 +1,4 @@
1
- import type { TextureFormat } from "ris-framework-api";
1
+ import type { TextureFormat } from "../../api/index.ts";
2
2
  import { SpectorJSUtilities } from "./spector-js-utilities";
3
3
  import { WebGlConverter } from "./WebGlConverter.ts";
4
4
 
@@ -1 +0,0 @@
1
- function e(){throw new Error("ris-ktx2 Node loader is not included in the browser build.")}function r(){throw new Error("ris-ktx2 Node file loader is not included in the browser build.")}export{e as createKtxModuleNode,r as readFileBytes};
Binary file
@@ -1 +0,0 @@
1
- :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.vanilla:hover{filter:drop-shadow(0 0 2em #3178c6aa)}.card{padding:2em}.read-the-docs{color:#888}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}