ris-framework 0.2.0-dev.11 → 0.2.0-dev.13

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 (257) hide show
  1. package/CHANGELOG.md +21 -29
  2. package/README.md +99 -150
  3. package/dist/Framework.d.ts +26 -8
  4. package/dist/Framework.d.ts.map +1 -1
  5. package/dist/api/IFramework.d.ts +43 -0
  6. package/dist/api/IFramework.d.ts.map +1 -1
  7. package/dist/api/_export.d.ts +1 -1
  8. package/dist/api/_export.d.ts.map +1 -1
  9. package/dist/api/content/ContentManager.d.ts +5 -57
  10. package/dist/api/content/ContentManager.d.ts.map +1 -1
  11. package/dist/api/content/IContentManager.d.ts +24 -21
  12. package/dist/api/content/IContentManager.d.ts.map +1 -1
  13. package/dist/api/lights/LightsBuffer.d.ts +13 -6
  14. package/dist/api/lights/LightsBuffer.d.ts.map +1 -1
  15. package/dist/api/loaders/ObjGeometryMapper.d.ts +2 -2
  16. package/dist/api/loaders/ObjLoader.d.ts +61 -0
  17. package/dist/api/loaders/ObjLoader.d.ts.map +1 -0
  18. package/dist/api/loaders/_export.d.ts +1 -0
  19. package/dist/api/loaders/_export.d.ts.map +1 -1
  20. package/dist/api/loaders/obj/{ObjLoader.d.ts → ObjParser.d.ts} +20 -5
  21. package/dist/api/loaders/obj/ObjParser.d.ts.map +1 -0
  22. package/dist/api/loaders/obj/ObjTypes.d.ts +17 -1
  23. package/dist/api/loaders/obj/ObjTypes.d.ts.map +1 -1
  24. package/dist/api/loaders/obj/index.d.ts +1 -1
  25. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts +22 -11
  26. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts.map +1 -1
  27. package/dist/api/material/ICameraMaterial.d.ts +18 -0
  28. package/dist/api/material/ICameraMaterial.d.ts.map +1 -0
  29. package/dist/api/material/ILightsMaterial.d.ts +26 -0
  30. package/dist/api/material/ILightsMaterial.d.ts.map +1 -0
  31. package/dist/api/material/IMaterial.d.ts +2 -8
  32. package/dist/api/material/IMaterial.d.ts.map +1 -1
  33. package/dist/api/material/InspectTextureMipsMaterial.d.ts +2 -2
  34. package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -1
  35. package/dist/api/material/SpriteMaterial.d.ts +2 -2
  36. package/dist/api/material/SpriteMaterial.d.ts.map +1 -1
  37. package/dist/api/material/UnlitMaterial.d.ts +4 -3
  38. package/dist/api/material/UnlitMaterial.d.ts.map +1 -1
  39. package/dist/api/material/_export.d.ts +2 -0
  40. package/dist/api/material/_export.d.ts.map +1 -1
  41. package/dist/api/meshes/IMesh.d.ts +29 -34
  42. package/dist/api/meshes/IMesh.d.ts.map +1 -1
  43. package/dist/api/meshes/IMeshFactory.d.ts +13 -8
  44. package/dist/api/meshes/IMeshFactory.d.ts.map +1 -1
  45. package/dist/api/meshes/IRenderableMesh.d.ts +47 -0
  46. package/dist/api/meshes/IRenderableMesh.d.ts.map +1 -0
  47. package/dist/api/meshes/Mesh.d.ts +11 -57
  48. package/dist/api/meshes/Mesh.d.ts.map +1 -1
  49. package/dist/api/meshes/MeshFactory.d.ts +6 -3
  50. package/dist/api/meshes/MeshFactory.d.ts.map +1 -1
  51. package/dist/api/meshes/QuadMesh.d.ts +3 -5
  52. package/dist/api/meshes/QuadMesh.d.ts.map +1 -1
  53. package/dist/api/meshes/RenderableMesh.d.ts +95 -0
  54. package/dist/api/meshes/RenderableMesh.d.ts.map +1 -0
  55. package/dist/api/meshes/_export.d.ts +2 -1
  56. package/dist/api/meshes/_export.d.ts.map +1 -1
  57. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +8 -2
  58. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -1
  59. package/dist/api/rendering/IRenderer.d.ts +28 -1
  60. package/dist/api/rendering/IRenderer.d.ts.map +1 -1
  61. package/dist/api/rendering/enums.d.ts +7 -0
  62. package/dist/api/rendering/enums.d.ts.map +1 -1
  63. package/dist/api/rendering/renderer-interface.d.ts +1 -31
  64. package/dist/api/rendering/renderer-interface.d.ts.map +1 -1
  65. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +2 -6
  66. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -1
  67. package/dist/api/rendering/swapchain/ISwapChain.d.ts +1 -3
  68. package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -1
  69. package/dist/api/rendering/texture/TextureFormat.d.ts +88 -14
  70. package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -1
  71. package/dist/api/rendering/texture/TextureUtilities.d.ts +23 -0
  72. package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -1
  73. package/dist/api/scene/Scene.d.ts +30 -21
  74. package/dist/api/scene/Scene.d.ts.map +1 -1
  75. package/dist/api/scene/SceneMesh.d.ts +27 -0
  76. package/dist/api/scene/SceneMesh.d.ts.map +1 -0
  77. package/dist/api/utilities/AlignUtilities.d.ts.map +1 -1
  78. package/dist/api/window/WindowManager.d.ts.map +1 -1
  79. package/dist/core/rendering/ARenderer.d.ts +5 -5
  80. package/dist/core/rendering/ARenderer.d.ts.map +1 -1
  81. package/dist/index.d.ts +0 -1
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +4006 -1355
  84. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +4 -0
  85. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -1
  86. package/dist/webgl/WebGlRenderer.d.ts +1 -3
  87. package/dist/webgl/WebGlRenderer.d.ts.map +1 -1
  88. package/dist/webgl/lights/WebGlLightsBuffer.d.ts +8 -4
  89. package/dist/webgl/lights/WebGlLightsBuffer.d.ts.map +1 -1
  90. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +2 -0
  91. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
  92. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +3 -2
  93. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -1
  94. package/dist/webgl/texture/WebGlTextureFactory.d.ts +7 -0
  95. package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
  96. package/dist/webgl/utilities/WebGlConstants.d.ts +91 -0
  97. package/dist/webgl/utilities/WebGlConstants.d.ts.map +1 -0
  98. package/dist/webgl/utilities/WebGlConverter.d.ts +0 -7
  99. package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -1
  100. package/dist/webgl/utilities/WebGlErrorUtilities.d.ts +10 -0
  101. package/dist/webgl/utilities/WebGlErrorUtilities.d.ts.map +1 -0
  102. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
  103. package/dist/webgl/utilities/WebGlUtilities.d.ts +3 -0
  104. package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -1
  105. package/dist/webgpu/WebGpuGpuInfo.d.ts +28 -0
  106. package/dist/webgpu/WebGpuGpuInfo.d.ts.map +1 -0
  107. package/dist/webgpu/WebGpuGraphicsDevice.d.ts +80 -0
  108. package/dist/webgpu/WebGpuGraphicsDevice.d.ts.map +1 -0
  109. package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts +26 -0
  110. package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts.map +1 -0
  111. package/dist/webgpu/WebGpuRenderer.d.ts +26 -0
  112. package/dist/webgpu/WebGpuRenderer.d.ts.map +1 -0
  113. package/dist/webgpu/WebGpuTypes.d.ts +355 -0
  114. package/dist/webgpu/WebGpuTypes.d.ts.map +1 -0
  115. package/dist/webgpu/blending/WebGpuBlendState.d.ts +30 -0
  116. package/dist/webgpu/blending/WebGpuBlendState.d.ts.map +1 -0
  117. package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts +20 -0
  118. package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts.map +1 -0
  119. package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts +46 -0
  120. package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts.map +1 -0
  121. package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts +43 -0
  122. package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts.map +1 -0
  123. package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts +49 -0
  124. package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts.map +1 -0
  125. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts +32 -0
  126. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts.map +1 -0
  127. package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts +28 -0
  128. package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts.map +1 -0
  129. package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts +50 -0
  130. package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts.map +1 -0
  131. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts +34 -0
  132. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts.map +1 -0
  133. package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts +26 -0
  134. package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts.map +1 -0
  135. package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts +72 -0
  136. package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts.map +1 -0
  137. package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts +40 -0
  138. package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts.map +1 -0
  139. package/dist/webgpu/sampler/WebGpuSampler.d.ts +39 -0
  140. package/dist/webgpu/sampler/WebGpuSampler.d.ts.map +1 -0
  141. package/dist/webgpu/shader/WebGpuShaderModule.d.ts +29 -0
  142. package/dist/webgpu/shader/WebGpuShaderModule.d.ts.map +1 -0
  143. package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts +21 -0
  144. package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts.map +1 -0
  145. package/dist/webgpu/shader/WgslShaderContent.d.ts +9 -0
  146. package/dist/webgpu/shader/WgslShaderContent.d.ts.map +1 -0
  147. package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts +41 -0
  148. package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts.map +1 -0
  149. package/dist/webgpu/texture/WebGpuTexture2D.d.ts +47 -0
  150. package/dist/webgpu/texture/WebGpuTexture2D.d.ts.map +1 -0
  151. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts +21 -0
  152. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts.map +1 -0
  153. package/dist/webgpu/texture/WebGpuTextureView.d.ts +25 -0
  154. package/dist/webgpu/texture/WebGpuTextureView.d.ts.map +1 -0
  155. package/dist/webgpu/utilities/WebGpuConverter.d.ts +45 -0
  156. package/dist/webgpu/utilities/WebGpuConverter.d.ts.map +1 -0
  157. package/package.json +2 -2
  158. package/shaders/glsl/main_render_target_flip_y_fs.glsl +35 -1
  159. package/shaders/wgsl/forward_blinn_phong_material.wgsl +150 -0
  160. package/shaders/wgsl/inspect_texture_mips.wgsl +51 -0
  161. package/shaders/wgsl/main_frame_buffer.wgsl +35 -0
  162. package/shaders/wgsl/main_render_target_flip_y.wgsl +35 -0
  163. package/shaders/wgsl/sprite.wgsl +40 -0
  164. package/shaders/wgsl/unlit_material.wgsl +49 -0
  165. package/src/Framework.ts +121 -37
  166. package/src/api/IFramework.ts +55 -0
  167. package/src/api/_export.ts +1 -1
  168. package/src/api/content/ContentManager.ts +46 -180
  169. package/src/api/content/IContentManager.ts +25 -21
  170. package/src/api/lights/LightsBuffer.ts +13 -6
  171. package/src/api/loaders/ObjGeometryMapper.ts +2 -2
  172. package/src/api/loaders/ObjLoader.ts +126 -0
  173. package/src/api/loaders/_export.ts +1 -0
  174. package/src/api/loaders/obj/{ObjLoader.ts → ObjParser.ts} +35 -4
  175. package/src/api/loaders/obj/ObjTypes.ts +19 -1
  176. package/src/api/loaders/obj/index.ts +1 -1
  177. package/src/api/material/ForwardBlinnPhongMaterial.ts +48 -22
  178. package/src/api/material/ICameraMaterial.ts +22 -0
  179. package/src/api/material/ILightsMaterial.ts +32 -0
  180. package/src/api/material/IMaterial.ts +2 -9
  181. package/src/api/material/InspectTextureMipsMaterial.ts +2 -2
  182. package/src/api/material/SpriteMaterial.ts +2 -2
  183. package/src/api/material/UnlitMaterial.ts +4 -3
  184. package/src/api/material/_export.ts +2 -0
  185. package/src/api/meshes/IMesh.ts +32 -37
  186. package/src/api/meshes/IMeshFactory.ts +14 -8
  187. package/src/api/meshes/IRenderableMesh.ts +58 -0
  188. package/src/api/meshes/Mesh.ts +17 -132
  189. package/src/api/meshes/MeshFactory.ts +14 -5
  190. package/src/api/meshes/QuadMesh.ts +4 -6
  191. package/src/api/meshes/RenderableMesh.ts +207 -0
  192. package/src/api/meshes/_export.ts +6 -5
  193. package/src/api/rendering/IGraphicsDeviceFeatures.ts +28 -21
  194. package/src/api/rendering/IRenderer.ts +34 -1
  195. package/src/api/rendering/enums.ts +10 -0
  196. package/src/api/rendering/renderer-interface.ts +1 -36
  197. package/src/api/rendering/renderpass/RenderPassDescriptor.ts +10 -14
  198. package/src/api/rendering/swapchain/ISwapChain.ts +1 -3
  199. package/src/api/rendering/texture/TextureFormat.ts +128 -14
  200. package/src/api/rendering/texture/TextureUtilities.ts +225 -10
  201. package/src/api/scene/Scene.ts +102 -69
  202. package/src/api/scene/SceneMesh.ts +61 -0
  203. package/src/api/sprites/SpriteBatchMesh.ts +1 -1
  204. package/src/api/utilities/AlignUtilities.ts +2 -1
  205. package/src/api/window/WindowManager.ts +1 -1
  206. package/src/core/rendering/ARenderer.ts +24 -15
  207. package/src/index.ts +0 -1
  208. package/src/main.ts +2 -3
  209. package/src/webgl/WebGLGraphicsDeviceFeatures.ts +12 -2
  210. package/src/webgl/WebGlGpuInfo.ts +1 -1
  211. package/src/webgl/WebGlRenderer.ts +2 -5
  212. package/src/webgl/lights/WebGlLightsBuffer.ts +14 -4
  213. package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +18 -1
  214. package/src/webgl/swap-chain/WebGlSwapChain.ts +7 -6
  215. package/src/webgl/texture/WebGlTextureFactory.ts +49 -7
  216. package/src/webgl/utilities/WebGlConstants.ts +136 -0
  217. package/src/webgl/utilities/WebGlConverter.ts +91 -22
  218. package/src/webgl/utilities/WebGlErrorUtilities.ts +15 -0
  219. package/src/webgl/utilities/WebGlTextureUtilities.ts +5 -2
  220. package/src/webgl/utilities/WebGlUtilities.ts +4 -0
  221. package/src/webgpu/WebGpuGpuInfo.ts +61 -0
  222. package/src/webgpu/WebGpuGraphicsDevice.ts +199 -0
  223. package/src/webgpu/WebGpuGraphicsDeviceFeatures.ts +41 -0
  224. package/src/webgpu/WebGpuRenderer.ts +49 -0
  225. package/src/webgpu/WebGpuTypes.ts +288 -0
  226. package/src/webgpu/blending/WebGpuBlendState.ts +53 -0
  227. package/src/webgpu/buffers/WebGpuBuffersFactory.ts +46 -0
  228. package/src/webgpu/buffers/WebGpuIndexBuffer.ts +118 -0
  229. package/src/webgpu/buffers/WebGpuUniformBuffer.ts +102 -0
  230. package/src/webgpu/buffers/WebGpuVertexBuffer.ts +119 -0
  231. package/src/webgpu/primitive/WebGpuPrimitiveState.ts +52 -0
  232. package/src/webgpu/render-pass/WebGpuRenderPass.ts +131 -0
  233. package/src/webgpu/render-pipelines/AWebGpuRenderPipeline.ts +123 -0
  234. package/src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts +119 -0
  235. package/src/webgpu/render-pipelines/WebGpuRenderPipelineFactory.ts +66 -0
  236. package/src/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.ts +249 -0
  237. package/src/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.ts +101 -0
  238. package/src/webgpu/sampler/WebGpuSampler.ts +84 -0
  239. package/src/webgpu/shader/WebGpuShaderModule.ts +65 -0
  240. package/src/webgpu/shader/WebGpuShaderModuleLoader.ts +38 -0
  241. package/src/webgpu/shader/WgslShaderContent.ts +20 -0
  242. package/src/webgpu/swap-chain/WebGpuSwapChain.ts +93 -0
  243. package/src/webgpu/texture/WebGpuTexture2D.ts +197 -0
  244. package/src/webgpu/texture/WebGpuTextureFactory.ts +118 -0
  245. package/src/webgpu/texture/WebGpuTextureView.ts +43 -0
  246. package/src/webgpu/utilities/WebGpuConverter.ts +299 -0
  247. package/src/wgsl-raw.d.ts +4 -0
  248. package/dist/api/FrameworkConfiguration.d.ts +0 -23
  249. package/dist/api/FrameworkConfiguration.d.ts.map +0 -1
  250. package/dist/api/IFrameworkConfiguration.d.ts +0 -25
  251. package/dist/api/IFrameworkConfiguration.d.ts.map +0 -1
  252. package/dist/api/loaders/obj/ObjLoader.d.ts.map +0 -1
  253. package/dist/api/meshes/SubMesh.d.ts +0 -47
  254. package/dist/api/meshes/SubMesh.d.ts.map +0 -1
  255. package/src/api/FrameworkConfiguration.ts +0 -29
  256. package/src/api/IFrameworkConfiguration.ts +0 -30
  257. package/src/api/meshes/SubMesh.ts +0 -71
