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.
- package/.configs/tsconfig.lib.json +43 -0
- package/.configs/tsconfig.website.json +34 -0
- package/.github/workflows/static.yml +88 -0
- package/.vscode/launch.json +29 -0
- package/.vscode/tasks.json +19 -0
- package/README.md +127 -0
- package/assets/images/disappointed.jpg +0 -0
- package/assets/images/skybox/grimmnight_back.png +0 -0
- package/assets/images/skybox/grimmnight_bottom.png +0 -0
- package/assets/images/skybox/grimmnight_front.png +0 -0
- package/assets/images/skybox/grimmnight_left.png +0 -0
- package/assets/images/skybox/grimmnight_right.png +0 -0
- package/assets/images/skybox/grimmnight_top.png +0 -0
- package/assets/images/skybox/miramar_back.png +0 -0
- package/assets/images/skybox/miramar_bottom.png +0 -0
- package/assets/images/skybox/miramar_front.png +0 -0
- package/assets/images/skybox/miramar_left.png +0 -0
- package/assets/images/skybox/miramar_right.png +0 -0
- package/assets/images/skybox/miramar_top.png +0 -0
- package/assets/images/uv.jpg +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_BaseColor.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_Normal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_Normal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_Normal.png +0 -0
- package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.png +0 -0
- package/assets/models/gltf/flight_helmet/index.bin +0 -0
- package/assets/models/gltf/flight_helmet/index.gltf +705 -0
- package/assets/models/gltf/object.gltf +23 -0
- package/assets/models/gltf/pirate_girl/index.bin +0 -0
- package/assets/models/gltf/pirate_girl/index.gltf +2082 -0
- package/assets/models/obj/pirate_girl/pirate_girl.obj +18459 -0
- package/assets/models/obj/pirate_girl/pirate_girl.png +0 -0
- package/astro.config.mjs +45 -0
- package/content/guide/api-map.md +89 -0
- package/content/guide/camera-and-controls.md +98 -0
- package/content/guide/first-scene.md +176 -0
- package/content/guide/index.md +72 -0
- package/content/guide/installation.md +179 -0
- package/content/guide/materials-and-lighting.md +138 -0
- package/content/guide/plugins-and-render-pipeline.md +124 -0
- package/content/guide/render-targets-and-views.md +147 -0
- package/content/guide/scene-graph-and-transforms.md +113 -0
- package/content/guide/textures-and-assets.md +120 -0
- package/content/guide/troubleshooting.md +49 -0
- package/env.d.ts +19 -0
- package/examples/addons/rendergraph_gui.js +580 -0
- package/examples/camera/orthographic.js +120 -0
- package/examples/camera/perspective.js +138 -0
- package/examples/lights/directional.js +397 -0
- package/examples/lights/multiple_spot_lights.js +304 -0
- package/examples/lights/point.js +337 -0
- package/examples/lights/spot.js +366 -0
- package/examples/loader/gltf_material.js +111 -0
- package/examples/loader/gltfloader.js +78 -0
- package/examples/loader/objloader.js +95 -0
- package/examples/material/cullface.js +111 -0
- package/examples/material/materials.js +126 -0
- package/examples/material/standard/basic.js +164 -0
- package/examples/mesh/circle.js +117 -0
- package/examples/mesh/cuboid.js +151 -0
- package/examples/mesh/cylinder.js +139 -0
- package/examples/mesh/geometries.js +108 -0
- package/examples/mesh/meshTopology.js +103 -0
- package/examples/mesh/plane.js +117 -0
- package/examples/mesh/skinning.js +136 -0
- package/examples/mesh/uvsphere.js +113 -0
- package/examples/other/rotatingCube.js +93 -0
- package/examples/other/rotatingSphere.js +96 -0
- package/examples/rendertarget/basic_canvas.js +130 -0
- package/examples/rendertarget/depth_texture.js +130 -0
- package/examples/rendertarget/image_target.js +140 -0
- package/examples/rendertarget/multiple_views.js +158 -0
- package/examples/rendertarget/render_masks.js +173 -0
- package/examples/rendertarget/split_screen.js +123 -0
- package/examples/rendertarget/split_view.js +137 -0
- package/examples/skybox/skybox.js +111 -0
- package/examples/texture/arrays.js +156 -0
- package/examples/texture/textureWrap.js +118 -0
- package/examples/transform/propagation.js +92 -0
- package/package.json +55 -0
- package/rollup.config.js +66 -0
- package/scripts/stage-chorama.mjs +29 -0
- package/src/caches/cache.js +420 -0
- package/src/caches/index.js +2 -0
- package/src/caches/uniformbuffers.js +104 -0
- package/src/cameracontrols/index.js +258 -0
- package/src/constants/index.js +3 -0
- package/src/constants/mesh.js +197 -0
- package/src/constants/others.js +218 -0
- package/src/constants/texture.js +183 -0
- package/src/core/constants.js +14 -0
- package/src/core/extensions.js +42 -0
- package/src/core/index.js +7 -0
- package/src/core/layouts/index.js +4 -0
- package/src/core/layouts/meshvertex.js +60 -0
- package/src/core/layouts/uniform.js +21 -0
- package/src/core/layouts/uniformbuffer.js +15 -0
- package/src/core/layouts/vertexbuffer.js +43 -0
- package/src/core/limits.js +247 -0
- package/src/core/resources/blendparams.js +89 -0
- package/src/core/resources/framebuffer.js +127 -0
- package/src/core/resources/gpubuffer.js +32 -0
- package/src/core/resources/gpumesh.js +43 -0
- package/src/core/resources/gputexture.js +73 -0
- package/src/core/resources/index.js +5 -0
- package/src/core/shader.js +62 -0
- package/src/core/webgl/bindgroup.js +89 -0
- package/src/core/webgl/descriptors.js +104 -0
- package/src/core/webgl/index.js +5 -0
- package/src/core/webgl/renderpassencoder.js +96 -0
- package/src/core/webgl/renderpipeline.js +54 -0
- package/src/core/webgl/utils.js +371 -0
- package/src/core/webgl/webglrenderdevice.js +235 -0
- package/src/function.js +358 -0
- package/src/index.js +15 -0
- package/src/loader/gltf.js +2172 -0
- package/src/loader/index.js +3 -0
- package/src/loader/loader.js +174 -0
- package/src/loader/obj.js +188 -0
- package/src/loader/texture.js +85 -0
- package/src/loader/utils.js +16 -0
- package/src/material/basic.js +75 -0
- package/src/material/depth.js +73 -0
- package/src/material/index.js +8 -0
- package/src/material/lambert.js +73 -0
- package/src/material/material.js +106 -0
- package/src/material/normal.js +30 -0
- package/src/material/phong.js +86 -0
- package/src/material/raw.js +52 -0
- package/src/material/standard.js +221 -0
- package/src/math/index.js +3 -0
- package/src/math/transform.js +38 -0
- package/src/mesh/attribute/attribute.js +79 -0
- package/src/mesh/attribute/index.js +1 -0
- package/src/mesh/attributedata/index.js +1 -0
- package/src/mesh/attributedata/separate.js +180 -0
- package/src/mesh/builders/base.js +41 -0
- package/src/mesh/builders/circle.js +63 -0
- package/src/mesh/builders/cuboid.js +135 -0
- package/src/mesh/builders/cylinder.js +131 -0
- package/src/mesh/builders/index.js +7 -0
- package/src/mesh/builders/plane.js +73 -0
- package/src/mesh/builders/utils.js +20 -0
- package/src/mesh/builders/uvsphere.js +80 -0
- package/src/mesh/builders/wireframe.js +62 -0
- package/src/mesh/index.js +4 -0
- package/src/mesh/mesh.js +149 -0
- package/src/objects/bone.js +17 -0
- package/src/objects/camera/camera.js +56 -0
- package/src/objects/camera/index.js +2 -0
- package/src/objects/camera/projection.js +203 -0
- package/src/objects/debug/index.js +1 -0
- package/src/objects/debug/skeleton.js +28 -0
- package/src/objects/index.js +7 -0
- package/src/objects/light/ambient.js +20 -0
- package/src/objects/light/directional.js +29 -0
- package/src/objects/light/index.js +5 -0
- package/src/objects/light/point.js +32 -0
- package/src/objects/light/shadow/index.js +1 -0
- package/src/objects/light/shadow/shadow.js +67 -0
- package/src/objects/light/spot.js +56 -0
- package/src/objects/mesh.js +141 -0
- package/src/objects/object3d.js +167 -0
- package/src/objects/skybox.js +38 -0
- package/src/plugins/camera/camera.js +19 -0
- package/src/plugins/camera/index.js +2 -0
- package/src/plugins/camera/nodes/cameraview.js +46 -0
- package/src/plugins/camera/nodes/index.js +2 -0
- package/src/plugins/camera/nodes/opaquepass.js +79 -0
- package/src/plugins/index.js +6 -0
- package/src/plugins/light/index.js +2 -0
- package/src/plugins/light/light.js +23 -0
- package/src/plugins/light/nodes/index.js +1 -0
- package/src/plugins/light/nodes/light.js +127 -0
- package/src/plugins/meshmaterial/index.js +3 -0
- package/src/plugins/meshmaterial/meshmaterial.js +381 -0
- package/src/plugins/meshmaterial/nodes/index.js +1 -0
- package/src/plugins/meshmaterial/nodes/meshmaterial.js +50 -0
- package/src/plugins/meshmaterial/resources/index.js +1 -0
- package/src/plugins/meshmaterial/resources/meshmaterialpipelines.js +50 -0
- package/src/plugins/shadow/index.js +3 -0
- package/src/plugins/shadow/nodes/index.js +3 -0
- package/src/plugins/shadow/nodes/shadow.js +272 -0
- package/src/plugins/shadow/nodes/shadowOccluder.js +112 -0
- package/src/plugins/shadow/nodes/shadowOpaquePass.js +73 -0
- package/src/plugins/shadow/resources/ShadowMap.js +99 -0
- package/src/plugins/shadow/resources/index.js +2 -0
- package/src/plugins/shadow/resources/shadowpipelines.js +25 -0
- package/src/plugins/shadow/shadow.js +31 -0
- package/src/plugins/skeletonhelper/index.js +1 -0
- package/src/plugins/skeletonhelper/skeletonhelper.js +160 -0
- package/src/plugins/skybox/index.js +3 -0
- package/src/plugins/skybox/nodes/index.js +1 -0
- package/src/plugins/skybox/nodes/skybox.js +143 -0
- package/src/plugins/skybox/resources/index.js +2 -0
- package/src/plugins/skybox/resources/skyboxmesh.js +14 -0
- package/src/plugins/skybox/resources/skyboxpipeline.js +6 -0
- package/src/plugins/skybox/skybox.js +137 -0
- package/src/renderer/core/index.js +179 -0
- package/src/renderer/graph/index.js +3 -0
- package/src/renderer/graph/nodes.js +34 -0
- package/src/renderer/graph/rendergraph.js +182 -0
- package/src/renderer/index.js +5 -0
- package/src/renderer/plugin.js +36 -0
- package/src/renderer/renderer.js +179 -0
- package/src/renderer/views.js +28 -0
- package/src/rendertarget/canvastarget.js +30 -0
- package/src/rendertarget/image.js +132 -0
- package/src/rendertarget/index.js +3 -0
- package/src/rendertarget/rendertarget.js +89 -0
- package/src/shader/basicFragment.glsl +30 -0
- package/src/shader/basicVertex.glsl +87 -0
- package/src/shader/common/color.glsl +7 -0
- package/src/shader/common/common.glsl +25 -0
- package/src/shader/common/index.js +4 -0
- package/src/shader/common/light.glsl +437 -0
- package/src/shader/common/math.glsl +12 -0
- package/src/shader/debug/index.js +2 -0
- package/src/shader/debug/skeletonFragment.glsl +8 -0
- package/src/shader/debug/skeletonVertex.glsl +27 -0
- package/src/shader/depthFragment.glsl +37 -0
- package/src/shader/index.js +11 -0
- package/src/shader/lambertFragment.glsl +126 -0
- package/src/shader/normalFragment.glsl +25 -0
- package/src/shader/phongFragment.glsl +140 -0
- package/src/shader/skyboxFragment.glsl +16 -0
- package/src/shader/skyboxVertex.glsl +20 -0
- package/src/shader/standardFragment.glsl +274 -0
- package/src/texture/index.js +2 -0
- package/src/texture/sampler.js +111 -0
- package/src/texture/texture.js +234 -0
- package/src/utils/index.js +115 -0
- package/tsconfig.json +11 -0
- package/website/config/index.ts +1 -0
- package/website/config/navigation.ts +53 -0
- package/website/content.config.ts +92 -0
- package/website/layouts/DocLayout.astro +501 -0
- package/website/layouts/Example.astro +91 -0
- package/website/pages/examples/[...slug].astro +77 -0
- package/website/pages/examples/index.astro +98 -0
- package/website/pages/examples/samples/[...slug].astro +17 -0
- package/website/pages/guide/[slug].astro +30 -0
- package/website/pages/guide/index.astro +21 -0
- package/website/pages/index.astro +9 -0
- package/website/plugins/remark-link-base.js +23 -0
- 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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|