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
@@ -1,218 +0,0 @@
1
- /**
2
- * @enum {number}
3
- * Uniform types (scalars, vectors, matrices, and samplers).
4
- */
5
- export const UniformType = /** @type {const} */({
6
- // Scalars
7
- Float: 0x1406,
8
- Int: 0x1404,
9
- Uint: 0x1405,
10
- Bool: 0x8B56,
11
-
12
- // Float vectors
13
- Vec2: 0x8B50,
14
- Vec3: 0x8B51,
15
- Vec4: 0x8B52,
16
-
17
- // Int vectors
18
- IVec2: 0x8B53,
19
- IVec3: 0x8B54,
20
- IVec4: 0x8B55,
21
-
22
- // Unsigned int vectors
23
- UVec2: 0x8DC6,
24
- UVec3: 0x8DC7,
25
- UVec4: 0x8DC8,
26
-
27
- // Bool vectors
28
- BVec2: 0x8B57,
29
- BVec3: 0x8B58,
30
- BVec4: 0x8B59,
31
-
32
- // Matrices
33
- Mat2: 0x8B5A,
34
- Mat3: 0x8B5B,
35
- Mat4: 0x8B5C,
36
- Mat2x3: 0x8B65,
37
- Mat2x4: 0x8B66,
38
- Mat3x2: 0x8B67,
39
- Mat3x4: 0x8B68,
40
- Mat4x2: 0x8B69,
41
- Mat4x3: 0x8B6A,
42
-
43
- // Samplers
44
- Sampler2D: 0x8B5E,
45
- Sampler3D: 0x8B5F,
46
- SamplerCube: 0x8B60,
47
- Sampler2DShadow: 0x8B62,
48
- Sampler2DArray: 0x8DC1,
49
- Sampler2DArrayShadow: 0x8DC4,
50
- SamplerCubeShadow: 0x8DC5,
51
-
52
- // Integer samplers
53
- ISampler2D: 0x8DCA,
54
- ISampler3D: 0x8DCB,
55
- ISamplerCube: 0x8DCC,
56
- ISampler2DArray: 0x8DCF,
57
-
58
- // Unsigned integer samplers
59
- USampler2D: 0x8DD2,
60
- USampler3D: 0x8DD3,
61
- USamplerCube: 0x8DD4,
62
- USampler2DArray: 0x8DD7
63
- })
64
-
65
- /**
66
- * @enum {number}
67
- */
68
- export const GlDataType = /** @type {const} */({
69
- Float: 0x1406,
70
- UnsignedInt: 0x1405,
71
- Int: 0x1404,
72
- UnsignedShort: 0x1403,
73
- Short: 0x1402,
74
- UnsignedByte: 0x1401,
75
- Byte: 0x1400
76
- })
77
-
78
-
79
- /**
80
- * @enum {number}
81
- */
82
- export const BufferUsage = /** @type {const} */({
83
- Static: 0x88E4,
84
- Dynamic: 0x88E8,
85
- Stream: 0x88E0
86
- })
87
-
88
- /**
89
- * @enum {number}
90
- * Buffer binding targets
91
- */
92
- export const BufferTarget = /** @type {const} */({
93
- ArrayBuffer: 0x8892, // gl.ARRAY_BUFFER
94
- ElementArrayBuffer: 0x8893, // gl.ELEMENT_ARRAY_BUFFER
95
- CopyReadBuffer: 0x8F36, // gl.COPY_READ_BUFFER
96
- CopyWriteBuffer: 0x8F37, // gl.COPY_WRITE_BUFFER
97
- PixelPackBuffer: 0x88EB, // gl.PIXEL_PACK_BUFFER
98
- PixelUnpackBuffer: 0x88EC, // gl.PIXEL_UNPACK_BUFFER
99
- UniformBuffer: 0x8A11, // gl.UNIFORM_BUFFER
100
- TransformFeedbackBuffer: 0x8C8E // gl.TRANSFORM_FEEDBACK_BUFFER
101
- })
102
-
103
- /**
104
- * @enum {number}
105
- * Face culling modes
106
- */
107
- export const CullFace = /** @type {const} */({
108
- None: 0x0000, // Represents no culling
109
- Front: 0x0404, // gl.FRONT
110
- Back: 0x0405, // gl.BACK
111
- FrontAndBack: 0x0408 // gl.FRONT_AND_BACK
112
- })
113
-
114
- /**
115
- * @enum {number}
116
- * Blend function factors
117
- */
118
- export const BlendMode = /** @type {const} */({
119
- Zero: 0x0000, // gl.ZERO
120
- One: 0x0001, // gl.ONE
121
- SrcColor: 0x0300, // gl.SRC_COLOR
122
- OneMinusSrcColor: 0x0301, // gl.ONE_MINUS_SRC_COLOR
123
- SrcAlpha: 0x0302, // gl.SRC_ALPHA
124
- OneMinusSrcAlpha: 0x0303, // gl.ONE_MINUS_SRC_ALPHA
125
- DstAlpha: 0x0304, // gl.DST_ALPHA
126
- OneMinusDstAlpha: 0x0305, // gl.ONE_MINUS_DST_ALPHA
127
- DstColor: 0x0306, // gl.DST_COLOR
128
- OneMinusDstColor: 0x0307, // gl.ONE_MINUS_DST_COLOR
129
- SrcAlphaSaturate: 0x0308, // gl.SRC_ALPHA_SATURATE
130
- ConstantColor: 0x8001, // gl.CONSTANT_COLOR
131
- OneMinusConstantColor: 0x8002, // gl.ONE_MINUS_CONSTANT_COLOR
132
- ConstantAlpha: 0x8003, // gl.CONSTANT_ALPHA
133
- OneMinusConstantAlpha: 0x8004 // gl.ONE_MINUS_CONSTANT_ALPHA
134
- })
135
-
136
- /**
137
- * @enum {number}
138
- * Blend equation modes
139
- */
140
- export const BlendEquation = /** @type {const} */({
141
- Add: 0x8006, // gl.FUNC_ADD
142
- Subtract: 0x800A, // gl.FUNC_SUBTRACT
143
- ReverseSubtract: 0x800B, // gl.FUNC_REVERSE_SUBTRACT
144
- Min: 0x8007, // gl.MIN
145
- Max: 0x8008 // gl.MAX
146
- })
147
-
148
- /**
149
- * @enum {number}
150
- * Stencil and depth buffer operations.
151
- */
152
- export const StencilOp = /** @type {const} */({
153
- Keep: 0x1E00, // gl.KEEP
154
- Zero: 0x0000, // gl.ZERO
155
- Replace: 0x1E01, // gl.REPLACE
156
- Incr: 0x1E02, // gl.INCR
157
- IncrWrap: 0x8507, // gl.INCR_WRAP
158
- Decr: 0x1E03, // gl.DECR
159
- DecrWrap: 0x8508, // gl.DECR_WRAP
160
- Invert: 0x150A // gl.INVERT
161
- })
162
-
163
- /**
164
- * @enum {number}
165
- * Polygon winding directions for front-face determination.
166
- */
167
- export const FrontFaceDirection = /** @type {const} */({
168
- CW: 0x0900, // gl.CW
169
- CCW: 0x0901 // gl.CCW
170
- })
171
-
172
- /**
173
- * @enum {number}
174
- * Primitive output modes for transform feedback
175
- */
176
- export const TransformFeedbackPrimitiveTopology = /** @type {const} */({
177
- Points: 0x0000, // gl.POINTS
178
- Lines: 0x0001, // gl.LINES
179
- Triangles: 0x0004 // gl.TRIANGLES
180
- })
181
-
182
- /**
183
- * @enum {number}
184
- * Buffer storage modes for transform feedback varyings
185
- */
186
- export const TransformFeedbackBufferMode = /** @type {const} */({
187
- Interleaved: 0x8C8C, // gl.INTERLEAVED_ATTRIBS
188
- Separate: 0x8C8D // gl.SEPARATE_ATTRIBS
189
- })
190
-
191
- /**
192
- * @enum {number}
193
- * Internal formats for renderbuffers
194
- */
195
- export const RenderbufferFormat = /** @type {const} */({
196
- Rgba4: 0x8056, // gl.RGBA4
197
- Rgb565: 0x8D62, // gl.RGB565
198
- Rgb5A1: 0x8057, // gl.RGB5_A1
199
- Depth16: 0x81A5, // gl.DEPTH_COMPONENT16
200
- Stencil8: 0x8D48, // gl.STENCIL_INDEX8
201
- Depth24: 0x81A6, // gl.DEPTH_COMPONENT24
202
- Depth32f: 0x8CAC, // gl.DEPTH_COMPONENT32F
203
- Depth24Stencil8: 0x88F0, // gl.DEPTH24_STENCIL8
204
- Depth32fStencil8: 0x8CAD // gl.DEPTH32F_STENCIL8
205
- })
206
-
207
- /**
208
- * @enum {number}
209
- */
210
- export const BufferType = /**@type {const}*/({
211
- Array:0x8892,
212
- ElementArray:0x8893,
213
- CopyRead:0x8F36,
214
- CopyWrite:0x8F37,
215
- Uniform:0x8A11,
216
- PixelPack:0x88EB,
217
- PixelUnpack:0x88EC
218
- })
@@ -1,183 +0,0 @@
1
- /**
2
- * @enum {number}
3
- */
4
- export const TextureFormat = /** @type {const} */({
5
- // --- 8-bit ---
6
- R8Unorm: 1,
7
- R8Snorm: 2,
8
- R8Uint: 3,
9
- R8Sint: 4,
10
-
11
- // --- 16-bit ---
12
- R16Uint: 5,
13
- R16Sint: 6,
14
- R16Float: 7,
15
- RG8Unorm: 8,
16
- RG8Snorm: 9,
17
- RG8Uint: 10,
18
- RG8Sint: 11,
19
-
20
- // --- 32-bit ---
21
- R32Uint: 12,
22
- R32Sint: 13,
23
- R32Float: 14,
24
- RG16Uint: 15,
25
- RG16Sint: 16,
26
- RG16Float: 17,
27
- RGBA8Unorm: 18,
28
- RGBA8UnormSRGB: 19,
29
- RGBA8Snorm: 20,
30
- RGBA8Uint: 21,
31
- RGBA8Sint: 22,
32
-
33
- // --- 64-bit ---
34
- RG32Uint: 23,
35
- RG32Sint: 24,
36
- RG32Float: 25,
37
- RGBA16Uint: 26,
38
- RGBA16Sint: 27,
39
- RGBA16Float: 28,
40
-
41
- // --- 128-bit ---
42
- RGBA32Uint: 29,
43
- RGBA32Sint: 30,
44
- RGBA32Float: 31,
45
-
46
- // --- Depth / Stencil ---
47
- Stencil8: 32,
48
- Depth16Unorm: 33,
49
- Depth24Plus: 34,
50
- Depth24PlusStencil8: 35,
51
- Depth32Float: 36,
52
- Depth32FloatStencil8: 37,
53
- })
54
-
55
- /**
56
- * @enum {number}
57
- */
58
- export const TextureFilter = /** @type {const} */({
59
- Nearest: 0x2600,
60
- Linear: 0x2601
61
- })
62
-
63
- /**
64
- * @enum {number}
65
- */
66
- export const TextureWrap = /** @type {const} */({
67
- Repeat: 0x2901,
68
- Clamp: 0x812F,
69
- MirrorRepeat: 0x8370
70
- })
71
-
72
- /**
73
- * @enum {number}
74
- * Texture binding targets
75
- */
76
- export const TextureType = /** @type {const} */({
77
- Texture2D: 0x0DE1, // gl.TEXTURE_2D
78
- Texture2DArray: 0x8C1A, // gl.TEXTURE_2D_ARRAY
79
- Texture3D: 0x806F, // gl.TEXTURE_3D
80
- TextureCubeMap: 0x8513 // gl.TEXTURE_CUBE_MAP
81
- })
82
-
83
- /**
84
- * Returns the size in bytes per texel for a given TextureFormat.
85
- * @param {TextureFormat} format
86
- * @returns {number}
87
- */
88
- export function getTextureFormatSize(format) {
89
- switch (format) {
90
- // 8-bit = 1 byte
91
- case TextureFormat.R8Unorm:
92
- case TextureFormat.R8Snorm:
93
- case TextureFormat.R8Uint:
94
- case TextureFormat.R8Sint:
95
- return 1;
96
-
97
- // 16-bit = 2 bytes
98
- case TextureFormat.R16Uint:
99
- case TextureFormat.R16Sint:
100
- case TextureFormat.R16Float:
101
- case TextureFormat.RG8Unorm:
102
- case TextureFormat.RG8Snorm:
103
- case TextureFormat.RG8Uint:
104
- case TextureFormat.RG8Sint:
105
- return 2;
106
-
107
- // 32-bit = 4 bytes
108
- case TextureFormat.R32Uint:
109
- case TextureFormat.R32Sint:
110
- case TextureFormat.R32Float:
111
- case TextureFormat.RG16Uint:
112
- case TextureFormat.RG16Sint:
113
- case TextureFormat.RG16Float:
114
- case TextureFormat.RGBA8Unorm:
115
- case TextureFormat.RGBA8UnormSRGB:
116
- case TextureFormat.RGBA8Snorm:
117
- case TextureFormat.RGBA8Uint:
118
- case TextureFormat.RGBA8Sint:
119
- return 4;
120
-
121
- // 64-bit = 8 bytes
122
- case TextureFormat.RG32Uint:
123
- case TextureFormat.RG32Sint:
124
- case TextureFormat.RG32Float:
125
- case TextureFormat.RGBA16Uint:
126
- case TextureFormat.RGBA16Sint:
127
- case TextureFormat.RGBA16Float:
128
- return 8;
129
-
130
- // 128-bit = 16 bytes
131
- case TextureFormat.RGBA32Uint:
132
- case TextureFormat.RGBA32Sint:
133
- case TextureFormat.RGBA32Float:
134
- return 16;
135
-
136
- // Depth/stencil formats — size varies and is implementation-specific
137
- case TextureFormat.Stencil8:
138
- return 1;
139
- case TextureFormat.Depth16Unorm:
140
- return 2;
141
- case TextureFormat.Depth24Plus:
142
- case TextureFormat.Depth24PlusStencil8:
143
- return 4; // Typically 3 or 4 bytes — assume 4
144
- case TextureFormat.Depth32Float:
145
- return 4;
146
- case TextureFormat.Depth32FloatStencil8:
147
- return 5; // 4 (depth) + 1 (stencil) — approximate
148
-
149
- default:
150
- throw new Error(`Unknown or unsupported texture format: ${format}`);
151
- }
152
- }
153
-
154
- /**
155
- * @param {TextureFormat} format
156
- */
157
- export function hasDepthComponent(format) {
158
- switch (format) {
159
- case TextureFormat.Depth16Unorm:
160
- case TextureFormat.Depth24Plus:
161
- case TextureFormat.Depth24PlusStencil8:
162
- case TextureFormat.Depth32Float:
163
- case TextureFormat.Depth32FloatStencil8:
164
- return true;
165
- default:
166
- return false;
167
- }
168
- }
169
-
170
- /**
171
- * Checks if a format has a stencil component
172
- * @param {TextureFormat} format
173
- */
174
- export function hasStencilComponent(format) {
175
- switch (format) {
176
- case TextureFormat.Stencil8:
177
- case TextureFormat.Depth24PlusStencil8:
178
- case TextureFormat.Depth32FloatStencil8:
179
- return true;
180
- default:
181
- return false;
182
- }
183
- }
@@ -1 +0,0 @@
1
- export { collections } from "wima-docs-website-template/loaders";
@@ -1,14 +0,0 @@
1
- /**
2
- * @enum {number}
3
- * Comparison functions for depth, stencil, and sampler tests
4
- */
5
- export const CompareFunction = /** @type {const} */({
6
- Never: 0x0200, // gl.NEVER
7
- Less: 0x0201, // gl.LESS
8
- Equal: 0x0202, // gl.EQUAL
9
- Lequal: 0x0203, // gl.LEQUAL
10
- Greater: 0x0204, // gl.GREATER
11
- NotEqual: 0x0205, // gl.NOTEQUAL
12
- Gequal: 0x0206, // gl.GEQUAL
13
- Always: 0x0207 // gl.ALWAYS
14
- })
@@ -1,42 +0,0 @@
1
- export class WebGLExtensions {
2
- /**
3
- * @param {WebGL2RenderingContext} gl
4
- */
5
- constructor(gl) {
6
- this.gl = gl;
7
- this.supported = gl.getSupportedExtensions() || [];
8
- this.cache = new Map();
9
- }
10
-
11
- /**
12
- * Check if an extension is supported.
13
- * @param {string} name
14
- * @returns {boolean}
15
- */
16
- has(name) {
17
- return this.supported.includes(name);
18
- }
19
-
20
- /**
21
- * Get (and cache) an extension object.
22
- * @param {string} name
23
- * @returns {object | undefined}
24
- */
25
- get(name) {
26
- if (this.cache.has(name))
27
- return this.cache.get(name);
28
-
29
- const ext = this.has(name) ? this.gl.getExtension(name) : undefined;
30
- this.cache.set(name, ext);
31
- return ext;
32
- }
33
-
34
- /**
35
- * Initialize all supported extensions at once
36
- */
37
- initAll() {
38
- for (const name of this.supported) {
39
- this.get(name);
40
- }
41
- }
42
- }
package/src/core/index.js DELETED
@@ -1,7 +0,0 @@
1
- export * from "./layouts/index.js"
2
- export * from "./shader.js"
3
- export * from "./limits.js"
4
- export * from "./extensions.js"
5
- export * from "./resources/index.js"
6
- export * from "./webgl/index.js"
7
- export * from "./constants.js"
@@ -1,167 +0,0 @@
1
- import { assertTrue } from "../../utils/index.js"
2
-
3
- export class WebGLBindGroupLayout {
4
- /**
5
- * @readonly
6
- * @type {string | undefined}
7
- */
8
- label
9
-
10
- /**
11
- * @readonly
12
- * @type {readonly WebGLBindGroupLayoutEntry[]}
13
- */
14
- entries
15
-
16
- /**
17
- * @private
18
- * @type {Map<number, WebGLBindGroupLayoutEntry>}
19
- */
20
- entryMap = new Map()
21
-
22
- /**
23
- * @param {WebGLBindGroupLayoutDescriptor} descriptor
24
- */
25
- constructor({ label, entries }) {
26
- this.label = label
27
- this.entries = [...entries]
28
-
29
- for (const entry of entries) {
30
- validateLayoutEntry(entry)
31
- assertTrue(!this.entryMap.has(entry.binding), `Duplicate bind group layout binding ${entry.binding}`)
32
- this.entryMap.set(entry.binding, entry)
33
- }
34
- }
35
-
36
- /**
37
- * @param {number} binding
38
- */
39
- getEntry(binding) {
40
- return this.entryMap.get(binding)
41
- }
42
-
43
- /**
44
- * @param {WebGLBindGroupLayout} other
45
- */
46
- compatibleWith(other) {
47
- if (this === other) {
48
- return true
49
- }
50
-
51
- if (this.entries.length !== other.entries.length) {
52
- return false
53
- }
54
-
55
- for (const entry of this.entries) {
56
- const otherEntry = other.getEntry(entry.binding)
57
-
58
- if (!otherEntry || !layoutEntriesCompatible(entry, otherEntry)) {
59
- return false
60
- }
61
- }
62
-
63
- return true
64
- }
65
- }
66
-
67
- /**
68
- * @typedef WebGLBindGroupLayoutDescriptor
69
- * @property {string} [label]
70
- * @property {WebGLBindGroupLayoutEntry[]} entries
71
- */
72
-
73
- /**
74
- * @typedef WebGLBindGroupLayoutEntry
75
- * @property {number} binding
76
- * @property {string} [name]
77
- * @property {number} visibility
78
- * @property {WebGLBufferBindingLayout} [buffer]
79
- * @property {WebGLSamplerBindingLayout} [sampler]
80
- * @property {WebGLTextureBindingLayout} [texture]
81
- */
82
-
83
- /**
84
- * @typedef WebGLBufferBindingLayout
85
- * @property {"uniform"} [type]
86
- * @property {boolean} [hasDynamicOffset]
87
- * @property {number} [minBindingSize]
88
- */
89
-
90
- /**
91
- * @typedef WebGLSamplerBindingLayout
92
- * @property {"filtering" | "non-filtering" | "comparison"} [type]
93
- */
94
-
95
- /**
96
- * @typedef WebGLTextureBindingLayout
97
- * @property {"float" | "unfilterable-float" | "depth" | "sint" | "uint"} [sampleType]
98
- * @property {"1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d"} [viewDimension]
99
- * @property {boolean} [multisampled]
100
- */
101
-
102
- /**
103
- * @param {WebGLBindGroupLayoutEntry} entry
104
- */
105
- function validateLayoutEntry(entry) {
106
- assertTrue(Number.isInteger(entry.binding) && entry.binding >= 0, `Invalid bind group layout binding ${entry.binding}`)
107
- assertTrue(Number.isInteger(entry.visibility) && entry.visibility >= 0, `Invalid bind group layout visibility for binding ${entry.binding}`)
108
-
109
- if (
110
- (entry.buffer !== undefined ? 1 : 0) +
111
- (entry.sampler !== undefined ? 1 : 0) +
112
- (entry.texture !== undefined ? 1 : 0) !== 1
113
- ) {
114
- throw `Bind group layout binding ${entry.binding} must declare exactly one resource type`
115
- }
116
- }
117
-
118
- /**
119
- * @param {WebGLBindGroupLayoutEntry} a
120
- * @param {WebGLBindGroupLayoutEntry} b
121
- */
122
- function layoutEntriesCompatible(a, b) {
123
- if (a.binding !== b.binding || a.visibility !== b.visibility || a.name !== b.name) {
124
- return false
125
- }
126
-
127
- if (a.buffer !== undefined) {
128
- return b.buffer !== undefined && bufferLayoutsCompatible(a.buffer, b.buffer)
129
- }
130
- if (a.sampler !== undefined) {
131
- return b.sampler !== undefined && samplerLayoutsCompatible(a.sampler, b.sampler)
132
- }
133
-
134
- return b.texture !== undefined && textureLayoutsCompatible(a.texture, b.texture)
135
- }
136
-
137
- /**
138
- * @param {WebGLBufferBindingLayout | undefined} a
139
- * @param {WebGLBufferBindingLayout | undefined} b
140
- */
141
- function bufferLayoutsCompatible(a, b) {
142
- return (
143
- (a?.type ?? "uniform") === (b?.type ?? "uniform") &&
144
- (a?.hasDynamicOffset ?? false) === (b?.hasDynamicOffset ?? false) &&
145
- (a?.minBindingSize ?? 0) === (b?.minBindingSize ?? 0)
146
- )
147
- }
148
-
149
- /**
150
- * @param {WebGLSamplerBindingLayout | undefined} a
151
- * @param {WebGLSamplerBindingLayout | undefined} b
152
- */
153
- function samplerLayoutsCompatible(a, b) {
154
- return (a?.type ?? "filtering") === (b?.type ?? "filtering")
155
- }
156
-
157
- /**
158
- * @param {WebGLTextureBindingLayout | undefined} a
159
- * @param {WebGLTextureBindingLayout | undefined} b
160
- */
161
- function textureLayoutsCompatible(a, b) {
162
- return (
163
- (a?.sampleType ?? "float") === (b?.sampleType ?? "float") &&
164
- (a?.viewDimension ?? "2d") === (b?.viewDimension ?? "2d") &&
165
- (a?.multisampled ?? false) === (b?.multisampled ?? false)
166
- )
167
- }
@@ -1,6 +0,0 @@
1
- export * from './uniformbuffer.js'
2
- export * from './uniform.js'
3
- export * from './vertexbuffer.js'
4
- export * from './meshvertex.js'
5
- export * from './bindgroup.js'
6
- export * from './pipeline.js'
@@ -1,60 +0,0 @@
1
- import { Mesh, Attribute } from "../../mesh/index.js"
2
- import { VertexBufferLayout } from "./vertexbuffer.js"
3
-
4
- export class MeshVertexLayout {
5
- /**
6
- * @type {readonly VertexBufferLayout[]}
7
- */
8
- layouts = []
9
-
10
- /**
11
- * @param {VertexBufferLayout[]} layouts
12
- */
13
- constructor(layouts) {
14
- this.layouts = layouts
15
- }
16
-
17
- /**
18
- * @param {Mesh} mesh
19
- */
20
- compatibleWithMesh(mesh) {
21
- for (const attributeName of mesh.attributes.keys()) {
22
- let found = false
23
- for (const layout of this.layouts) {
24
- found = layout.hasOnly([attributeName])
25
- if (found) {
26
- break
27
- }
28
- }
29
-
30
- if (!found) {
31
- return false
32
- }
33
- }
34
- return true
35
- }
36
-
37
- /**
38
- * @param {Attribute} attribute
39
- */
40
- hasAttribute(attribute){
41
- return this.layouts.some((layout)=>layout.has(attribute))
42
- }
43
- /**
44
- * @param {Mesh} mesh
45
- * @param {ReadonlyMap<string, Attribute>} attributes
46
- * @returns {MeshVertexLayout}
47
- */
48
- static fromMesh(mesh, attributes) {
49
- const result = []
50
- for (const name of mesh.attributes.keys()) {
51
- const attribute = attributes.get(name)
52
- if (!attribute) {
53
- throw `The attribute "${name}" is not available in the attribute map`
54
- }
55
- result.push(new VertexBufferLayout([attribute]))
56
- }
57
-
58
- return new MeshVertexLayout(result)
59
- }
60
- }