package/CHANGELOG.md CHANGED
@@ -9,44 +9,36 @@ Compared with `main` (0.1.0).
9
9
 
10
10
  ### Breaking changes
11
11
 
12
- - **tsyringe and reflect-metadata removed.** Services are created by `Framework` and get their dependencies through constructors. Consumers no longer need `reflect-metadata` or decorator settings.
13
- - **Perspective camera.** `cameraFactory.createPerspectiveCamera(descriptor?, scene?)` takes a `PerspectiveCameraDescriptor` (`fov` in degrees, `aspectRatio`, `near`, `far`, `eye`, `target`, `up`) instead of `(fov, aspectRatio, near, far)`. The `PerspectiveCamera` constructor is `(framework, descriptor?, scene?)` instead of `(framework, fov, aspectRatio, nearPlane, farPlane)`.
14
- - **`ICamera.positionBuffer`.** This new member is required (std140 world-space eye). Custom `ICamera` implementations must provide it. `PerspectiveCamera`, `OrthographicCamera` and `OrbitCamera` implement it.
15
- - **Meshes.** `meshFactory.create(scene, geometry, material)` replaces `create(geometry, geometryFormat)`. The `Mesh` constructor is `(framework, scene, material?)` instead of `(framework)`. The `QuadMesh` constructor is `(framework, scene, material, isUpdatable, scale?)`.
16
- - **Materials.** `IMaterial.modelMatrix` is replaced by `IMaterial.modelBuffer`. The mesh owns the model buffer and assigns it before drawing. `UnlitMaterial` and `InspectTextureMipsMaterial` no longer create their own model buffer. They create their render pipeline once a model buffer is assigned, and rendering without one throws.
17
- - **Render pipelines.** `createUnlitRenderPipeline` and `createInspectTextureMipsRenderPipeline` throw when no model buffer is passed.
12
+ - `FrameworkConfiguration` is no longer exported; pass an `IFrameworkConfiguration` object to `new Framework(...)`.
13
+ - `tsyringe` and `reflect-metadata` are removed; services use plain constructor wiring.
14
+ - `cameraFactory.createPerspectiveCamera` takes a descriptor object, and every `ICamera` now requires a `positionBuffer`.
15
+ - Meshes are split into `IMesh`/`Mesh` (geometry and buffers) and `IRenderableMesh`/`RenderableMesh` (material, index range, sub meshes, transform).
16
+ - Materials take a `modelBuffer` owned by the mesh instead of `modelMatrix`, and `renderMesh` takes an `IRenderableMesh`.
17
+ - Render pipelines throw when no model buffer is passed.
18
+ - Requires `ris-ktx2` 0.2.
18
19
 
