chorama 0.1.2 → 0.2.1

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 (483) hide show
  1. package/README.md +2 -1
  2. package/dist/index.module.js +32480 -15098
  3. package/dist/index.module.js.map +1 -1
  4. package/dist/index.umd.js +32628 -15121
  5. package/dist/index.umd.js.map +1 -1
  6. package/package.json +7 -2
  7. package/.configs/tsconfig.lib.json +0 -43
  8. package/.configs/tsconfig.website.json +0 -34
  9. package/.github/workflows/publish.yml +0 -24
  10. package/.github/workflows/static.yml +0 -57
  11. package/.vscode/launch.json +0 -29
  12. package/.vscode/tasks.json +0 -19
  13. package/assets/images/disappointed.jpg +0 -0
  14. package/assets/images/skybox/grimmnight_back.png +0 -0
  15. package/assets/images/skybox/grimmnight_bottom.png +0 -0
  16. package/assets/images/skybox/grimmnight_front.png +0 -0
  17. package/assets/images/skybox/grimmnight_left.png +0 -0
  18. package/assets/images/skybox/grimmnight_right.png +0 -0
  19. package/assets/images/skybox/grimmnight_top.png +0 -0
  20. package/assets/images/skybox/miramar_back.png +0 -0
  21. package/assets/images/skybox/miramar_bottom.png +0 -0
  22. package/assets/images/skybox/miramar_front.png +0 -0
  23. package/assets/images/skybox/miramar_left.png +0 -0
  24. package/assets/images/skybox/miramar_right.png +0 -0
  25. package/assets/images/skybox/miramar_top.png +0 -0
  26. package/assets/images/uv.jpg +0 -0
  27. package/assets/models/glb/AlphaBlendModeTest.glb +0 -0
  28. package/assets/models/glb/IridescenceLamp.glb +0 -0
  29. package/assets/models/glb/teapot.glb +0 -0
  30. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.png +0 -0
  31. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.png +0 -0
  32. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.png +0 -0
  33. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.png +0 -0
  34. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.png +0 -0
  35. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.png +0 -0
  36. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_BaseColor.png +0 -0
  37. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_Normal.png +0 -0
  38. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png +0 -0
  39. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.png +0 -0
  40. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_Normal.png +0 -0
  41. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.png +0 -0
  42. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.png +0 -0
  43. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_Normal.png +0 -0
  44. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.png +0 -0
  45. package/assets/models/gltf/flight_helmet/index.bin +0 -0
  46. package/assets/models/gltf/flight_helmet/index.gltf +0 -705
  47. package/assets/models/gltf/object.gltf +0 -23
  48. package/assets/models/gltf/pirate_girl/index.bin +0 -0
  49. package/assets/models/gltf/pirate_girl/index.gltf +0 -2082
  50. package/assets/models/obj/pirate_girl/pirate_girl.obj +0 -18459
  51. package/assets/models/obj/pirate_girl/pirate_girl.png +0 -0
  52. package/astro.config.mjs +0 -33
  53. package/content/guide/api-map.md +0 -89
  54. package/content/guide/camera-and-controls.md +0 -98
  55. package/content/guide/first-scene.md +0 -176
  56. package/content/guide/index.md +0 -72
  57. package/content/guide/installation.md +0 -179
  58. package/content/guide/materials-and-lighting.md +0 -138
  59. package/content/guide/plugins-and-render-pipeline.md +0 -124
  60. package/content/guide/render-targets-and-views.md +0 -146
  61. package/content/guide/scene-graph-and-transforms.md +0 -113
  62. package/content/guide/textures-and-assets.md +0 -123
  63. package/content/guide/troubleshooting.md +0 -49
  64. package/dist/website/_astro/DocLayout.BsV7p0dY.css +0 -1
  65. package/dist/website/examples/camera/orthographic/example.html +0 -172
  66. package/dist/website/examples/camera/orthographic/index.html +0 -124
  67. package/dist/website/examples/camera/perspective/example.html +0 -190
  68. package/dist/website/examples/camera/perspective/index.html +0 -142
  69. package/dist/website/examples/camera/tone_mapping/example.html +0 -238
  70. package/dist/website/examples/camera/tone_mapping/index.html +0 -190
  71. package/dist/website/examples/index.html +0 -2
  72. package/dist/website/examples/lights/directional/example.html +0 -447
  73. package/dist/website/examples/lights/directional/index.html +0 -399
  74. package/dist/website/examples/lights/multiple_spot_lights/example.html +0 -356
  75. package/dist/website/examples/lights/multiple_spot_lights/index.html +0 -308
  76. package/dist/website/examples/lights/point/example.html +0 -387
  77. package/dist/website/examples/lights/point/index.html +0 -339
  78. package/dist/website/examples/lights/spot/example.html +0 -416
  79. package/dist/website/examples/lights/spot/index.html +0 -368
  80. package/dist/website/examples/loader/gltf/basic/example.html +0 -129
  81. package/dist/website/examples/loader/gltf/basic/index.html +0 -81
  82. package/dist/website/examples/loader/gltf/material/alpha-blend-mode/example.html +0 -131
  83. package/dist/website/examples/loader/gltf/material/alpha-blend-mode/index.html +0 -83
  84. package/dist/website/examples/loader/gltf/material/flight_helmet/example.html +0 -162
  85. package/dist/website/examples/loader/gltf/material/flight_helmet/index.html +0 -114
  86. package/dist/website/examples/loader/gltf/material/iridescence_lamp/example.html +0 -169
  87. package/dist/website/examples/loader/gltf/material/iridescence_lamp/index.html +0 -121
  88. package/dist/website/examples/loader/objloader/example.html +0 -144
  89. package/dist/website/examples/loader/objloader/index.html +0 -96
  90. package/dist/website/examples/material/cullface/example.html +0 -163
  91. package/dist/website/examples/material/cullface/index.html +0 -115
  92. package/dist/website/examples/material/materials/example.html +0 -175
  93. package/dist/website/examples/material/materials/index.html +0 -127
  94. package/dist/website/examples/material/standard/basic/example.html +0 -212
  95. package/dist/website/examples/material/standard/basic/index.html +0 -164
  96. package/dist/website/examples/material/standard/reflection_refraction/example.html +0 -241
  97. package/dist/website/examples/material/standard/reflection_refraction/index.html +0 -193
  98. package/dist/website/examples/mesh/capsule/example.html +0 -173
  99. package/dist/website/examples/mesh/capsule/index.html +0 -125
  100. package/dist/website/examples/mesh/circle/example.html +0 -173
  101. package/dist/website/examples/mesh/circle/index.html +0 -125
  102. package/dist/website/examples/mesh/cone/example.html +0 -180
  103. package/dist/website/examples/mesh/cone/index.html +0 -132
  104. package/dist/website/examples/mesh/cuboid/example.html +0 -207
  105. package/dist/website/examples/mesh/cuboid/index.html +0 -159
  106. package/dist/website/examples/mesh/cylinder/example.html +0 -195
  107. package/dist/website/examples/mesh/cylinder/index.html +0 -147
  108. package/dist/website/examples/mesh/dodecahedron/example.html +0 -158
  109. package/dist/website/examples/mesh/dodecahedron/index.html +0 -110
  110. package/dist/website/examples/mesh/ellipsoid/example.html +0 -179
  111. package/dist/website/examples/mesh/ellipsoid/index.html +0 -131
  112. package/dist/website/examples/mesh/extrude/example.html +0 -169
  113. package/dist/website/examples/mesh/extrude/index.html +0 -121
  114. package/dist/website/examples/mesh/frustum/example.html +0 -185
  115. package/dist/website/examples/mesh/frustum/index.html +0 -137
  116. package/dist/website/examples/mesh/helix/example.html +0 -184
  117. package/dist/website/examples/mesh/helix/index.html +0 -136
  118. package/dist/website/examples/mesh/icosahedron/example.html +0 -158
  119. package/dist/website/examples/mesh/icosahedron/index.html +0 -110
  120. package/dist/website/examples/mesh/icosphere/example.html +0 -163
  121. package/dist/website/examples/mesh/icosphere/index.html +0 -115
  122. package/dist/website/examples/mesh/lathe/example.html +0 -175
  123. package/dist/website/examples/mesh/lathe/index.html +0 -127
  124. package/dist/website/examples/mesh/meshTopology/example.html +0 -210
  125. package/dist/website/examples/mesh/meshTopology/index.html +0 -162
  126. package/dist/website/examples/mesh/octahedron/example.html +0 -158
  127. package/dist/website/examples/mesh/octahedron/index.html +0 -110
  128. package/dist/website/examples/mesh/plane/example.html +0 -173
  129. package/dist/website/examples/mesh/plane/index.html +0 -125
  130. package/dist/website/examples/mesh/prism/example.html +0 -173
  131. package/dist/website/examples/mesh/prism/index.html +0 -125
  132. package/dist/website/examples/mesh/pyramid/example.html +0 -172
  133. package/dist/website/examples/mesh/pyramid/index.html +0 -124
  134. package/dist/website/examples/mesh/ring/example.html +0 -173
  135. package/dist/website/examples/mesh/ring/index.html +0 -125
  136. package/dist/website/examples/mesh/skinning/example.html +0 -187
  137. package/dist/website/examples/mesh/skinning/index.html +0 -139
  138. package/dist/website/examples/mesh/terrain/example.html +0 -214
  139. package/dist/website/examples/mesh/terrain/index.html +0 -166
  140. package/dist/website/examples/mesh/tetrahedron/example.html +0 -158
  141. package/dist/website/examples/mesh/tetrahedron/index.html +0 -110
  142. package/dist/website/examples/mesh/torus/example.html +0 -173
  143. package/dist/website/examples/mesh/torus/index.html +0 -125
  144. package/dist/website/examples/mesh/torus-knot/example.html +0 -188
  145. package/dist/website/examples/mesh/torus-knot/index.html +0 -140
  146. package/dist/website/examples/mesh/tube/example.html +0 -180
  147. package/dist/website/examples/mesh/tube/index.html +0 -132
  148. package/dist/website/examples/mesh/uvsphere/example.html +0 -169
  149. package/dist/website/examples/mesh/uvsphere/index.html +0 -121
  150. package/dist/website/examples/mesh/wedge/example.html +0 -168
  151. package/dist/website/examples/mesh/wedge/index.html +0 -120
  152. package/dist/website/examples/other/rotatingCube/example.html +0 -142
  153. package/dist/website/examples/other/rotatingCube/index.html +0 -94
  154. package/dist/website/examples/other/rotatingSphere/example.html +0 -144
  155. package/dist/website/examples/other/rotatingSphere/index.html +0 -96
  156. package/dist/website/examples/rendertarget/basic_canvas/example.html +0 -178
  157. package/dist/website/examples/rendertarget/basic_canvas/index.html +0 -130
  158. package/dist/website/examples/rendertarget/depth_texture/example.html +0 -188
  159. package/dist/website/examples/rendertarget/depth_texture/index.html +0 -140
  160. package/dist/website/examples/rendertarget/image_target/example.html +0 -196
  161. package/dist/website/examples/rendertarget/image_target/index.html +0 -148
  162. package/dist/website/examples/rendertarget/multiple_views/example.html +0 -204
  163. package/dist/website/examples/rendertarget/multiple_views/index.html +0 -156
  164. package/dist/website/examples/rendertarget/render_masks/example.html +0 -222
  165. package/dist/website/examples/rendertarget/render_masks/index.html +0 -174
  166. package/dist/website/examples/rendertarget/split_screen/example.html +0 -178
  167. package/dist/website/examples/rendertarget/split_screen/index.html +0 -130
  168. package/dist/website/examples/rendertarget/split_view/example.html +0 -191
  169. package/dist/website/examples/rendertarget/split_view/index.html +0 -143
  170. package/dist/website/examples/skybox/skybox/example.html +0 -162
  171. package/dist/website/examples/skybox/skybox/index.html +0 -114
  172. package/dist/website/examples/texture/arrays/example.html +0 -204
  173. package/dist/website/examples/texture/arrays/index.html +0 -156
  174. package/dist/website/examples/texture/textureWrap/example.html +0 -169
  175. package/dist/website/examples/texture/textureWrap/index.html +0 -121
  176. package/dist/website/examples/transform/propagation/example.html +0 -141
  177. package/dist/website/examples/transform/propagation/index.html +0 -93
  178. package/dist/website/guide/api-map/index.html +0 -82
  179. package/dist/website/guide/camera-and-controls/index.html +0 -62
  180. package/dist/website/guide/first-scene/index.html +0 -119
  181. package/dist/website/guide/index.html +0 -58
  182. package/dist/website/guide/installation/index.html +0 -133
  183. package/dist/website/guide/materials-and-lighting/index.html +0 -90
  184. package/dist/website/guide/plugins-and-render-pipeline/index.html +0 -89
  185. package/dist/website/guide/render-targets-and-views/index.html +0 -95
  186. package/dist/website/guide/scene-graph-and-transforms/index.html +0 -69
  187. package/dist/website/guide/textures-and-assets/index.html +0 -85
  188. package/dist/website/guide/troubleshooting/index.html +0 -39
  189. package/dist/website/images/disappointed.jpg +0 -0
  190. package/dist/website/images/skybox/grimmnight_back.png +0 -0
  191. package/dist/website/images/skybox/grimmnight_bottom.png +0 -0
  192. package/dist/website/images/skybox/grimmnight_front.png +0 -0
  193. package/dist/website/images/skybox/grimmnight_left.png +0 -0
  194. package/dist/website/images/skybox/grimmnight_right.png +0 -0
  195. package/dist/website/images/skybox/grimmnight_top.png +0 -0
  196. package/dist/website/images/skybox/miramar_back.png +0 -0
  197. package/dist/website/images/skybox/miramar_bottom.png +0 -0
  198. package/dist/website/images/skybox/miramar_front.png +0 -0
  199. package/dist/website/images/skybox/miramar_left.png +0 -0
  200. package/dist/website/images/skybox/miramar_right.png +0 -0
  201. package/dist/website/images/skybox/miramar_top.png +0 -0
  202. package/dist/website/images/uv.jpg +0 -0
  203. package/dist/website/index.html +0 -157
  204. package/dist/website/models/glb/AlphaBlendModeTest.glb +0 -0
  205. package/dist/website/models/glb/IridescenceLamp.glb +0 -0
  206. package/dist/website/models/glb/teapot.glb +0 -0
  207. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.png +0 -0
  208. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.png +0 -0
  209. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.png +0 -0
  210. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.png +0 -0
  211. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.png +0 -0
  212. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.png +0 -0
  213. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_BaseColor.png +0 -0
  214. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_Normal.png +0 -0
  215. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png +0 -0
  216. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.png +0 -0
  217. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_Normal.png +0 -0
  218. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.png +0 -0
  219. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.png +0 -0
  220. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_Normal.png +0 -0
  221. package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.png +0 -0
  222. package/dist/website/models/gltf/flight_helmet/index.bin +0 -0
  223. package/dist/website/models/gltf/flight_helmet/index.gltf +0 -705
  224. package/dist/website/models/gltf/object.gltf +0 -23
  225. package/dist/website/models/gltf/pirate_girl/index.bin +0 -0
  226. package/dist/website/models/gltf/pirate_girl/index.gltf +0 -2082
  227. package/dist/website/models/obj/pirate_girl/pirate_girl.obj +0 -18459
  228. package/dist/website/models/obj/pirate_girl/pirate_girl.png +0 -0
  229. package/env.d.ts +0 -5
  230. package/examples/camera/orthographic.js +0 -121
  231. package/examples/camera/perspective.js +0 -139
  232. package/examples/camera/tone_mapping.js +0 -187
  233. package/examples/lights/directional.js +0 -396
  234. package/examples/lights/multiple_spot_lights.js +0 -305
  235. package/examples/lights/point.js +0 -336
  236. package/examples/lights/spot.js +0 -365
  237. package/examples/loader/gltf/basic.js +0 -78
  238. package/examples/loader/gltf/material/alpha-blend-mode.js +0 -80
  239. package/examples/loader/gltf/material/flight_helmet.js +0 -111
  240. package/examples/loader/gltf/material/iridescence_lamp.js +0 -118
  241. package/examples/loader/objloader.js +0 -93
  242. package/examples/material/cullface.js +0 -112
  243. package/examples/material/materials.js +0 -124
  244. package/examples/material/standard/basic.js +0 -161
  245. package/examples/material/standard/reflection_refraction.js +0 -190
  246. package/examples/mesh/capsule.js +0 -122
  247. package/examples/mesh/circle.js +0 -122
  248. package/examples/mesh/cone.js +0 -129
  249. package/examples/mesh/cuboid.js +0 -156
  250. package/examples/mesh/cylinder.js +0 -144
  251. package/examples/mesh/dodecahedron.js +0 -107
  252. package/examples/mesh/ellipsoid.js +0 -128
  253. package/examples/mesh/extrude.js +0 -118
  254. package/examples/mesh/frustum.js +0 -134
  255. package/examples/mesh/helix.js +0 -133
  256. package/examples/mesh/icosahedron.js +0 -107
  257. package/examples/mesh/icosphere.js +0 -112
  258. package/examples/mesh/lathe.js +0 -124
  259. package/examples/mesh/meshTopology.js +0 -159
  260. package/examples/mesh/octahedron.js +0 -107
  261. package/examples/mesh/plane.js +0 -122
  262. package/examples/mesh/prism.js +0 -122
  263. package/examples/mesh/pyramid.js +0 -121
  264. package/examples/mesh/ring.js +0 -122
  265. package/examples/mesh/skinning.js +0 -136
  266. package/examples/mesh/terrain.js +0 -163
  267. package/examples/mesh/tetrahedron.js +0 -107
  268. package/examples/mesh/torus-knot.js +0 -137
  269. package/examples/mesh/torus.js +0 -122
  270. package/examples/mesh/tube.js +0 -129
  271. package/examples/mesh/uvsphere.js +0 -118
  272. package/examples/mesh/wedge.js +0 -117
  273. package/examples/other/rotatingCube.js +0 -91
  274. package/examples/other/rotatingSphere.js +0 -93
  275. package/examples/rendertarget/basic_canvas.js +0 -127
  276. package/examples/rendertarget/depth_texture.js +0 -137
  277. package/examples/rendertarget/image_target.js +0 -145
  278. package/examples/rendertarget/multiple_views.js +0 -153
  279. package/examples/rendertarget/render_masks.js +0 -171
  280. package/examples/rendertarget/split_screen.js +0 -127
  281. package/examples/rendertarget/split_view.js +0 -140
  282. package/examples/skybox/skybox.js +0 -111
  283. package/examples/texture/arrays.js +0 -153
  284. package/examples/texture/textureWrap.js +0 -118
  285. package/examples/transform/propagation.js +0 -90
  286. package/rollup.config.js +0 -66
  287. package/src/caches/cache.js +0 -359
  288. package/src/caches/index.js +0 -2
  289. package/src/caches/uniformbuffers.js +0 -93
  290. package/src/cameracontrols/index.js +0 -258
  291. package/src/constants/index.js +0 -3
  292. package/src/constants/mesh.js +0 -197
  293. package/src/constants/others.js +0 -218
  294. package/src/constants/texture.js +0 -183
  295. package/src/content.config.js +0 -1
  296. package/src/core/constants.js +0 -14
  297. package/src/core/extensions.js +0 -42
  298. package/src/core/index.js +0 -7
  299. package/src/core/layouts/bindgroup.js +0 -167
  300. package/src/core/layouts/index.js +0 -6
  301. package/src/core/layouts/meshvertex.js +0 -60
  302. package/src/core/layouts/pipeline.js +0 -165
  303. package/src/core/layouts/uniform.js +0 -21
  304. package/src/core/layouts/uniformbuffer.js +0 -23
  305. package/src/core/layouts/vertexbuffer.js +0 -43
  306. package/src/core/limits.js +0 -247
  307. package/src/core/resources/blendparams.js +0 -89
  308. package/src/core/resources/gpubuffer.js +0 -53
  309. package/src/core/resources/gpumesh.js +0 -76
  310. package/src/core/resources/gpusampler.js +0 -43
  311. package/src/core/resources/gputexture.js +0 -102
  312. package/src/core/resources/index.js +0 -7
  313. package/src/core/resources/newuniformbuffer.js +0 -58
  314. package/src/core/resources/webglshadermodule.js +0 -58
  315. package/src/core/shader.js +0 -75
  316. package/src/core/webgl/bindgroup.js +0 -247
  317. package/src/core/webgl/descriptors.js +0 -166
  318. package/src/core/webgl/gpuqueue.js +0 -63
  319. package/src/core/webgl/index.js +0 -8
  320. package/src/core/webgl/renderpassencoder.js +0 -783
  321. package/src/core/webgl/renderpipeline.js +0 -91
  322. package/src/core/webgl/utils.js +0 -521
  323. package/src/core/webgl/webglrenderdevice.js +0 -259
  324. package/src/function.js +0 -358
  325. package/src/index.js +0 -15
  326. package/src/loader/gltf.js +0 -2722
  327. package/src/loader/index.js +0 -3
  328. package/src/loader/loader.js +0 -174
  329. package/src/loader/obj.js +0 -188
  330. package/src/loader/texture.js +0 -138
  331. package/src/loader/utils.js +0 -60
  332. package/src/material/alphablend.js +0 -21
  333. package/src/material/basic.js +0 -89
  334. package/src/material/depth.js +0 -87
  335. package/src/material/index.js +0 -9
  336. package/src/material/lambert.js +0 -87
  337. package/src/material/material.js +0 -148
  338. package/src/material/normal.js +0 -44
  339. package/src/material/phong.js +0 -100
  340. package/src/material/raw.js +0 -71
  341. package/src/material/standard.js +0 -309
  342. package/src/math/index.js +0 -3
  343. package/src/math/transform.js +0 -38
  344. package/src/mesh/attribute/attribute.js +0 -79
  345. package/src/mesh/attribute/index.js +0 -1
  346. package/src/mesh/attributedata/index.js +0 -1
  347. package/src/mesh/attributedata/separate.js +0 -180
  348. package/src/mesh/builders/base.js +0 -41
  349. package/src/mesh/builders/capsule.js +0 -47
  350. package/src/mesh/builders/circle.js +0 -63
  351. package/src/mesh/builders/cone.js +0 -29
  352. package/src/mesh/builders/cuboid.js +0 -135
  353. package/src/mesh/builders/cylinder.js +0 -131
  354. package/src/mesh/builders/dodecahedron.js +0 -130
  355. package/src/mesh/builders/ellipsoid.js +0 -65
  356. package/src/mesh/builders/extrude.js +0 -136
  357. package/src/mesh/builders/frustum.js +0 -26
  358. package/src/mesh/builders/geometry.js +0 -121
  359. package/src/mesh/builders/helix.js +0 -35
  360. package/src/mesh/builders/icosahedron.js +0 -61
  361. package/src/mesh/builders/icosphere.js +0 -141
  362. package/src/mesh/builders/index.js +0 -28
  363. package/src/mesh/builders/lathe.js +0 -85
  364. package/src/mesh/builders/octahedron.js +0 -43
  365. package/src/mesh/builders/plane.js +0 -73
  366. package/src/mesh/builders/polyhedron.js +0 -121
  367. package/src/mesh/builders/prism.js +0 -19
  368. package/src/mesh/builders/pyramid.js +0 -90
  369. package/src/mesh/builders/ring.js +0 -109
  370. package/src/mesh/builders/surfaces.js +0 -69
  371. package/src/mesh/builders/terrain.js +0 -80
  372. package/src/mesh/builders/tetrahedron.js +0 -37
  373. package/src/mesh/builders/torusknot.js +0 -36
  374. package/src/mesh/builders/tube.js +0 -209
  375. package/src/mesh/builders/utils.js +0 -148
  376. package/src/mesh/builders/uvsphere.js +0 -80
  377. package/src/mesh/builders/wedge.js +0 -22
  378. package/src/mesh/builders/wireframe.js +0 -62
  379. package/src/mesh/index.js +0 -4
  380. package/src/mesh/mesh.js +0 -157
  381. package/src/objects/bone.js +0 -17
  382. package/src/objects/camera/camera.js +0 -159
  383. package/src/objects/camera/index.js +0 -2
  384. package/src/objects/camera/projection.js +0 -203
  385. package/src/objects/debug/index.js +0 -1
  386. package/src/objects/debug/skeleton.js +0 -28
  387. package/src/objects/index.js +0 -7
  388. package/src/objects/light/ambient.js +0 -41
  389. package/src/objects/light/directional.js +0 -51
  390. package/src/objects/light/index.js +0 -5
  391. package/src/objects/light/point.js +0 -56
  392. package/src/objects/light/shadow/index.js +0 -1
  393. package/src/objects/light/shadow/shadow.js +0 -67
  394. package/src/objects/light/spot.js +0 -82
  395. package/src/objects/mesh.js +0 -89
  396. package/src/objects/object3d.js +0 -167
  397. package/src/objects/skybox.js +0 -38
  398. package/src/plugins/camera/RenderTarget2DPool.js +0 -94
  399. package/src/plugins/camera/camera.js +0 -27
  400. package/src/plugins/camera/index.js +0 -4
  401. package/src/plugins/camera/nodes/canvasblit.js +0 -153
  402. package/src/plugins/camera/nodes/index.js +0 -5
  403. package/src/plugins/camera/nodes/opaquepass.js +0 -94
  404. package/src/plugins/camera/nodes/tonemapping.js +0 -217
  405. package/src/plugins/camera/nodes/transparentpass.js +0 -87
  406. package/src/plugins/camera/nodes/view.js +0 -72
  407. package/src/plugins/camera/resources/cameracolortargets.js +0 -66
  408. package/src/plugins/camera/resources/canvasblitpipeline.js +0 -6
  409. package/src/plugins/camera/resources/index.js +0 -3
  410. package/src/plugins/camera/resources/tonemappingpipeline.js +0 -6
  411. package/src/plugins/index.js +0 -6
  412. package/src/plugins/light/index.js +0 -2
  413. package/src/plugins/light/light.js +0 -19
  414. package/src/plugins/light/nodes/index.js +0 -1
  415. package/src/plugins/light/nodes/light.js +0 -127
  416. package/src/plugins/meshmaterial/index.js +0 -3
  417. package/src/plugins/meshmaterial/meshmaterial.js +0 -644
  418. package/src/plugins/meshmaterial/nodes/index.js +0 -1
  419. package/src/plugins/meshmaterial/nodes/meshmaterial.js +0 -83
  420. package/src/plugins/meshmaterial/resources/bonetexture.js +0 -176
  421. package/src/plugins/meshmaterial/resources/environmentmap.js +0 -44
  422. package/src/plugins/meshmaterial/resources/index.js +0 -5
  423. package/src/plugins/meshmaterial/resources/materialuniformbuffers.js +0 -94
  424. package/src/plugins/meshmaterial/resources/meshmaterialbindgroups.js +0 -40
  425. package/src/plugins/meshmaterial/resources/meshmaterialpipelines.js +0 -50
  426. package/src/plugins/shadow/index.js +0 -3
  427. package/src/plugins/shadow/nodes/index.js +0 -3
  428. package/src/plugins/shadow/nodes/occluder.js +0 -106
  429. package/src/plugins/shadow/nodes/opaquePass.js +0 -110
  430. package/src/plugins/shadow/nodes/view.js +0 -272
  431. package/src/plugins/shadow/resources/ShadowMap.js +0 -99
  432. package/src/plugins/shadow/resources/index.js +0 -2
  433. package/src/plugins/shadow/resources/shadowpipelines.js +0 -25
  434. package/src/plugins/shadow/shadow.js +0 -26
  435. package/src/plugins/skeletonhelper/index.js +0 -1
  436. package/src/plugins/skeletonhelper/skeletonhelper.js +0 -202
  437. package/src/plugins/skybox/index.js +0 -3
  438. package/src/plugins/skybox/nodes/index.js +0 -1
  439. package/src/plugins/skybox/nodes/skybox.js +0 -335
  440. package/src/plugins/skybox/resources/index.js +0 -2
  441. package/src/plugins/skybox/resources/skyboxmesh.js +0 -14
  442. package/src/plugins/skybox/resources/skyboxpipeline.js +0 -16
  443. package/src/plugins/skybox/skybox.js +0 -18
  444. package/src/renderer/core/index.js +0 -293
  445. package/src/renderer/graph/index.js +0 -3
  446. package/src/renderer/graph/nodes.js +0 -34
  447. package/src/renderer/graph/rendergraph.js +0 -182
  448. package/src/renderer/index.js +0 -5
  449. package/src/renderer/plugin.js +0 -16
  450. package/src/renderer/renderer.js +0 -195
  451. package/src/renderer/views.js +0 -28
  452. package/src/rendertarget/canvastarget.js +0 -33
  453. package/src/rendertarget/image.js +0 -132
  454. package/src/rendertarget/index.js +0 -3
  455. package/src/rendertarget/rendertarget.js +0 -89
  456. package/src/shader/basicFragment.glsl +0 -38
  457. package/src/shader/basicVertex.glsl +0 -98
  458. package/src/shader/blitFragment.glsl +0 -9
  459. package/src/shader/common/color.glsl +0 -7
  460. package/src/shader/common/common.glsl +0 -54
  461. package/src/shader/common/index.js +0 -5
  462. package/src/shader/common/light.glsl +0 -437
  463. package/src/shader/common/math.glsl +0 -12
  464. package/src/shader/common/tonemap.glsl +0 -118
  465. package/src/shader/debug/index.js +0 -2
  466. package/src/shader/debug/skeletonFragment.glsl +0 -6
  467. package/src/shader/debug/skeletonVertex.glsl +0 -25
  468. package/src/shader/depthFragment.glsl +0 -34
  469. package/src/shader/fullscreenVertex.glsl +0 -26
  470. package/src/shader/index.js +0 -14
  471. package/src/shader/lambertFragment.glsl +0 -134
  472. package/src/shader/normalFragment.glsl +0 -22
  473. package/src/shader/phongFragment.glsl +0 -148
  474. package/src/shader/skyboxFragment.glsl +0 -16
  475. package/src/shader/skyboxVertex.glsl +0 -21
  476. package/src/shader/standardFragment.glsl +0 -331
  477. package/src/shader/tonemappingFragment.glsl +0 -37
  478. package/src/texture/index.js +0 -2
  479. package/src/texture/sampler.js +0 -191
  480. package/src/texture/texture.js +0 -438
  481. package/src/utils/index.js +0 -129
  482. package/src/utils/rendergraph_gui.js +0 -583
  483. package/tsconfig.json +0 -11
