chorama 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/.configs/tsconfig.lib.json +43 -0
  2. package/.configs/tsconfig.website.json +34 -0
  3. package/.github/workflows/static.yml +88 -0
  4. package/.vscode/launch.json +29 -0
  5. package/.vscode/tasks.json +19 -0
  6. package/README.md +127 -0
  7. package/assets/images/disappointed.jpg +0 -0
  8. package/assets/images/skybox/grimmnight_back.png +0 -0
  9. package/assets/images/skybox/grimmnight_bottom.png +0 -0
  10. package/assets/images/skybox/grimmnight_front.png +0 -0
  11. package/assets/images/skybox/grimmnight_left.png +0 -0
  12. package/assets/images/skybox/grimmnight_right.png +0 -0
  13. package/assets/images/skybox/grimmnight_top.png +0 -0
  14. package/assets/images/skybox/miramar_back.png +0 -0
  15. package/assets/images/skybox/miramar_bottom.png +0 -0
  16. package/assets/images/skybox/miramar_front.png +0 -0
  17. package/assets/images/skybox/miramar_left.png +0 -0
  18. package/assets/images/skybox/miramar_right.png +0 -0
  19. package/assets/images/skybox/miramar_top.png +0 -0
  20. package/assets/images/uv.jpg +0 -0
  21. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.png +0 -0
  22. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.png +0 -0
  23. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.png +0 -0
  24. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.png +0 -0
  25. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.png +0 -0
  26. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.png +0 -0
  27. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_BaseColor.png +0 -0
  28. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_Normal.png +0 -0
  29. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png +0 -0
  30. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.png +0 -0
  31. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_Normal.png +0 -0
  32. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.png +0 -0
  33. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.png +0 -0
  34. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_Normal.png +0 -0
  35. package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.png +0 -0
  36. package/assets/models/gltf/flight_helmet/index.bin +0 -0
  37. package/assets/models/gltf/flight_helmet/index.gltf +705 -0
  38. package/assets/models/gltf/object.gltf +23 -0
  39. package/assets/models/gltf/pirate_girl/index.bin +0 -0
  40. package/assets/models/gltf/pirate_girl/index.gltf +2082 -0
  41. package/assets/models/obj/pirate_girl/pirate_girl.obj +18459 -0
  42. package/assets/models/obj/pirate_girl/pirate_girl.png +0 -0
  43. package/astro.config.mjs +45 -0
  44. package/content/guide/api-map.md +89 -0
  45. package/content/guide/camera-and-controls.md +98 -0
  46. package/content/guide/first-scene.md +176 -0
  47. package/content/guide/index.md +72 -0
  48. package/content/guide/installation.md +179 -0
  49. package/content/guide/materials-and-lighting.md +138 -0
  50. package/content/guide/plugins-and-render-pipeline.md +124 -0
  51. package/content/guide/render-targets-and-views.md +147 -0
  52. package/content/guide/scene-graph-and-transforms.md +113 -0
  53. package/content/guide/textures-and-assets.md +120 -0
  54. package/content/guide/troubleshooting.md +49 -0
  55. package/env.d.ts +19 -0
  56. package/examples/addons/rendergraph_gui.js +580 -0
  57. package/examples/camera/orthographic.js +120 -0
  58. package/examples/camera/perspective.js +138 -0
  59. package/examples/lights/directional.js +397 -0
  60. package/examples/lights/multiple_spot_lights.js +304 -0
  61. package/examples/lights/point.js +337 -0
  62. package/examples/lights/spot.js +366 -0
  63. package/examples/loader/gltf_material.js +111 -0
  64. package/examples/loader/gltfloader.js +78 -0
  65. package/examples/loader/objloader.js +95 -0
  66. package/examples/material/cullface.js +111 -0
  67. package/examples/material/materials.js +126 -0
  68. package/examples/material/standard/basic.js +164 -0
  69. package/examples/mesh/circle.js +117 -0
  70. package/examples/mesh/cuboid.js +151 -0
  71. package/examples/mesh/cylinder.js +139 -0
  72. package/examples/mesh/geometries.js +108 -0
  73. package/examples/mesh/meshTopology.js +103 -0
  74. package/examples/mesh/plane.js +117 -0
  75. package/examples/mesh/skinning.js +136 -0
  76. package/examples/mesh/uvsphere.js +113 -0
  77. package/examples/other/rotatingCube.js +93 -0
  78. package/examples/other/rotatingSphere.js +96 -0
  79. package/examples/rendertarget/basic_canvas.js +130 -0
  80. package/examples/rendertarget/depth_texture.js +130 -0
  81. package/examples/rendertarget/image_target.js +140 -0
  82. package/examples/rendertarget/multiple_views.js +158 -0
  83. package/examples/rendertarget/render_masks.js +173 -0
  84. package/examples/rendertarget/split_screen.js +123 -0
  85. package/examples/rendertarget/split_view.js +137 -0
  86. package/examples/skybox/skybox.js +111 -0
  87. package/examples/texture/arrays.js +156 -0
  88. package/examples/texture/textureWrap.js +118 -0
  89. package/examples/transform/propagation.js +92 -0
  90. package/package.json +55 -0
  91. package/rollup.config.js +66 -0
  92. package/scripts/stage-chorama.mjs +29 -0
  93. package/src/caches/cache.js +420 -0
  94. package/src/caches/index.js +2 -0
  95. package/src/caches/uniformbuffers.js +104 -0
  96. package/src/cameracontrols/index.js +258 -0
  97. package/src/constants/index.js +3 -0
  98. package/src/constants/mesh.js +197 -0
  99. package/src/constants/others.js +218 -0
  100. package/src/constants/texture.js +183 -0
  101. package/src/core/constants.js +14 -0
  102. package/src/core/extensions.js +42 -0
  103. package/src/core/index.js +7 -0
  104. package/src/core/layouts/index.js +4 -0
  105. package/src/core/layouts/meshvertex.js +60 -0
  106. package/src/core/layouts/uniform.js +21 -0
  107. package/src/core/layouts/uniformbuffer.js +15 -0
  108. package/src/core/layouts/vertexbuffer.js +43 -0
  109. package/src/core/limits.js +247 -0
  110. package/src/core/resources/blendparams.js +89 -0
  111. package/src/core/resources/framebuffer.js +127 -0
  112. package/src/core/resources/gpubuffer.js +32 -0
  113. package/src/core/resources/gpumesh.js +43 -0
  114. package/src/core/resources/gputexture.js +73 -0
  115. package/src/core/resources/index.js +5 -0
  116. package/src/core/shader.js +62 -0
  117. package/src/core/webgl/bindgroup.js +89 -0
  118. package/src/core/webgl/descriptors.js +104 -0
  119. package/src/core/webgl/index.js +5 -0
  120. package/src/core/webgl/renderpassencoder.js +96 -0
  121. package/src/core/webgl/renderpipeline.js +54 -0
  122. package/src/core/webgl/utils.js +371 -0
  123. package/src/core/webgl/webglrenderdevice.js +235 -0
  124. package/src/function.js +358 -0
  125. package/src/index.js +15 -0
  126. package/src/loader/gltf.js +2172 -0
  127. package/src/loader/index.js +3 -0
  128. package/src/loader/loader.js +174 -0
  129. package/src/loader/obj.js +188 -0
  130. package/src/loader/texture.js +85 -0
  131. package/src/loader/utils.js +16 -0
  132. package/src/material/basic.js +75 -0
  133. package/src/material/depth.js +73 -0
  134. package/src/material/index.js +8 -0
  135. package/src/material/lambert.js +73 -0
  136. package/src/material/material.js +106 -0
  137. package/src/material/normal.js +30 -0
  138. package/src/material/phong.js +86 -0
  139. package/src/material/raw.js +52 -0
  140. package/src/material/standard.js +221 -0
  141. package/src/math/index.js +3 -0
  142. package/src/math/transform.js +38 -0
  143. package/src/mesh/attribute/attribute.js +79 -0
  144. package/src/mesh/attribute/index.js +1 -0
  145. package/src/mesh/attributedata/index.js +1 -0
  146. package/src/mesh/attributedata/separate.js +180 -0
  147. package/src/mesh/builders/base.js +41 -0
  148. package/src/mesh/builders/circle.js +63 -0
  149. package/src/mesh/builders/cuboid.js +135 -0
  150. package/src/mesh/builders/cylinder.js +131 -0
  151. package/src/mesh/builders/index.js +7 -0
  152. package/src/mesh/builders/plane.js +73 -0
  153. package/src/mesh/builders/utils.js +20 -0
  154. package/src/mesh/builders/uvsphere.js +80 -0
  155. package/src/mesh/builders/wireframe.js +62 -0
  156. package/src/mesh/index.js +4 -0
  157. package/src/mesh/mesh.js +149 -0
  158. package/src/objects/bone.js +17 -0
  159. package/src/objects/camera/camera.js +56 -0
  160. package/src/objects/camera/index.js +2 -0
  161. package/src/objects/camera/projection.js +203 -0
  162. package/src/objects/debug/index.js +1 -0
  163. package/src/objects/debug/skeleton.js +28 -0
  164. package/src/objects/index.js +7 -0
  165. package/src/objects/light/ambient.js +20 -0
  166. package/src/objects/light/directional.js +29 -0
  167. package/src/objects/light/index.js +5 -0
  168. package/src/objects/light/point.js +32 -0
  169. package/src/objects/light/shadow/index.js +1 -0
  170. package/src/objects/light/shadow/shadow.js +67 -0
  171. package/src/objects/light/spot.js +56 -0
  172. package/src/objects/mesh.js +141 -0
  173. package/src/objects/object3d.js +167 -0
  174. package/src/objects/skybox.js +38 -0
  175. package/src/plugins/camera/camera.js +19 -0
  176. package/src/plugins/camera/index.js +2 -0
  177. package/src/plugins/camera/nodes/cameraview.js +46 -0
  178. package/src/plugins/camera/nodes/index.js +2 -0
  179. package/src/plugins/camera/nodes/opaquepass.js +79 -0
  180. package/src/plugins/index.js +6 -0
  181. package/src/plugins/light/index.js +2 -0
  182. package/src/plugins/light/light.js +23 -0
  183. package/src/plugins/light/nodes/index.js +1 -0
  184. package/src/plugins/light/nodes/light.js +127 -0
  185. package/src/plugins/meshmaterial/index.js +3 -0
  186. package/src/plugins/meshmaterial/meshmaterial.js +381 -0
  187. package/src/plugins/meshmaterial/nodes/index.js +1 -0
  188. package/src/plugins/meshmaterial/nodes/meshmaterial.js +50 -0
  189. package/src/plugins/meshmaterial/resources/index.js +1 -0
  190. package/src/plugins/meshmaterial/resources/meshmaterialpipelines.js +50 -0
  191. package/src/plugins/shadow/index.js +3 -0
  192. package/src/plugins/shadow/nodes/index.js +3 -0
  193. package/src/plugins/shadow/nodes/shadow.js +272 -0
  194. package/src/plugins/shadow/nodes/shadowOccluder.js +112 -0
  195. package/src/plugins/shadow/nodes/shadowOpaquePass.js +73 -0
  196. package/src/plugins/shadow/resources/ShadowMap.js +99 -0
  197. package/src/plugins/shadow/resources/index.js +2 -0
  198. package/src/plugins/shadow/resources/shadowpipelines.js +25 -0
  199. package/src/plugins/shadow/shadow.js +31 -0
  200. package/src/plugins/skeletonhelper/index.js +1 -0
  201. package/src/plugins/skeletonhelper/skeletonhelper.js +160 -0
  202. package/src/plugins/skybox/index.js +3 -0
  203. package/src/plugins/skybox/nodes/index.js +1 -0
  204. package/src/plugins/skybox/nodes/skybox.js +143 -0
  205. package/src/plugins/skybox/resources/index.js +2 -0
  206. package/src/plugins/skybox/resources/skyboxmesh.js +14 -0
  207. package/src/plugins/skybox/resources/skyboxpipeline.js +6 -0
  208. package/src/plugins/skybox/skybox.js +137 -0
  209. package/src/renderer/core/index.js +179 -0
  210. package/src/renderer/graph/index.js +3 -0
  211. package/src/renderer/graph/nodes.js +34 -0
  212. package/src/renderer/graph/rendergraph.js +182 -0
  213. package/src/renderer/index.js +5 -0
  214. package/src/renderer/plugin.js +36 -0
  215. package/src/renderer/renderer.js +179 -0
  216. package/src/renderer/views.js +28 -0
  217. package/src/rendertarget/canvastarget.js +30 -0
  218. package/src/rendertarget/image.js +132 -0
  219. package/src/rendertarget/index.js +3 -0
  220. package/src/rendertarget/rendertarget.js +89 -0
  221. package/src/shader/basicFragment.glsl +30 -0
  222. package/src/shader/basicVertex.glsl +87 -0
  223. package/src/shader/common/color.glsl +7 -0
  224. package/src/shader/common/common.glsl +25 -0
  225. package/src/shader/common/index.js +4 -0
  226. package/src/shader/common/light.glsl +437 -0
  227. package/src/shader/common/math.glsl +12 -0
  228. package/src/shader/debug/index.js +2 -0
  229. package/src/shader/debug/skeletonFragment.glsl +8 -0
  230. package/src/shader/debug/skeletonVertex.glsl +27 -0
  231. package/src/shader/depthFragment.glsl +37 -0
  232. package/src/shader/index.js +11 -0
  233. package/src/shader/lambertFragment.glsl +126 -0
  234. package/src/shader/normalFragment.glsl +25 -0
  235. package/src/shader/phongFragment.glsl +140 -0
  236. package/src/shader/skyboxFragment.glsl +16 -0
  237. package/src/shader/skyboxVertex.glsl +20 -0
  238. package/src/shader/standardFragment.glsl +274 -0
  239. package/src/texture/index.js +2 -0
  240. package/src/texture/sampler.js +111 -0
  241. package/src/texture/texture.js +234 -0
  242. package/src/utils/index.js +115 -0
  243. package/tsconfig.json +11 -0
  244. package/website/config/index.ts +1 -0
  245. package/website/config/navigation.ts +53 -0
  246. package/website/content.config.ts +92 -0
  247. package/website/layouts/DocLayout.astro +501 -0
  248. package/website/layouts/Example.astro +91 -0
  249. package/website/pages/examples/[...slug].astro +77 -0
  250. package/website/pages/examples/index.astro +98 -0
  251. package/website/pages/examples/samples/[...slug].astro +17 -0
  252. package/website/pages/guide/[slug].astro +30 -0
  253. package/website/pages/guide/index.astro +21 -0
  254. package/website/pages/index.astro +9 -0
  255. package/website/plugins/remark-link-base.js +23 -0
  256. package/website/utils/url.ts +30 -0