19
20
  ### Added
20
21
 
21
- - `Scene` holds meshes, lights and the active camera. `scene.add(item)` and `scene.remove(item)` accept a mesh, `AmbientLight`, `DirectionalLight`, `PointLight` or camera. Adding the same item twice does nothing. Meshes, lights and the perspective camera given a scene in their constructor add themselves, and a disposed mesh removes itself. Removing the active camera clears `scene.camera`. `scene.update(time)` assigns the camera to materials and uploads changed lights. `scene.render()` draws every mesh.
22
- - Lights: `AmbientLight`, `DirectionalLight` and `PointLight` (constant, linear and quadratic attenuation) are plain data classes with descriptors, `intensity`, auto-assigned ids and an optional `scene` constructor argument. `LightsBuffer` is a std140 lights buffer with configurable directional and point light slots, and it uploads only when light data changed. `framework.lightsFactory` creates them.
23
- - `ForwardBlinnPhongMaterial` with ambient, diffuse and Blinn-Phong specular lighting from directional and point lights. Normals use the normal matrix, so non-uniform scale is handled. Specular colour and shininess come from MTL `Ks` and `Ns`, and shader variants are cached per light count. Its descriptor requires `projectionViewBuffer` and `cameraPositionBuffer`, and `materialFactory.createForwardBlinnPhongMaterial(descriptor)` creates it.
24
- - Mesh transforms: `mesh.position`, `mesh.rotation` (Euler radians, applied Y, then X, then Z), `mesh.scale` and a lazily computed `mesh.modelMatrix` / `mesh.modelBuffer`. Submeshes use their parent's transform.
25
- - Submeshes: one mesh can draw several index ranges, each with its own material (`mesh.addSubMesh`, `meshFactory.createWithSubMeshes`).
26
- - OBJ/MTL loading:
27
- - `ObjLoader` is framework-independent and produces plain definitions. `ObjLoader.loadAsync(path, options)` supports `resolveMaterialUrl` and `ignoreMaterials`.
28
- - `content.loadMeshAsync(path, scene)` loads a mesh with unlit materials, and `content.loadBlinnPhongMeshAsync(path, scene)` loads one with Blinn-Phong materials.
29
- - `geometryBuilder.create(descriptor)` with `GeometryDescriptor`. `BaseGeometry` is exported.
30
- - `SpriteMaterial` and `materialFactory.createSpriteMaterial`; sprite batches draw through it.
31
- - `UnlitMaterialDescriptor.camera` and a `camera` property on the unlit and Blinn-Phong materials. A scene assigns its camera through this property.
32
- - Examples: `unlit_mesh`, `blinn_phong_mesh` and `sprite_batch`, with `npm run dev:examples` and `npm run build:examples`.
22
+ - `Scene` with `add`/`remove` for meshes, lights and the camera, plus `SceneMesh` for owning a mesh and its materials.
23
+ - Lights: `AmbientLight`, `DirectionalLight` and `PointLight`.
24
+ - `ForwardBlinnPhongMaterial`, `SpriteMaterial`, and the `ICameraMaterial`/`ILightsMaterial` interfaces.
25
+ - Mesh transforms (`position`, `rotation`, `scale`) and sub meshes (`addSubMesh`, `meshFactory.createWithSubMeshes`).
26
+ - OBJ/MTL loading through `framework.objLoader`, `ObjParser`, and `content.loadMeshAsync`, `loadUnlitMeshAsync` and `loadBlinnPhongMeshAsync`.
27
+ - `geometryBuilder.create(descriptor)` and the exported `BaseGeometry`.
28
+ - sRGB compressed texture formats (BC1, BC3, BC7, ETC2), with KTX2 loading choosing sRGB automatically.
29
+ - Examples: `unlit_mesh`, `blinn_phong_mesh` and `sprite_batch`.
33
30
 