package/astro.config.mjs DELETED
@@ -1,33 +0,0 @@
1
- import { defineConfig } from "astro/config";
2
- import { readFileSync } from "node:fs";
3
- import { website } from "wima-docs-website-template";
4
-
5
- function glsl() {
6
- return {
7
- name: "glsl",
8
- enforce: "pre",
9
- load(id) {
10
- if (!id.endsWith(".glsl")) {
11
- return null;
12
- }
13
-
14
- return `export default ${JSON.stringify(readFileSync(id, "utf8"))}`;
15
- },
16
- };
17
- }
18
-
19
- export default defineConfig({
20
- output: "static",
21
- compressHTML: true,
22
- publicDir: "./assets",
23
- outDir: "./dist/website",
24
- vite: {
25
- plugins: [glsl()],
26
- },
27
- integrations: [website({
28
- guideRoute: "/guide",
29
- examplesRoute: "/examples",
30
- guideContentDir: "content/guide",
31
- examplesContentDir: "examples"
32
- })],
33
- });
@@ -1,89 +0,0 @@
1
- ---
2
- title: "API Map"
3
- ---
4
-
5
- # API Map
6
-
7
- This is a high-level map of the public surface exported from `src/index.js`.
8
-
9
- ## Quick Import Example
10
-
11
- ```js
12
- import {
13
- WebGLRenderDevice,
14
- WebGLRenderer,
15
- Camera,
16
- MeshMaterial3D,
17
- MeshMaterialPlugin,
18
- CameraPlugin
19
- } from "chorama";
20
- ```
21
-
22
- ## Rendering Core
23
-
24
- - `WebGLRenderDevice`
25
- - `WebGLRenderer`
26
- - Core descriptors/pipeline types from `core`
27
-
28
- ## Scene Objects
29
-
30
- - `Object3D`
31
- - `MeshMaterial3D`
32
- - `Camera`
33
- - `SkyBox`
34
- - `Bone3D`
35
-
36
- ## Materials
37
-
38
- - `BasicMaterial`
39
- - `LambertMaterial`
40
- - `PhongMaterial`
41
- - `StandardMaterial`
42
- - `RawMaterial`
43
- - Debug variants (`NormalMaterial`, `DepthMaterial`)
44
-
45
- ## Lighting
46
-
47
- - `AmbientLight`
48
- - `DirectionalLight`
49
- - `PointLight`
50
- - `SpotLight`
51
- - Shadow helpers
52
-
53
- ## Geometry and Mesh
54
-
55
- - `Mesh`
56
- - Mesh builders: `PlaneMeshBuilder`, `CuboidMeshBuilder`, `UVSphereMeshBuilder`, etc.
57
- - `Attribute` and attribute-data utilities
58
-
59
- ## Camera and Control
60
-
61
- - `PerspectiveProjection`
62
- - `OrthographicProjection`
63
- - `OrbitCameraControls`
64
-
65
- ## Assets and Textures
66
-
67
- - `TextureLoader`
68
- - `OBJLoader`
69
- - `GLTFLoader`
70
- - `Texture`, `Sampler`
71
-
72
- ## Render Targets
73
-
74
- - `CanvasTarget`
75
- - `ImageTarget`
76
- - `RenderTarget`
77
-
78
- ## Plugins
79
-
80
- - `CameraPlugin`
81
- - `MeshMaterialPlugin`
82
- - `LightPlugin`
83
- - `ShadowPlugin`
84
- - `SkyboxPlugin`
85
-
86
- For real usage patterns:
87
-
88
- - [Rotating Cube](/examples/other/rotatingCube)
89
- - [Examples Overview](/examples)
@@ -1,98 +0,0 @@
1
- ---
2
- title: "Camera and Controls"
3
- ---
4
-
5
- # Camera and Controls
6
-
7
- This guide assumes you already have a working render loop from [First Scene](/guide/first-scene).
8
- Here, we only focus on camera setup and controls.
9
-
10
- ## What You Will Add
11
-
12
- - one camera bound to a render target
13
- - a perspective projection setup
14
- - orbit controls for mouse/touch navigation
15
-
16
- ## Step 1: Import Camera APIs
17
-
18
- ```js
19
- import {
20
- Camera,
21
- PerspectiveProjection,
22
- OrthographicProjection,
23
- OrbitCameraControls
24
- } from "chorama";
25
- ```
26
-
27
- You only need `OrthographicProjection` if you plan to switch projection type.
28
-
29
- ## Step 2: Create a Camera
30
-
31
- ```js
32
- const camera = new Camera(target);
33
- camera.transform.position.z = 3;
34
- ```
35
-
36
- `target` should be your existing `CanvasTarget`.
37
- The `z` offset keeps objects visible in front of the camera.
38
-
39
- ## Step 3: Configure Perspective Projection
40
-
41
- ```js
42
- if (camera.projection instanceof PerspectiveProjection) {
43
- camera.projection.fov = Math.PI / 3;
44
- camera.projection.aspect = innerWidth / innerHeight;
45
- }
46
- ```
47
-
48
- Use this as the default for most real-time 3D scenes.
49
-
50
- ## Step 4: Add Orbit Controls
51
-
52
- ```js
53
- const controls = new OrbitCameraControls(camera, canvas);
54
- controls.distance = 4;
55
- ```
56
-
57
- `canvas` should be the element receiving pointer input.
58
- `distance` controls how far the orbit camera stays from its target.
59
-
60
- ## Step 5: Update Controls in the Frame Loop
61
-
62
- ```js
63
- function frame() {
64
- controls.update();
65
- renderer.render([object, camera], device);
66
- requestAnimationFrame(frame);
67
- }
68
-
69
- requestAnimationFrame(frame);
70
- ```
71
-
72
- Call `controls.update()` every frame before rendering.
73
- If you skip it, input changes will not be applied.
74
-
75
- ## Switch to Orthographic Projection
76
-
77
- Use orthographic projection when you need no perspective foreshortening.
78
-
79
- ```js
80
- const ortho = new OrthographicProjection();
81
- ortho.left = -5;
82
- ortho.right = 5;
83
- ortho.top = 5;
84
- ortho.bottom = -5;
85
-
86
- camera.projection = ortho;
87
- ```
88
-
89
- For orthographic cameras, update bounds yourself when viewport shape changes.
90
-
91
- ## Reference Examples
92
-
93
- If you want to compare against an example, see:
94
-
95
- - [Perspective Camera](/examples/camera/perspective)
96
- - [Orthographic Camera](/examples/camera/orthographic)
97
-
98
- After this works, continue with [Materials and Lighting](/guide/materials-and-lighting).
@@ -1,176 +0,0 @@
1
- ---
2
- title: "First Scene"
3
- ---
4
-
5
- # First Scene
6
-
7
- This guide helps you render your first object on screen with the smallest useful setup.
8
- You will build one scene with:
9
-
10
- - one canvas
11
- - one render device
12
- - one renderer
13
- - one camera
14
- - one cube mesh
15
- - one animation loop
16
-
17
- The goal is to get a stable baseline you can reuse in every new project.
18
-
19
- ## What You Will Build
20
-
21
- At the end, you will have a rotating cube rendered each frame.
22
- No lighting setup, model loading, or advanced scene graph features are required here.
23
- Those topics are covered in other dedicated guides.
24
-
25
- ## Before You Start
26
-
27
- Make sure you already have a working local install from [Installation](/guide/installation).
28
- You should be able to import from `chorama` or your local alias path.
29
-
30
- ## Build Your first scene
31
-
32
- In your source file, do the following:
33
-
34
- ### Step 1: Import what you need
35
-
36
- ```js
37
- import {
38
- WebGLRenderDevice,
39
- CanvasTarget,
40
- WebGLRenderer,
41
- Camera,
42
- PerspectiveProjection,
43
- MeshMaterial3D,
44
- BasicMaterial,
45
- CuboidMeshBuilder,
46
- Quaternion,
47
- MeshMaterialPlugin,
48
- CameraPlugin
49
- } from "chorama";
50
- ```
51
-
52
- This imports all the items we require for this setup.
53
-
54
- ### Step 2: Create and mount a canvas
55
-
56
- ```js
57
- const canvas = document.createElement("canvas");
58
- document.body.append(canvas);
59
- ```
60
- Create the canvas and appends it to the body of the html document
61
-
62
- ### Step 3: Create device and render target
63
-
64
- ```js
65
- const device = new WebGLRenderDevice(canvas, { depth: true });
66
- const target = new CanvasTarget(canvas);
67
- ```
68
-
69
- The `device` manages GPU-side rendering operations.
70
- The `target` is the camera output surface.
71
-
72
- ### Step 4: Create renderer and required plugins
73
-
74
- ```js
75
- const renderer = new WebGLRenderer({
76
- plugins: [new MeshMaterialPlugin(), new CameraPlugin()]
77
- });
78
- ```
79
-
80
- These two plugins are required for this scene:
81
-
82
- - `MeshMaterialPlugin` draws mesh plus material objects.
83
- - `CameraPlugin` enables camera processing in the render pass.
84
-
85
- ### Step 5: Create and position a camera
86
-
87
- ```js
88
- const camera = new Camera(target);
89
- camera.transform.position.z = 2.5;
90
-
91
- if (camera.projection instanceof PerspectiveProjection) {
92
- camera.projection.fov = Math.PI / 3;
93
- camera.projection.aspect = 1;
94
- }
95
- ```
96
-
97
- Moving camera on `z` ensures the cube is in front of the view.
98
- The initial `aspect` is a temporary placeholder; resize will set the real value.
99
-
100
- ### Step 6: Create a cube object
101
-
102
- ```js
103
- const cubeMesh = new CuboidMeshBuilder().build();
104
- const cubeMaterial = new BasicMaterial();
105
- const cube = new MeshMaterial3D(cubeMesh, cubeMaterial);
106
- ```
107
-
108
- This creates one drawable object with default shading.
109
- Using `BasicMaterial` for an object that has no lighting applied to it.
110
-
111
- ### Step 7: Define per-frame rotation
112
-
113
- ```js
114
- const stepRotation = Quaternion.fromEuler(0.01, 0.01, 0.0);
115
- ```
116
-
117
- This rotation is multiplied into cube orientation each frame to animate motion.
118
-
119
- ### Step 8: Add resize handling
120
-
121
- ```js
122
- function resize() {
123
- const cssWidth = window.innerWidth;
124
- const cssHeight = window.innerHeight;
125
- const dpr = window.devicePixelRatio || 1;
126
-
127
- canvas.style.width = cssWidth + "px";
128
- canvas.style.height = cssHeight + "px";
129
- canvas.width = Math.floor(cssWidth * dpr);
130
- canvas.height = Math.floor(cssHeight * dpr);
131
-
132
- if (camera.projection instanceof PerspectiveProjection) {
133
- camera.projection.aspect = cssWidth / cssHeight;
134
- }
135
- }
136
-
137
- window.addEventListener("resize", resize);
138
- resize();
139
- ```
140
-
141
- This keeps render resolution sharp and camera projection correct.
142
- If you skip this, stretching and blur are likely on resize or high-DPI screens.
143
-
144
- ### Step 9: Start the render loop
145
-
146
- ```js
147
- function frame() {
148
- cube.transform.orientation.multiply(stepRotation);
149
- renderer.render([cube, camera], device);
150
- requestAnimationFrame(frame);
151
- }
152
-
153
- requestAnimationFrame(frame);
154
- ```
155
-
156
- Each frame does three things: update state, render, schedule next frame.
157
-
158
- ## What You Can Try Next
159
-
160
- Change only one variable at a time:
161
-
162
- - move camera: `camera.transform.position.z = 4`
163
- - stop rotation: remove `cube.transform.orientation.multiply(stepRotation)`
164
- - rotate one axis only: `Quaternion.fromEuler(0.0, 0.01, 0.0)`
165
- - change shape: replace `CuboidMeshBuilder` with another mesh builder
166
-
167
- These changes help verify your scene wiring before adding complexity.
168
-
169
- ## Reference Example
170
-
171
- If you want to compare against an example, see:
172
-
173
- - [Rotating Cube](/examples/other/rotatingCube)
174
-
175
- After this works, continue with [Camera and Controls](/guide/camera-and-controls).
176
-
@@ -1,72 +0,0 @@
1
- ---
2
- title: "Guide"
3
- ---
4
-
5
- # Guide
6
-
7
- This guide helps you build scenes with Chorama using practical, task-first steps.
8
-
9
- ## Overview
10
-
11
- Chorama is a modular WebGL2 rendering library focused on explicit control: you compose render behavior with plugins, build scenes from reusable object/material/light primitives, and keep direct visibility into the render flow.
12
-
13
- > [!WARNING]
14
- > Chorama is currently experimental and is not recommended for production use.
15
- > Expect API changes, behavior changes and breaking changes as the library evolves.
16
-
17
- This guide is structured to take you from first render to production-style scene setup. Instead of covering every class in isolation first, each chapter is anchored to a concrete task and points you to full runnable examples.
18
-
19
- By the end of this guide, you should be able to:
20
-
21
- - Set up a render loop with `WebGLRenderDevice`, `CanvasTarget`, and `WebGLRenderer`
22
- - Build and animate scene objects with camera, materials, and lights
23
- - Load texture/model assets and handle async content safely
24
- - Use render targets and view configuration for offscreen and multi-view scenarios
25
- - Understand the plugin-driven pipeline enough to debug and extend behavior
26
-
27
- ## Who This Guide Is For
28
-
29
- Use this if you want direct WebGL2 control but still want reusable building blocks.
30
-
31
- ## How To Use This Guide
32
-
33
- - New to Chorama: follow the reading order from top to bottom.
34
- - Migrating from another renderer: start at [First Scene](/guide/first-scene), then jump to [Plugins and Render Pipeline](/guide/plugins-and-render-pipeline).
35
- - Looking for a specific API: use [API Map](/guide/api-map) as an index, then return to task pages for applied usage.
36
- - Blocked on behavior: check [Troubleshooting](/guide/troubleshooting), then compare your setup against a matching example route.
37
-
38
- ## Reading Order
39
-
40
- 1. [Installation](/guide/installation)
41
- 2. [First Scene](/guide/first-scene)
42
- 3. [Camera and Controls](/guide/camera-and-controls)
43
- 4. [Materials and Lighting](/guide/materials-and-lighting)
44
- 5. [Textures and Assets](/guide/textures-and-assets)
45
- 6. [Render Targets and Views](/guide/render-targets-and-views)
46
- 7. [Scene Graph and Transforms](/guide/scene-graph-and-transforms)
47
- 8. [Plugins and Render Pipeline](/guide/plugins-and-render-pipeline)
48
- 9. [API Map](/guide/api-map)
49
- 10. [Troubleshooting](/guide/troubleshooting)
50
-
51
- ## Core Flow
52
-
53
- The snippet below creates the minimum pieces needed to render a scene:
54
-
55
- ```js
56
- import { WebGLRenderDevice, CanvasTarget, WebGLRenderer, Camera } from "chorama";
57
-
58
- const canvas = document.createElement("canvas");
59
- const device = new WebGLRenderDevice(canvas, { depth: true });
60
- const target = new CanvasTarget(canvas);
61
- const renderer = new WebGLRenderer();
62
- const camera = new Camera(target);
63
- ```
64
- The `canvas` is the HTML surface where we draw on (or in a more technical terms, render to).
65
- The `WebGLRenderDevice` executes our draw commands.
66
- The `CanvasTarget` tells the camera where to render to. There is another type of target but thats for later.
67
- The `WebGLRenderer` runs the render pipeline each frame.
68
- The `Camera` provides view/projection data the renderer needs.
69
-
70
- This snippet exists to show the baseline setup used in almost every example, so later chapters can add one concept at a time without repeating setup details.
71
-
72
- For a complete runnable example, start with [Rotating Cube](/examples/other/rotatingCube).
@@ -1,179 +0,0 @@
1
- ---
2
- title: "Installation"
3
- ---
4
-
5
- # Installation
6
-
7
- Choose how you want to use the library:
8
-
9
- - If you want to use it now: use **Manual Installation**.
10
- - If you are waiting for package distribution: see **NPM** or **CDN**.
11
-
12
- ## NPM
13
-
14
- > [!Note]
15
- > This method is not yet available.
16
-
17
- ## CDN
18
-
19
- > [!Note]
20
- > This method is not yet available.
21
-
22
- ## Manual Installation
23
-
24
- ### 1) Requirements
25
-
26
- Install these first:
27
-
28
- - [Git](https://git-scm.com/downloads) to clone the source code
29
- - [Node.js 18+](https://nodejs.org/) (includes npm) to install dependencies and build
30
- - A browser with WebGL2 support to run your app/examples
31
-
32
- ### 2) Clone the repository and install dependencies
33
-
34
- ```bash
35
- git clone https://github.com/waynemwashuma/chorama.git
36
- cd chorama
37
- npm install
38
- ```
39
-
40
- ### 3) Build the library files
41
-
42
- ```bash
43
- npm run build-src
44
- ```
45
-
46
- This creates build output in `dist/`, including:
47
-
48
- - `dist/index.umd.js`
49
- - `dist/index.module.js`
50
-
51
- Optional: if you also want local docs/examples output, run:
52
-
53
- ```bash
54
- npm run build
55
- ```
56
-
57
- ### 4) Copy files to your project
58
-
59
- Copy one or both build files into your own project.
60
-
61
- - Use `dist/index.module.js` for ESM usage (recommended).
62
- - Use `dist/index.umd.js` for plain script-tag usage.
63
-
64
- Example layout used below:
65
-
66
- ```text
67
- your-project/
68
- libs/
69
- chorama/
70
- index.module.js
71
- index.umd.js
72
- ```
73
-
74
- ### 5) Use in your project
75
-
76
- #### ESM (recommended)
77
-
78
- If you use a bundler, set an alias so your app can import from `"chorama"` directly.
79
-
80
- ##### Vite (`vite.config.js`)
81
-
82
- ```js
83
- import { defineConfig } from "vite";
84
- import path from "node:path";
85
- import { fileURLToPath } from "node:url";
86
-
87
- const __filename = fileURLToPath(import.meta.url);
88
- const __dirname = path.dirname(__filename);
89
-
90
- export default defineConfig({
91
- resolve: {
92
- alias: {
93
- chorama: path.resolve(__dirname, "libs/chorama/index.module.js")
94
- }
95
- }
96
- });
97
- ```
98
-
99
- ##### Webpack (`webpack.config.js`)
100
-
101
- ```js
102
- const path = require("node:path");
103
-
104
- module.exports = {
105
- resolve: {
106
- alias: {
107
- chorama: path.resolve(__dirname, "libs/chorama/index.module.js")
108
- }
109
- }
110
- };
111
- ```
112
-
113
- Then import in app code:
114
-
115
- ```js
116
- import { WebGLRenderer, MeshMaterialPlugin, CameraPlugin } from "chorama";
117
- ```
118
-
119
- #### Plain HTML with browser import maps (no bundler)
120
-
121
- Use the ESM file with an import map:
122
-
123
- ```html
124
- <!doctype html>
125
- <html>
126
- <head>
127
- <meta charset="utf-8" />
128
- <meta name="viewport" content="width=device-width, initial-scale=1" />
129
- <title>Chorama - Import Map</title>
130
- <script type="importmap">
131
- {
132
- "imports": {
133
- "chorama": "./libs/chorama/index.module.js"
134
- }
135
- }
136
- </script>
137
- </head>
138
- <body>
139
- <canvas id="app"></canvas>
140
- <script type="module">
141
- import { WebGLRenderer, MeshMaterialPlugin, CameraPlugin } from "chorama";
142
-
143
- const canvas = document.getElementById("app");
144
- const renderer = new WebGLRenderer({
145
- canvas,
146
- plugins: [new MeshMaterialPlugin(), new CameraPlugin()]
147
- });
148
- </script>
149
- </body>
150
- </html>
151
- ```
152
-
153
- #### Plain HTML with script tag (UMD)
154
-
155
- Use the UMD build if you do not want modules:
156
-
157
- ```html
158
- <!doctype html>
159
- <html>
160
- <head>
161
- <meta charset="utf-8" />
162
- <meta name="viewport" content="width=device-width, initial-scale=1" />
163
- <title>Chorama - Plain HTML</title>
164
- <script src="./libs/chorama/index.umd.js"></script>
165
- </head>
166
- <body>
167
- <canvas id="app"></canvas>
168
- <script>
169
- const { WebGLRenderer, MeshMaterialPlugin, CameraPlugin } = window.CHORAMA;
170
- const canvas = document.getElementById("app");
171
-
172
- const renderer = new WebGLRenderer({
173
- canvas,
174
- plugins: [new MeshMaterialPlugin(), new CameraPlugin()]
175
- });
176
- </script>
177
- </body>
178
- </html>
179
- ```