@@ -0,0 +1,43 @@
1
+ {
2
+ "include": [
3
+ "../env.d.ts",
4
+ "../src",
5
+ "../examples",
6
+ "../libs/color.js"
7
+ ],
8
+ "compilerOptions": {
9
+ "strict": true,
10
+ "strictNullChecks": true,
11
+ "strictFunctionTypes": true,
12
+ "strictBindCallApply": true,
13
+ "strictBuiltinIteratorReturn": true,
14
+ "noImplicitReturns": true,
15
+ "noPropertyAccessFromIndexSignature": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noImplicitOverride": true,
21
+ "noImplicitAny": true,
22
+ "allowUnreachableCode": false,
23
+ "allowUnusedLabels": false,
24
+ "module": "es2022",
25
+ "moduleResolution": "bundler",
26
+ "allowSyntheticDefaultImports": true,
27
+ "target": "es2022",
28
+ "preserveSymlinks": true,
29
+ "baseUrl": "..",
30
+ "checkJs": true,
31
+ "skipLibCheck": true,
32
+ "paths": {
33
+ "chorama": [
34
+ "./src/index.js"
35
+ ]
36
+ },
37
+ "composite": true,
38
+ "noEmit": true,
39
+ "declaration": true,
40
+ "emitDeclarationOnly": true,
41
+ "rootDir": "..",
42
+ }
43
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "extends": "astro/tsconfigs/strict",
3
+ "include": [
4
+ "../env.d.ts",
5
+ "../website/**/*",
6
+ "../astro.config.mjs"
7
+ ],
8
+ "compilerOptions": {
9
+ "baseUrl": "..",
10
+ "paths": {
11
+ "@configs": [
12
+ "./website/config/index.ts"
13
+ ],
14
+ "@configs/*": [
15
+ "./website/config/*"
16
+ ],
17
+ "@layouts/*": [
18
+ "./website/layouts/*"
19
+ ],
20
+ "@components/*": [
21
+ "./website/components/*"
22
+ ]
23
+ },
24
+ "types": [
25
+ "astro/client",
26
+ "node"
27
+ ],
28
+ "composite": true,
29
+ "noEmit": true,
30
+ "declaration": true,
31
+ "emitDeclarationOnly": true,
32
+ "rootDir": ".."
33
+ }
34
+ }
@@ -0,0 +1,88 @@
1
+ name: Deploy site to Pages
2
+
3
+ on:
4
+ # Runs on pushes targeting the default branch
5
+ push:
6
+ branches: ["main"]
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19
+ concurrency:
20
+ group: "pages"
21
+ cancel-in-progress: false
22
+
23
+ env:
24
+ BUILD_PATH: "."
25
+
26
+ jobs:
27
+ build:
28
+ name: Build
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - name: Checkout
32
+ uses: actions/checkout@v4
33
+ - name: Detect package manager
34
+ id: detect-package-manager
35
+ run: |
36
+ if [ -f "${{ github.workspace }}/yarn.lock" ]; then
37
+ echo "manager=yarn" >> $GITHUB_OUTPUT
38
+ echo "command=install" >> $GITHUB_OUTPUT
39
+ echo "runner=yarn" >> $GITHUB_OUTPUT
40
+ echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
41
+ exit 0
42
+ elif [ -f "${{ github.workspace }}/package.json" ]; then
43
+ echo "manager=npm" >> $GITHUB_OUTPUT
44
+ echo "command=ci" >> $GITHUB_OUTPUT
45
+ echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46
+ echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
47
+ exit 0
48
+ else
49
+ echo "Unable to determine package manager"
50
+ exit 1
51
+ fi
52
+ - name: Setup Node
53
+ uses: actions/setup-node@v4
54
+ with:
55
+ node-version: "20"
56
+ cache: ${{ steps.detect-package-manager.outputs.manager }}
57
+ cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
58
+ - name: Setup Pages
59
+ id: pages
60
+ uses: actions/configure-pages@v5
61
+ - name: Install dependencies
62
+ run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
63
+ working-directory: ${{ env.BUILD_PATH }}
64
+ - name: Build site and stage library
65
+ run: |
66
+ ${{ steps.detect-package-manager.outputs.runner }} rollup --config rollup.config.js
67
+ BASE="${{ steps.pages.outputs.base_path }}" \
68
+ ${{ steps.detect-package-manager.outputs.runner }} astro build \
69
+ --site "${{ steps.pages.outputs.origin }}" \
70
+ --base "${{ steps.pages.outputs.base_path }}"
71
+ node scripts/stage-chorama.mjs
72
+ working-directory: ${{ env.BUILD_PATH }}
73
+ - name: Upload artifact
74
+ uses: actions/upload-pages-artifact@v3
75
+ with:
76
+ path: ${{ env.BUILD_PATH }}/dist/website
77
+
78
+ deploy:
79
+ environment:
80
+ name: github-pages
81
+ url: ${{ steps.deployment.outputs.page_url }}
82
+ needs: build
83
+ runs-on: ubuntu-latest
84
+ name: Deploy
85
+ steps:
86
+ - name: Deploy to GitHub Pages
87
+ id: deployment
88
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,29 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "firefox",
9
+ "request": "launch",
10
+ "reAttach": true,
11
+ "name": "Launch iFirefox",
12
+ "url": "http://127.0.0.1:4321/examples/index.html",
13
+ "webRoot": "${workspaceFolder}",
14
+ "pathMappings": [
15
+ {
16
+ "url": "http://127.0.0.1:4321",
17
+ "path": "${workspaceFolder}"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "type": "chrome",
23
+ "request": "launch",
24
+ "name": "Launch Chrome=",
25
+ "url": "http://127.0.0.1:4321/examples/index.html",
26
+ "webRoot": "${workspaceFolder}"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "type": "typescript",
6
+ "tsconfig": "tsconfig.json",
7
+ "label": "tsc-scan",
8
+ "option": "watch",
9
+ "problemMatcher":"$tsc-watch",
10
+ "group": "build",
11
+ "runOptions": {
12
+ "runOn": "folderOpen"
13
+ },
14
+ "presentation": {
15
+ "reveal": "never",
16
+ }
17
+ }
18
+ ]
19
+ }
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # Chorama
2
+
3
+ A modular WebGL2 rendering library built in JavaScript.
4
+
5
+ ## Features
6
+
7
+ - Rendering architecture
8
+ - Modular, plugin-driven rendering pipeline
9
+ - Multi-pass/view rendering support
10
+ - Render-time resource and state caching to reduce redundant GPU work
11
+ - Extensible shader include/define system
12
+
13
+ - Scene and transforms
14
+ - Hierarchical scene graph for parent-child object relationships
15
+ - Local/world transform propagation
16
+ - Traversal utilities for update and render preparation flows
17
+ - Support for static and skinned scene objects
18
+
19
+ - Geometry and mesh creation
20
+ - Ready-to-use procedural geometry builders:
21
+ - Plane
22
+ - Circle
23
+ - Cylinder
24
+ - Cuboid
25
+ - UV sphere
26
+ - Wireframe conversion
27
+ - Attribute-based mesh data model (positions, normals, UVs, tangents, skinning data)
28
+ - Flexible vertex/index data handling for custom mesh pipelines
29
+
30
+ - Materials and shading
31
+ - Multiple built-in shading styles:
32
+ - Unlit/basic shading
33
+ - Lambert diffuse shading
34
+ - Phong shading
35
+ - Standard physically based shading
36
+ - Normal/depth debug shading
37
+ - Raw/custom shader paths
38
+ - Material properties for color, texture mapping, emissive, metallic and roughness workflows
39
+ - Shared shader code modules for common math, color and lighting logic
40
+
41
+ - Lighting and shadows
42
+ - Supported light types:
43
+ - Ambient
44
+ - Directional
45
+ - Point
46
+ - Spot
47
+ - Shadow rendering support integrated into the render pipeline
48
+ - Lighting/material integration for lit and physically based workflows
49
+
50
+ - Textures and sampling
51
+ - Multiple texture formats and usage patterns
52
+ - Sampler controls for filtering and wrapping behavior
53
+
54
+ - Render targets and offscreen rendering
55
+ - Direct rendering to canvas
56
+ - Offscreen/image render target support
57
+ - Framebuffer-based workflows for multi-step rendering
58
+ - Foundations for post-process and texture-to-texture pipelines
59
+
60
+ - Asset loading
61
+ - Built-in loaders for:
62
+ - Image textures
63
+ - OBJ models
64
+ - glTF scenes/assets
65
+ - Async loading with default placeholders while assets stream in
66
+ - Asset reuse and clone/copy loading strategies
67
+ - glTF material/texture/skeleton parsing paths
68
+
69
+ - Camera and interaction
70
+ - Perspective and orthographic camera projections
71
+ - Orbit-style interaction controls for inspection/navigation
72
+ - Camera-aware rendering integration through the plugin system
73
+
74
+ - Math and low-level utilities
75
+ - Core math types and operations for:
76
+ - Vectors
77
+ - Quaternions
78
+ - Matrices/affine transforms
79
+ - Buffer/type conversion helpers for GPU upload workflows
80
+ - WebGL mapping helpers for vertex formats, attachments and texture formats
81
+
82
+ ## Who This Is For
83
+
84
+ Use this library if you want lower-level control than full game engines, but still want reusable rendering building blocks for WebGL2 projects.
85
+
86
+ ## Getting Started
87
+
88
+ ### Requirements
89
+
90
+ - Node.js 18+
91
+ - npm
92
+ - A browser with WebGL2 support
93
+
94
+ ### Install dependencies
95
+
96
+ ```bash
97
+ npm install
98
+ ```
99
+
100
+ ### Build library bundles
101
+
102
+ ```bash
103
+ npm run build
104
+ ```
105
+
106
+ Build output:
107
+
108
+ - `dist/index.umd.js`
109
+ - `dist/index.module.js`
110
+
111
+ ### Run demos
112
+
113
+ ```bash
114
+ npx vite .
115
+ ```
116
+
117
+ Then open:
118
+
119
+ - `http://localhost:5173/examples/index.html`
120
+
121
+ ## Core Usage Flow
122
+
123
+ 1. Create a `WebGLRenderDevice` from a canvas.
124
+ 2. Create a render target (`CanvasTarget` or `ImageTarget`).
125
+ 3. Create a `WebGLRenderer` with the plugins needed by your scene.
126
+ 4. Build scene objects (meshes, lights, camera).
127
+ 5. Call `renderer.render(objects, renderDevice)` each frame.
Binary file
Binary file