34
31
  ### Changed
35
32
 
36
- - `content.loadShaderModule(id, replacements?)` takes optional `##KEY##` replacement values, and they are part of the shader cache key.
33
+ - `content.loadShaderModule` accepts optional replacement values.
37
34
 
38
35
  ### Fixed
39
36
 
40
- - The sprite fragment shader added `vec4(1.0)` to every pixel, so sprites rendered white.
41
- - The orthographic camera's default eye was at z = -1 instead of z = 1.
42
- - The default texture was a static shared by every `Framework` instance, so a second framework (a new GL context) reused a texture from the old one. It is now per framework.
43
- - The anisotropic filtering helper cached the extension object from the first GL context on a shared static. It is now looked up per context.
44
- - A leftover `debugger` statement in `WebGlGraphicsDevice` initialization is removed.
45
-
46
- ### Removed
47
-
48
- - The `tsyringe` and `reflect-metadata` dependencies.
49
- - `IMaterial.modelMatrix`, replaced by `modelBuffer` (see Breaking changes).
37
+ - Sprites rendered white because of a stray value in the sprite shader.
38
+ - The orthographic camera's default eye was on the wrong side (z = -1).
39
+ - A second `Framework` instance reused the default texture and anisotropic-filtering extension from the first.
40
+ - A leftover `debugger` statement in WebGL device initialization.
41
+ - Swapped BC/S3TC compression flags could select BC7 on GPUs without BPTC support.
50
42
 
51
43
  ## [0.1.0]
52
44
 
package/README.md CHANGED
@@ -1,200 +1,149 @@
1
1
  # ris-framework
2
2
 
3
- `ris-framework` is a browser WebGL2 framework, published as an ES module. Version 0.1.0. An application imports the compiled package. This repository also contains a sample page that runs the framework.
3
+ A browser WebGL2 framework for TypeScript, published as an ES module (version 0.2.0). Runtime dependencies are `gl-matrix` and `ris-ktx2`.
4
4
 
5
- Open `index.html`. The module script is `src/main.ts`. That file builds the page, constructs a `Framework`, and starts the frame loop. Shared interfaces and value types (`IFramework`, `Color`, `Rect`, `TextureDescriptor`, and the rest) ship from this package. They used to live in `ris-framework-api`. This repository implements them.
5
+ ```sh
6
+ npm install ris-framework
7
+ ```
6
8
 
7
- ## Layout
9
+ Everything public is exported from the package entry: `Framework`, `TextureSamplerFilteringPreset`, and the API types (scenes, meshes, materials, lights, cameras, textures, loaders, input).
8
10
 
9
- | Path | What lives there |
10
- | --- | --- |
11
- | `index.html` | The page. It has `#app` and `<canvas id="game-canvas" width="800" height="600">`. |
12
- | `src/main.ts` | Application entry. |
13
- | `src/index.ts` | Package entry. Exports `Framework`, `FrameworkConfiguration`, `TextureSamplerFilteringPreset`, and everything under `src/api`. |
14
- | `src/Framework.ts` | `Framework`, which wires the renderer, factories, managers, and the frame loop together. |
15
- | `src/api` | Interfaces and value types formerly published as `ris-framework-api` (input, textures, cameras, `TextureUtilities`, and the rest). It also holds `FrameworkConfiguration` and the backend-independent implementations: `WindowManager`, `InputManager`, `ContentManager`, `SpriteBatch`, `GeometryBuilder`, and `BaseGeometry`. `src/api/content/ShaderModuleContent.ts` maps the built-in shader module ids to GLSL from `shaders/glsl`. |
16
- | `src/core` | Renderer and graphics-device base classes (`ARenderer`, `AGraphicsDevice`), the texture base class, blend and sampler descriptors, `VertexBufferLayout`, and `TextureSamplerFilteringPreset`. |
17
- | `src/webgl` | The WebGL2 graphics device, renderer, textures, buffers, samplers, and render pipelines. |
18
- | `shaders/glsl` | Vertex and fragment shaders used by the built-in shader modules. |
19
- | `tests` | Vitest tests for the types under `src/api`. |
11
+ ## Create and start a framework
20
12
 
21
- Runtime dependencies are `ris-ktx2` and `gl-matrix`. The KTX2 types (`IKtx2Texture`, `VkFormat`, `KtxTranscodeFormat`, and the rest) are imported from `ris-ktx2`. The library build includes the browser portion of `ris-ktx2`, with its Node loader replaced by a stub, so the published entry does not import Node built-ins. TypeScript, Vite, and Vitest are dev dependencies. Notices for the bundled KTX loader are in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). The package license is Apache License 2.0. Copyright 2026 Luka Erkapic. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
13
+ Pass an `IFrameworkConfiguration` object. Every field is optional.
22
14
 
23
- ## Prerequisites
15
+ ```ts
16
+ import { Color, Framework, type IFrameworkConfiguration, TextureSamplerFilteringPreset } from "ris-framework";
24
17
 
25
- - Node.js 22. Continuous integration uses Node.js 22. Vite 7 in this repo requires `^20.19.0` or `>=22.12.0`.
26
- - npm.
27
- - A browser that can create a WebGL2 context. If `canvas.getContext("webgl2")` fails, startup throws `WebGL not supported.`
18
+ const config: IFrameworkConfiguration = {
19
+ canvas: document.querySelector<HTMLCanvasElement>("#game-canvas")!,
20
+ textureFiltering: TextureSamplerFilteringPreset.BILINEAR,
21
+ useKtx2: true,
22
+ };
28
23
 
29
- ## Install
24
+ const framework = new Framework(config);
30
25
 
31
- Install the package in an application:
26
+ framework.addOnLoadContentListener(async () => { /* load content */ });
27
+ framework.addOnUpdateListener(time => { /* update, time.deltaTimeSec */ });
28
+ framework.addOnRenderListener(() => { /* draw */ });
32
29
 
33
- ```sh
34
- npm install ris-framework
30
+ framework.initialize();
31
+ framework.renderer.clearColor = Color.cornerFlowerBlue();
35
32
  ```
36
33
 
37
- The published entry is compiled JavaScript and TypeScript declarations (`dist/index.js` and `dist/index.d.ts`). Import the public surface by package name:
34
+ | Field | Default | Meaning |
35
+ | --- | --- | --- |
36
+ | `canvas` | created and appended | The canvas to render into. |
37
+ | `backBufferSize` | `800 × 600` | Back buffer size. |
38
+ | `textureFiltering` | `BILINEAR` | Default sampler preset. |
39
+ | `textureColorSpace` | `SRGB` | Default texture colour space. |
40
+ | `useKtx2` | `false` | Creates `framework.ktx2Factory`. |
41
+ | `alpha` | `false` | Whether the back buffer has an alpha channel. |
42
+ | `powerPreference` | `DEFAULT` | GPU preference on multi-GPU systems. |
38
43
 
39
- ```ts
40
- import { Framework, FrameworkConfiguration, TextureSamplerFilteringPreset } from "ris-framework";
41
- ```
44
+ Register listeners before `initialize()`. Load-content and initialized listeners run inside that call.
42
45
 
43
- The same entry re-exports the former `ris-framework-api` surface, so a consumer can import those names from `ris-framework`:
46
+ ## Scenes, cameras and lights
44
47
 
45
48
  ```ts
46
- import { Color, Rect, TextureFormat, TextureUtilities, type IInputManager } from "ris-framework";
47
- ```
48
-
49
- `Framework`, `FrameworkConfiguration`, `TextureSamplerFilteringPreset`, and that API surface are the public entry. Built-in GLSL is compiled into `dist/index.js`, so a consumer does not load this repository's `shaders/` directory at runtime. The same file includes the browser KTX2 loader. A consuming Vite app can import the package and build without adding a Node stub of its own.
50
-
51
- To work in this repository:
49
+ import { Color, DirectionalLight, PointLight, Scene } from "ris-framework";
52
50
 
53
- ```sh
54
- npm ci
55
- ```
51
+ const scene = new Scene(framework);
56
52
 
57
- `Framework` creates its services itself and passes dependencies through their constructors; no dependency-injection container or `reflect-metadata` import is needed.
53
+ // Passing the scene makes this the scene's camera.
54
+ const camera = framework.cameraFactory.createPerspectiveCamera({
55
+ aspectRatio: canvas.width / canvas.height,
56
+ eye: [0, 0, 3],
57
+ }, scene);
58
58
 
59
- ## Create a framework instance
59
+ scene.activeAmbientLight.color = new Color(0.4, 0.4, 0.4);
60
+ // Lights take an optional scene; passing it adds them.
61
+ new DirectionalLight({ color: new Color(1, 1, 1), intensity: 0.8, direction: [-0.4, -0.6, 1] }, scene);
62
+ new PointLight({ color: new Color(1, 0.5, 0.2), intensity: 1.2, linear: 0.35, quadratic: 0.44 }, scene);
60
63
 
61
- Construct `FrameworkConfiguration`, then pass it to `Framework`. The constructor is `constructor(options?: IFrameworkConfiguration)`. Omitting the argument uses `new FrameworkConfiguration()`. The constructor writes the resolved `backBufferSize` back onto the object you pass.
64
+ framework.addOnUpdateListener(time => {
65
+ camera.update(time);
66
+ scene.update(time);
67
+ });
68
+ framework.addOnRenderListener(() => scene.render());
69
+ ```
62
70
 
63
- Another project imports that public entry by package name: `import { Framework, FrameworkConfiguration, TextureSamplerFilteringPreset } from "ris-framework"`.
71
+ `scene.add(item)` and `scene.remove(item)` accept a renderable mesh, a `SceneMesh`, a light or a camera. Blinn-Phong materials support up to 3 directional and 5 point lights.
64
72
 
65
- No config field is required. Each field has a default.
73
+ ## Meshes and materials
66
74
 
67
- | Field | Default | What the code does with it |
68
- | --- | --- | --- |
69
- | `canvas` | `undefined` | The canvas the WebGL2 context is created from. When unset, `Framework` logs a warning and `WindowManager` creates a canvas and appends it to `document.body`. `src/main.ts` sets this to `#game-canvas`. |
70
- | `backBufferSize` | `undefined` (the constructor uses `vec2.fromValues(800, 600)`) | Copied onto an internal `IRendererConfiguration`. `WebGlRenderer` leaves that copy unused. The main render target starts at the canvas element's `width` and `height`. The canvas in `index.html` is 800 by 600. |
71
- | `textureFiltering` | `TextureSamplerFilteringPreset.BILINEAR` | Preset for the graphics device's default texture sampler. `POINT` is nearest filtering with no mipmaps. `BILINEAR` is linear filtering with no mipmaps. `TRILINEAR` is linear filtering with linear mipmaps. `undefined` is treated as `BILINEAR`. |
72
- | `useKtx2` | `false` | When `true`, the constructor sets `framework.ktx2Factory` to a `Ktx2Factory`. `initialize()` then calls `initializeAsync()` on it and does not wait. When `false`, `ktx2Factory` stays unset. |
73
- | `alpha` | `false` | Passed as the WebGL2 context's `alpha` attribute, so it decides whether the canvas back buffer has an alpha channel. |
74
- | `powerPreference` | `PowerPreferenceType.DEFAULT` | Passed as the WebGL2 context's `powerPreference` (`"default"`, `"low-power"`, or `"high-performance"`). It only matters on machines with more than one GPU. |
75
+ - `IMesh` / `Mesh` hold geometry and the vertex and index buffers.
76
+ - `IRenderableMesh` / `RenderableMesh` add a material, an index range and sub meshes (`mesh.addSubMesh(material, start, count)` or `meshFactory.createWithSubMeshes`). The root mesh owns the transform and one model buffer, which all its sub meshes share.
77
+ - Transforms: `mesh.position`, `mesh.rotation` (Euler radians, applied Y, then X, then Z) and `mesh.scale`. `mesh.modelMatrix` is recomputed only when one of them changes.
78
+ - `SceneMesh`: `scene.add(mesh)` wraps a renderable mesh in a `SceneMesh`, which owns its materials. `sceneMesh.dispose()` and `scene.dispose()` dispose the mesh and each material once.
79
+ - Materials come from `framework.materialFactory`. They include unlit, `ForwardBlinnPhongMaterial` and `SpriteMaterial`.
75
80
 
76
- Every field is optional on `IFrameworkConfiguration`. A new `FrameworkConfiguration` sets `useKtx2`, `textureFiltering`, `alpha`, and `powerPreference`. `canvas` and `backBufferSize` start unset.
81
+ ## Loading OBJ/MTL
77
82
 
78
83
  ```ts
79
- import { Framework, FrameworkConfiguration, TextureSamplerFilteringPreset } from "ris-framework";
80
-
81
- const config = new FrameworkConfiguration();
82
- config.canvas = document.getElementById("game-canvas") as HTMLCanvasElement;
83
- config.textureFiltering = TextureSamplerFilteringPreset.BILINEAR;
84
+ // Unlit or Blinn-Phong materials (one per usemtl), coloured from the .mtl.
85
+ const cube = await framework.content.loadBlinnPhongMeshAsync("/assets/cube.obj", camera);
86
+ const flat = await framework.content.loadUnlitMeshAsync("/assets/cube.obj", camera);
87
+ scene.add(cube);
88
+
89
+ // Lower level: pass a Blinn-Phong descriptor or a material factory per sub mesh.
90
+ const mesh = await framework.objLoader.loadAsync("/assets/cube.obj", {
91
+ projectionViewBuffer: camera.projectionViewBuffer,
92
+ cameraPositionBuffer: camera.positionBuffer,
93
+ });
84
94
 
85
- const framework = new Framework(config);
95
+ // Geometry only, with no materials (GeometryFormat is exported from "ris-framework").
96
+ const geometry = await framework.content.loadMeshAsync("/assets/cube.obj", GeometryFormat.POS3_COLOR4_TEXTURECOORDS2);
86
97
  ```
87
98
 
88
- `src/main.ts` constructs the sample the same way, but it imports those three symbols from the source files under `src/` instead of from the package name.
89
-
90
- `framework.renderingBackend` is `RenderingBackend.WEB_GL`. After `initialize()`, `framework.graphicsDevice` is the renderer's WebGL2 device.
99
+ `ObjLoader.parseAsync(path)` and `ObjParser` return plain data without creating GPU resources.
91
100
 
101
+ ## Textures and KTX2
92
102
 
93
- ## From startup to the first frame
94
-
95
- `src/main.ts` is the current startup path. It still fills `#app` with the Vite starter page (logos and a heading) and then starts the framework on `#game-canvas`.
103
+ ```ts
104
+ const png = await framework.content.loadTexture2DAsync("/assets/test.png");
105
+ const ktx = await framework.content.loadTexture2DAsync("/assets/kodim23.ktx2");
106
+ ```
96
107
 
97
- Register listeners before `initialize()`. Load-content and initialized listeners run only inside that call. Update and render listeners stay on the loop, so a listener added later still runs on a following frame. `initialize()` does this:
108
+ Paths ending in `.ktx2` are loaded through `ris-ktx2`.
98
109
 
99
- 1. Starts KTX2 initialization when `useKtx2` is set, without awaiting it.
100
- 2. Creates the WebGL2 context, swap chain, and default sampler, blend state, and primitive state.
101
- 3. Initializes the sprite batch (a default orthographic camera and a 1×1 white texture).
102
- 4. Initializes input. Mouse move, mouse buttons, and wheel events on the canvas update `framework.input.getMouseState()`. Touch start, move, end, and cancel events on the canvas update `framework.input.getTouchCollection()`, using the same viewport `clientX` / `clientY` coordinates as the mouse. A cancel is `TouchLocationState.CANCELLED`, which is not a finger lift. The canvas `touch-action` is set to `none`, and touch start and move call `preventDefault`, so the browser does not scroll or pinch-zoom that canvas.
103
- 5. Prepares the time manager.
104
- 6. Calls every `addOnLoadContentListener` callback. Async callbacks are not awaited.
105
- 7. Calls every `addOnInitializedListener` callback.
106
- 8. Creates the main render target at the canvas size and a swap-chain pass. The clear color at this moment is `Color.lightPink()`, the renderer default.
107
- 9. Subscribes an update callback and a render callback, then runs both once before returning. Later frames are scheduled with `requestAnimationFrame`.
110
+ - **Basis Universal files** are transcoded to the best format the GPU supports, in this order: BC7, ASTC 4×4, BC3, ETC2, PVRTC, and RGBA8 as a last resort.
111
+ - **Other KTX2 files** are uploaded in their stored format.
112
+ - **sRGB:** sRGB files load as sRGB formats (`BC7_RGBA_SRGB`, `BC3_RGBA_SRGB`, `BC1_RGB_SRGB`, `ETC2_RGBA8_SRGB`, `ETC2_RGB8_SRGB`, `ASTC_*_RGBA_SRGB`, `RGBA_8_UNORM_SRGB`), so the GPU decodes them to linear.
113
+ - **sRGB fallback:** if `WEBGL_compressed_texture_s3tc_srgb` is missing, sRGB BC1 and BC3 textures fall back to linear with a warning.
108
114
 
109
- Each update calls `timeManager.frameStart()`, updates input, then calls `addOnUpdateListener` callbacks with that frame's `GameTime`. `src/main.ts` registers no update listener. Each render begins the main pass, calls `addOnRenderListener` callbacks, calls `spriteBatch.frameEnd()`, and presents.
115
+ `framework.graphicsDevice.features` reports compression support: `supportsTextureCompressionBC` (BPTC/BC7), `supportsTextureCompressionS3TC`, `supportsTextureCompressionS3TCSrgb`, `supportsTextureCompressionETC2`, `supportsTextureCompressionASTC` and `supportsTextureCompressionPVRTC`.
110
116
 
111
- Before that call, `src/main.ts` registers the listeners below. The sample loads images, creates a nearest sampler, and draws with the sprite batch:
117
+ ## Sprites
112
118
 
113
119
  ```ts
114
- import {
115
- Color,
116
- Rect,
117
- SamplerDescriptor,
118
- SamplerFilter,
119
- TextureDescriptor,
120
- TextureFormat,
121
- type ISampler,
122
- type ITexture2D,
123
- } from "ris-framework";
124
-
125
- const rect = new Rect(200, 200, 200, 200);
126
- const texRect = new Rect(500, 200, 200, 200);
127
- const color = Color.blue();
128
- const white = Color.white();
129
- let tex: ITexture2D;
130
- let sampler: ISampler;
131
-
132
- framework.addOnLoadContentListener(async () => {
133
- const texDesc = new TextureDescriptor();
134
- texDesc.generateMipmaps = true;
135
- texDesc.textureFormat = TextureFormat.RGBA_8_UNORM;
136
-
137
- tex = await framework.content.loadTexture2DAsync("/assets/test.png", texDesc);
138
- });
139
-
140
- framework.addOnInitializedListener(() => {
141
- const desc = new SamplerDescriptor();
142
- desc.minFilter = SamplerFilter.NEAREST;
143
- desc.magFilter = SamplerFilter.NEAREST;
144
- sampler = framework.graphicsDevice.createSampler(desc);
145
- });
146
-
147
120
  framework.addOnRenderListener(() => {
148
- const spriteBatch = framework.spriteBatch;
149
- spriteBatch.begin(undefined, sampler);
150
- spriteBatch.drawRect(rect, color);
151
- if (tex != null) {
152
- spriteBatch.draw(tex, texRect, white);
153
- }
154
- spriteBatch.end();
121
+ framework.spriteBatch.begin();
122
+ framework.spriteBatch.draw(texture, new Rect(200, 200, 200, 200), Color.white());
123
+ framework.spriteBatch.drawRect(new Rect(500, 200, 100, 100), Color.blue());
124
+ framework.spriteBatch.end();
155
125
  });
156
-
157
- framework.initialize();
158
- framework.renderer.clearColor = Color.lightPink();
159
126
  ```
160
127
 
161
- `loadTexture2DAsync(path, textureDescriptor?, contentConfig?)` is the image path used above. For a path that does not end in `.ktx2`, the descriptor's `textureFormat` is used when it is not `TextureFormat.UNDEFINED`; otherwise the renderer's preferred format is used. `generateMipmaps` is passed through. Width, height, pixel data, usage, label, and block size on that descriptor are not applied to this load. An optional `ContentConfig` only forwards `keepDataCached` to the image loader.
162
-
163
- The first `begin` / `drawRect` / `end` runs inside `initialize()`, before the texture promise resolves, so the blue rectangle is the first draw. Later frames draw the texture once `tex` is set. `spriteBatch.begin` with no matrix keeps the default orthographic camera. The sampler argument overrides the device's default sampler for that batch. `drawRect` draws the 1×1 white texture tinted by `color`.
164
-
165
- `src/main.ts` also loads `/assets/cat.jpg` the same way and draws it at `new Rect(200, 500, 200, 200)`. Those two files are absent from this repository. Put them under `public/assets/` before those loads can succeed. The blue rectangle still draws when the image loads fail.
166
-
167
- Setting `framework.renderer.clearColor` after `initialize()` updates later frames. The first frame has already cleared with the default light pink.
128
+ ## Examples and scripts
168
129
 
169
- ## Scene
170
-
171
- `new Scene(framework)` holds meshes, lights and the camera. `scene.add(item)` and `scene.remove(item)` accept a mesh, an `AmbientLight`, `DirectionalLight`, `PointLight` or a camera; adding twice does nothing. Meshes, lights and the perspective camera given a scene in their constructor add themselves, and a disposed mesh removes itself. Adding a camera makes it `scene.camera`; removing the active camera clears it. `addLight`/`removeLight` remain as deprecated aliases.
172
-
173
- ## Examples
174
-
175
- Browser examples live in [`examples/`](examples/), one folder per example. See [`examples/README.md`](examples/README.md).
130
+ Examples live in [`examples/`](examples/): `unlit_mesh`, `blinn_phong_mesh` and `sprite_batch` (see [`examples/README.md`](examples/README.md)).
176
131
 
177
132
  ```sh
178
- npm run dev:examples # serve the examples index, e.g. /sprite_batch/
179
- npm run build:examples # build every example into examples/dist/
133
+ npm ci
134
+ npm run dev:examples # serve the examples
135
+ npm run build:examples # build them into examples/dist/
136
+ npm run dev # src/main.ts playground
137
+ npm test # type-check and Vitest
138
+ npm run build # library (dist/) and app build
180
139
  ```
181
140
 
182
- ## What is still unfinished
183
-
184
- These throw, or they accept a call and do not do the work the name suggests:
141
+ Requires Node.js 22 (or `^20.19.0`) and a WebGL2-capable browser.
185
142
 
186
- - `WindowManager.addOnResizeListener`, `removeOnResizeListener`, `initializeForWebGPU`, `initializeForWebGl`, and `dispose` throw `Method not implemented.` `title` and `windowBounds` are stored and never applied. There is no WebGPU backend.
187
- - `Framework.dispose()` is empty. It does not release the window, device, or GPU resources.
188
- - `renderer.beginComputePass()` and `renderer.endComputePass()` throw `Method not implemented.` `ARenderer.limits` throws the same error.
189
- - `graphicsDevice.setupDebugCallback()`, `frameEnd()`, `pushDebugGroup()`, and `popDebugGroup()` throw `Method not implemented.`
190
- - `ITexture2D.createView()` throws `Method not implemented.`
191
- - `content.loadShaderModule` only resolves the built-in ids `sprite`, `unlit_material`, `inspect_texture_mips`, and `main_render_target_flip_y`. Any other id throws `Not implemented`.
192
- - `SpriteBatch.draw` and `drawRect` accept rotation arguments and do not use them. `layerDepth` is written as the sprite's z position.
193
- - Keyboard and gamepad queries return empty state. `getKeyboardState()` is an empty `KeyboardState`. `getGamePadState()` is a disconnected `GamePadState`. `thumbstickDeadZone` is stored and not applied.
194
- - A render pass that enables stencil without depth throws `Not implemented`.
195
- - Paths ending in `.ktx2` go through `content.loadKtx2Async`, which uses its own `Ktx2Factory` and does not call `initializeAsync`. The libktx module is shared by every `Ktx2Factory`, so `loadAsync` works only after some factory has finished `initializeAsync()`. `useKtx2` starts that call in `initialize()` but does not wait for it. To load a `.ktx2` file, set `useKtx2`, await `framework.ktx2Factory.initializeAsync()` before `initialize()`, and then call `loadTexture2DAsync` from a load-content listener. `src/main.ts` does not load a `.ktx2` file.
196
- - The geometry and unlit-pipeline steps at the bottom of `src/main.ts` are comments. `geometryBuilder.quadGeometry()` can build quad data; the entry file does not upload it or draw it.
143
+ ## Known limitations
197
144
 
198
- ## Version
145
+ - Window resize listeners and compute passes throw `Method not implemented.`
146
+ - Keyboard and gamepad state are stubs.
147
+ - `SpriteBatch` ignores rotation.
199
148
 
200
- `package.json` `version` stays a release version with no prerelease suffix. It is `0.1.0`. Branch and publish rules are in [CONTRIBUTING.md](CONTRIBUTING.md).
149
+ Branch and publish rules are in [CONTRIBUTING.md](CONTRIBUTING.md). Changes are listed in [CHANGELOG.md](CHANGELOG.md).
@@ -1,29 +1,38 @@
1
- import { type ICameraFactory, type IContentManager, type IFramework, IFrameworkConfiguration, type IImageLoader, type IRenderer, type IRenderPipelineFactory, type IWindowManager } from "./api/index.js";
2
- import { GameTime, type IBufferFactory, type IGeometryBuilder, type IGraphicsDevice, type IImageProcessor, type IInputManager, type IMaterialFactory, type AmbientLightFactory, type IMeshFactory, type ISpriteBatch, type ITextureFactory, type ITimeManager, RenderingBackend } from "./api/index.js";
1
+ import { ObjLoader } from "./api/loaders/ObjLoader.js";
2
+ import { type AmbientLightFactory, GameTime, type IBufferFactory, type ICameraFactory, type IContentManager, type IFramework, IFrameworkConfiguration, type IGeometryBuilder, type IGraphicsDevice, type IImageLoader, type IImageProcessor, type IInputManager, type IMaterialFactory, type IMeshFactory, type IRenderer, type IRenderPipelineFactory, type ISpriteBatch, type ITextureFactory, type ITimeManager, type IWindowManager, RenderingBackend } from "./api/index.js";
3
3
  import type { IKtx2Factory } from "ris-ktx2";
4
+ /** The Ris framework */
4
5
  export declare class Framework implements IFramework {
5
6
  private readonly _onLoadContentListeners;
6
7
  private readonly _onInitializeListeners;
7
8
  private readonly _onUpdateListeners;
8
9
  private readonly _onRenderListeners;
9
- private readonly _textureFactory;
10
- private readonly _buffersFactory;
11
- private readonly _contentManager;
10
+ private _configuration;
11
+ private _textureFactory;
12
+ private _buffersFactory;
13
+ private _contentManager;
14
+ private readonly _rendererConfiguration;
15
+ private _renderer;
12
16
  private readonly _geometryBuilder;
13
17
  private readonly _meshFactory;
14
18
  private _disposed;
15
19
  /**
16
20
  * The constructor for the Framework class.
17
- * @param options The optional framework configuration. When omitted, a default `FrameworkConfiguration` is used.
21
+ * @param configuration The optional framework configuration. When omitted, a default `FrameworkConfiguration` is used.
18
22
  */
19
- constructor(options?: IFrameworkConfiguration);
23
+ constructor(configuration?: IFrameworkConfiguration);
20
24
  /** @inheritDoc */
21
25
  readonly imageLoader: IImageLoader;
22
26
  renderingBackend: RenderingBackend;
23
27
  /** @inheritDoc */
24
28
  readonly imageProcessor: IImageProcessor;
25
29
  /** @inheritDoc */
26
- readonly renderer: IRenderer;
30
+ get renderer(): IRenderer;
31
+ /**
32
+ * Creates the backend-specific services: renderer, texture factory, pipeline factory, shader loader and buffers factory.
33
+ * @param backend WEB_GL or WEB_GPU.
34
+ */
35
+ private _setupBackendServices;
27
36
  /** @inheritDoc */
28
37
  readonly spriteBatch: ISpriteBatch;
29
38
  /** @inheritDoc */
@@ -68,6 +77,8 @@ export declare class Framework implements IFramework {
68
77
  /** @inheritdoc */
69
78
  get meshFactory(): IMeshFactory;
70
79
  /** @inheritDoc */
80
+ readonly objLoader: ObjLoader;
81
+ /** @inheritDoc */
71
82
  readonly materialFactory: IMaterialFactory;
72
83
  /** @inheritDoc */
73
84
  readonly lightsFactory: AmbientLightFactory;
@@ -77,6 +88,13 @@ export declare class Framework implements IFramework {
77
88
  readonly input: IInputManager;
78
89
  /** @inheritdoc */
79
90
  initialize(): void;
91
+ /**
92
+ * Initializes the framework and starts the event loop. Required for WebGPU, which requests its adapter
93
+ * and device asynchronously; for WebGL it behaves like {@link initialize}.
94
+ * If the WebGPU device cannot be acquired, the framework falls back to WebGL with a warning.
95
+ */
96
+ initializeAsync(): Promise<void>;
97
+ private _initializeCore;
80
98
  /**
81
99
  * Stops the event loop and disposes the framework's services and GL resources,
82
100
  * including per-framework caches such as the default texture and the shader modules.
@@ -1 +1 @@
1
- {"version":3,"file":"Framework.d.ts","sourceRoot":"","sources":["../src/Framework.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,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IAAI,GAAG,IAAI;IAItD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAO9B,kBAAkB;IAClB,IAAW,cAAc,IAAI,eAAe,CAE3C;IAED,kBAAkB;IACX,qBAAqB,EAAE,sBAAsB,CAAS;IAE7D,kBAAkB;IAClB,IAAI,eAAe,IAAI,gBAAgB,CAEtC;IAED,kBAAkB;IAClB,SAAgB,aAAa,EAAE,cAAc,CAAC;IAE9C,kBAAkB;IAClB,IAAW,cAAc,IAAI,eAAe,CAE3C;IAED,kBAAkB;IAClB,IAAW,aAAa,IAAI,cAAc,CAEzC;IAED,kBAAkB;IAClB,IAAW,OAAO,IAAI,eAAe,CAEpC;IAED,kBAAkB;IAClB,IAAW,WAAW,IAAI,YAAY,CAErC;IAED,kBAAkB;IAClB,SAAgB,SAAS,EAAE,SAAS,CAAuB;IAE3D,kBAAkB;IAClB,SAAgB,eAAe,EAAE,gBAAgB,CAAC;IAElD,kBAAkB;IAClB,SAAgB,aAAa,EAAE,mBAAmB,CAAC;IAEnD,kBAAkB;IAClB,SAAgB,WAAW,EAAE,YAAY,CAAC;IAE1C,kBAAkB;IAClB,SAAgB,KAAK,EAAE,aAAa,CAAC;IAErC,kBAAkB;IACX,UAAU,IAAI,IAAI;IAezB;;;;OAIG;IACU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB7C,OAAO,CAAC,eAAe;IA4CvB;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAoBzB"}
@@ -7,6 +7,7 @@ import type { IBufferFactory } from "./rendering/buffers/IBufferFactory.js";
7
7
  import type { IGeometryBuilder } from "./geometry/IGeometryBuilder.js";
8
8
  import type { ICameraFactory } from "./camera/ICameraFactory.js";
9
9
  import type { ITextureFactory } from "./rendering/texture/ITextureFactory.js";
10
+ import type { ObjLoader } from "./loaders/ObjLoader.js";
10
11
  import type { IContentManager } from "./content/IContentManager.js";
11
12
  import type { IImageLoader } from "./loaders/IImageLoader.js";
12
13
  import type { IMeshFactory } from "./meshes/IMeshFactory.js";
@@ -19,6 +20,39 @@ import { GameTime } from "./time/GameTime.js";
19
20
  import type { IImageProcessor } from "./image/IImageProcessor.js";
20
21
  import type { IKtx2Factory } from "ris-ktx2";
21
22
  import type { IDisposable } from "./core/IDisposable.js";
23
+ import type { vec2 } from "gl-matrix";
24
+ import type { TextureSamplerFilteringPreset } from "../core/rendering/enums.js";
25
+ import type { PowerPreferenceType } from "./rendering/PowerPreference.js";
26
+ import type { TextureColorSpace } from "./rendering/enums.js";
27
+ /**
28
+ * The configuration for the framework.
29
+ * @public
30
+ **/
31
+ export declare class IFrameworkConfiguration {
32
+ /** If true, creates and makes the KTX2 factory available. */
33
+ useKtx2?: boolean;
34
+ /** The size of back buffer. By default, if not specified (800, 600). */
35
+ backBufferSize?: vec2;
36
+ /** The texture filtering to configure */
37
+ textureFiltering?: TextureSamplerFilteringPreset;
38
+ /** The texture color space to use by default. By default, it is {@link TextureColorSpace.SRGB}. */
39
+ textureColorSpace?: TextureColorSpace;
40
+ /**
41
+ * The HTMLCanvasElement to use for rendering.
42
+ * If null, a new canvas will be created and added to the document body.
43
+ */
44
+ canvas?: HTMLCanvasElement;
45
+ /** Should back buffer use alpha. */
46
+ alpha?: boolean;
47
+ /** The preference when it comes to selecting GPU device. Only makes sense to set on multi-GPU devices. */
48
+ powerPreference?: PowerPreferenceType;
49
+ /**
50
+ * The rendering backend. Defaults to WebGL.
51
+ * WebGPU requires `Framework.initializeAsync()`; when `navigator.gpu` is missing or no device is available,
52
+ * the framework falls back to WebGL with a warning.
53
+ */
54
+ renderingBackend?: RenderingBackend;
55
+ }
22
56
  /** The framework interface. */
23
57
  export interface IFramework extends IDisposable {
24
58
  /**
@@ -72,6 +106,10 @@ export interface IFramework extends IDisposable {
72
106
  * The mesh factory.
73
107
  */
74
108
  readonly meshFactory: IMeshFactory;
109
+ /**
110
+ * The OBJ loader: `objLoader.loadAsync(path, blinnPhongDescriptor | subMesh => material)`.
111
+ */
112
+ readonly objLoader: ObjLoader;
75
113
  /**
76
114
  * The material factory.
77
115
  */
@@ -122,5 +160,10 @@ export interface IFramework extends IDisposable {
122
160
  removeOnRenderListener(event: () => void): void;
123
161
  /** Initializes the framework. */
124
162
  initialize(): void;
163
+ /**
164
+ * Initializes the framework asynchronously and starts the event loop.
165
+ * Required for the WebGPU backend; for WebGL it behaves like {@link initialize}.
166
+ */
167
+ initializeAsync(): Promise<void>;
125
168
  }
126
169
  //# sourceMappingURL=IFramework.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IFramework.d.ts","sourceRoot":"","sources":["../../src/api/IFramework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,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G,IAAI,CAAC;IAEhD,iCAAiC;IACjC,UAAU,IAAI,IAAI,CAAC;IAEnB;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAEpC"}
@@ -1,5 +1,4 @@
1
1
  export * from "./IFramework.js";
2
- export * from "./IFrameworkConfiguration.js";
3
2
  export * from "./rendering/texture/_export-texture.js";
4
3
  export * from "./rendering/buffers/_export-buffers.js";
5
4
  export * from "./data/_export.js";
@@ -24,6 +23,7 @@ export * from "./meshes/_export.js";
24
23
  export * from "./material/_export.js";
25
24
  export * from "./lights/_export.js";
26
25
  export * from "./scene/Scene.js";
26
+ export * from "./scene/SceneMesh.js";
27
27
  export * from "./input/_export.js";
28
28
  export * from "./image/_export.js";
29
29
  //# sourceMappingURL=_export.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_export.d.ts","sourceRoot":"","sources":["../../src/api/_export.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0DAA0D,CAAC;AACzE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc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