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.
- package/README.md +2 -1
- package/dist/index.module.js +32480 -15098
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +32628 -15121
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -2
- package/.configs/tsconfig.lib.json +0 -43
- package/.configs/tsconfig.website.json +0 -34
- package/.github/workflows/publish.yml +0 -24
- package/.github/workflows/static.yml +0 -57
- package/.vscode/launch.json +0 -29
- package/.vscode/tasks.json +0 -19
- 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/glb/AlphaBlendModeTest.glb +0 -0
- package/assets/models/glb/IridescenceLamp.glb +0 -0
- package/assets/models/glb/teapot.glb +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 +0 -705
- package/assets/models/gltf/object.gltf +0 -23
- package/assets/models/gltf/pirate_girl/index.bin +0 -0
- package/assets/models/gltf/pirate_girl/index.gltf +0 -2082
- package/assets/models/obj/pirate_girl/pirate_girl.obj +0 -18459
- package/assets/models/obj/pirate_girl/pirate_girl.png +0 -0
- package/astro.config.mjs +0 -33
- package/content/guide/api-map.md +0 -89
- package/content/guide/camera-and-controls.md +0 -98
- package/content/guide/first-scene.md +0 -176
- package/content/guide/index.md +0 -72
- package/content/guide/installation.md +0 -179
- package/content/guide/materials-and-lighting.md +0 -138
- package/content/guide/plugins-and-render-pipeline.md +0 -124
- package/content/guide/render-targets-and-views.md +0 -146
- package/content/guide/scene-graph-and-transforms.md +0 -113
- package/content/guide/textures-and-assets.md +0 -123
- package/content/guide/troubleshooting.md +0 -49
- package/dist/website/_astro/DocLayout.BsV7p0dY.css +0 -1
- package/dist/website/examples/camera/orthographic/example.html +0 -172
- package/dist/website/examples/camera/orthographic/index.html +0 -124
- package/dist/website/examples/camera/perspective/example.html +0 -190
- package/dist/website/examples/camera/perspective/index.html +0 -142
- package/dist/website/examples/camera/tone_mapping/example.html +0 -238
- package/dist/website/examples/camera/tone_mapping/index.html +0 -190
- package/dist/website/examples/index.html +0 -2
- package/dist/website/examples/lights/directional/example.html +0 -447
- package/dist/website/examples/lights/directional/index.html +0 -399
- package/dist/website/examples/lights/multiple_spot_lights/example.html +0 -356
- package/dist/website/examples/lights/multiple_spot_lights/index.html +0 -308
- package/dist/website/examples/lights/point/example.html +0 -387
- package/dist/website/examples/lights/point/index.html +0 -339
- package/dist/website/examples/lights/spot/example.html +0 -416
- package/dist/website/examples/lights/spot/index.html +0 -368
- package/dist/website/examples/loader/gltf/basic/example.html +0 -129
- package/dist/website/examples/loader/gltf/basic/index.html +0 -81
- package/dist/website/examples/loader/gltf/material/alpha-blend-mode/example.html +0 -131
- package/dist/website/examples/loader/gltf/material/alpha-blend-mode/index.html +0 -83
- package/dist/website/examples/loader/gltf/material/flight_helmet/example.html +0 -162
- package/dist/website/examples/loader/gltf/material/flight_helmet/index.html +0 -114
- package/dist/website/examples/loader/gltf/material/iridescence_lamp/example.html +0 -169
- package/dist/website/examples/loader/gltf/material/iridescence_lamp/index.html +0 -121
- package/dist/website/examples/loader/objloader/example.html +0 -144
- package/dist/website/examples/loader/objloader/index.html +0 -96
- package/dist/website/examples/material/cullface/example.html +0 -163
- package/dist/website/examples/material/cullface/index.html +0 -115
- package/dist/website/examples/material/materials/example.html +0 -175
- package/dist/website/examples/material/materials/index.html +0 -127
- package/dist/website/examples/material/standard/basic/example.html +0 -212
- package/dist/website/examples/material/standard/basic/index.html +0 -164
- package/dist/website/examples/material/standard/reflection_refraction/example.html +0 -241
- package/dist/website/examples/material/standard/reflection_refraction/index.html +0 -193
- package/dist/website/examples/mesh/capsule/example.html +0 -173
- package/dist/website/examples/mesh/capsule/index.html +0 -125
- package/dist/website/examples/mesh/circle/example.html +0 -173
- package/dist/website/examples/mesh/circle/index.html +0 -125
- package/dist/website/examples/mesh/cone/example.html +0 -180
- package/dist/website/examples/mesh/cone/index.html +0 -132
- package/dist/website/examples/mesh/cuboid/example.html +0 -207
- package/dist/website/examples/mesh/cuboid/index.html +0 -159
- package/dist/website/examples/mesh/cylinder/example.html +0 -195
- package/dist/website/examples/mesh/cylinder/index.html +0 -147
- package/dist/website/examples/mesh/dodecahedron/example.html +0 -158
- package/dist/website/examples/mesh/dodecahedron/index.html +0 -110
- package/dist/website/examples/mesh/ellipsoid/example.html +0 -179
- package/dist/website/examples/mesh/ellipsoid/index.html +0 -131
- package/dist/website/examples/mesh/extrude/example.html +0 -169
- package/dist/website/examples/mesh/extrude/index.html +0 -121
- package/dist/website/examples/mesh/frustum/example.html +0 -185
- package/dist/website/examples/mesh/frustum/index.html +0 -137
- package/dist/website/examples/mesh/helix/example.html +0 -184
- package/dist/website/examples/mesh/helix/index.html +0 -136
- package/dist/website/examples/mesh/icosahedron/example.html +0 -158
- package/dist/website/examples/mesh/icosahedron/index.html +0 -110
- package/dist/website/examples/mesh/icosphere/example.html +0 -163
- package/dist/website/examples/mesh/icosphere/index.html +0 -115
- package/dist/website/examples/mesh/lathe/example.html +0 -175
- package/dist/website/examples/mesh/lathe/index.html +0 -127
- package/dist/website/examples/mesh/meshTopology/example.html +0 -210
- package/dist/website/examples/mesh/meshTopology/index.html +0 -162
- package/dist/website/examples/mesh/octahedron/example.html +0 -158
- package/dist/website/examples/mesh/octahedron/index.html +0 -110
- package/dist/website/examples/mesh/plane/example.html +0 -173
- package/dist/website/examples/mesh/plane/index.html +0 -125
- package/dist/website/examples/mesh/prism/example.html +0 -173
- package/dist/website/examples/mesh/prism/index.html +0 -125
- package/dist/website/examples/mesh/pyramid/example.html +0 -172
- package/dist/website/examples/mesh/pyramid/index.html +0 -124
- package/dist/website/examples/mesh/ring/example.html +0 -173
- package/dist/website/examples/mesh/ring/index.html +0 -125
- package/dist/website/examples/mesh/skinning/example.html +0 -187
- package/dist/website/examples/mesh/skinning/index.html +0 -139
- package/dist/website/examples/mesh/terrain/example.html +0 -214
- package/dist/website/examples/mesh/terrain/index.html +0 -166
- package/dist/website/examples/mesh/tetrahedron/example.html +0 -158
- package/dist/website/examples/mesh/tetrahedron/index.html +0 -110
- package/dist/website/examples/mesh/torus/example.html +0 -173
- package/dist/website/examples/mesh/torus/index.html +0 -125
- package/dist/website/examples/mesh/torus-knot/example.html +0 -188
- package/dist/website/examples/mesh/torus-knot/index.html +0 -140
- package/dist/website/examples/mesh/tube/example.html +0 -180
- package/dist/website/examples/mesh/tube/index.html +0 -132
- package/dist/website/examples/mesh/uvsphere/example.html +0 -169
- package/dist/website/examples/mesh/uvsphere/index.html +0 -121
- package/dist/website/examples/mesh/wedge/example.html +0 -168
- package/dist/website/examples/mesh/wedge/index.html +0 -120
- package/dist/website/examples/other/rotatingCube/example.html +0 -142
- package/dist/website/examples/other/rotatingCube/index.html +0 -94
- package/dist/website/examples/other/rotatingSphere/example.html +0 -144
- package/dist/website/examples/other/rotatingSphere/index.html +0 -96
- package/dist/website/examples/rendertarget/basic_canvas/example.html +0 -178
- package/dist/website/examples/rendertarget/basic_canvas/index.html +0 -130
- package/dist/website/examples/rendertarget/depth_texture/example.html +0 -188
- package/dist/website/examples/rendertarget/depth_texture/index.html +0 -140
- package/dist/website/examples/rendertarget/image_target/example.html +0 -196
- package/dist/website/examples/rendertarget/image_target/index.html +0 -148
- package/dist/website/examples/rendertarget/multiple_views/example.html +0 -204
- package/dist/website/examples/rendertarget/multiple_views/index.html +0 -156
- package/dist/website/examples/rendertarget/render_masks/example.html +0 -222
- package/dist/website/examples/rendertarget/render_masks/index.html +0 -174
- package/dist/website/examples/rendertarget/split_screen/example.html +0 -178
- package/dist/website/examples/rendertarget/split_screen/index.html +0 -130
- package/dist/website/examples/rendertarget/split_view/example.html +0 -191
- package/dist/website/examples/rendertarget/split_view/index.html +0 -143
- package/dist/website/examples/skybox/skybox/example.html +0 -162
- package/dist/website/examples/skybox/skybox/index.html +0 -114
- package/dist/website/examples/texture/arrays/example.html +0 -204
- package/dist/website/examples/texture/arrays/index.html +0 -156
- package/dist/website/examples/texture/textureWrap/example.html +0 -169
- package/dist/website/examples/texture/textureWrap/index.html +0 -121
- package/dist/website/examples/transform/propagation/example.html +0 -141
- package/dist/website/examples/transform/propagation/index.html +0 -93
- package/dist/website/guide/api-map/index.html +0 -82
- package/dist/website/guide/camera-and-controls/index.html +0 -62
- package/dist/website/guide/first-scene/index.html +0 -119
- package/dist/website/guide/index.html +0 -58
- package/dist/website/guide/installation/index.html +0 -133
- package/dist/website/guide/materials-and-lighting/index.html +0 -90
- package/dist/website/guide/plugins-and-render-pipeline/index.html +0 -89
- package/dist/website/guide/render-targets-and-views/index.html +0 -95
- package/dist/website/guide/scene-graph-and-transforms/index.html +0 -69
- package/dist/website/guide/textures-and-assets/index.html +0 -85
- package/dist/website/guide/troubleshooting/index.html +0 -39
- package/dist/website/images/disappointed.jpg +0 -0
- package/dist/website/images/skybox/grimmnight_back.png +0 -0
- package/dist/website/images/skybox/grimmnight_bottom.png +0 -0
- package/dist/website/images/skybox/grimmnight_front.png +0 -0
- package/dist/website/images/skybox/grimmnight_left.png +0 -0
- package/dist/website/images/skybox/grimmnight_right.png +0 -0
- package/dist/website/images/skybox/grimmnight_top.png +0 -0
- package/dist/website/images/skybox/miramar_back.png +0 -0
- package/dist/website/images/skybox/miramar_bottom.png +0 -0
- package/dist/website/images/skybox/miramar_front.png +0 -0
- package/dist/website/images/skybox/miramar_left.png +0 -0
- package/dist/website/images/skybox/miramar_right.png +0 -0
- package/dist/website/images/skybox/miramar_top.png +0 -0
- package/dist/website/images/uv.jpg +0 -0
- package/dist/website/index.html +0 -157
- package/dist/website/models/glb/AlphaBlendModeTest.glb +0 -0
- package/dist/website/models/glb/IridescenceLamp.glb +0 -0
- package/dist/website/models/glb/teapot.glb +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_BaseColor.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_Normal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_GlassPlasticMat_OcclusionRoughMetal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_BaseColor.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_Normal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LeatherPartsMat_OcclusionRoughMetal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_BaseColor.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_Normal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_BaseColor.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_Normal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_MetalPartsMat_OcclusionRoughMetal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_BaseColor.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_Normal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/FlightHelmet_Materials_RubberWoodMat_OcclusionRoughMetal.png +0 -0
- package/dist/website/models/gltf/flight_helmet/index.bin +0 -0
- package/dist/website/models/gltf/flight_helmet/index.gltf +0 -705
- package/dist/website/models/gltf/object.gltf +0 -23
- package/dist/website/models/gltf/pirate_girl/index.bin +0 -0
- package/dist/website/models/gltf/pirate_girl/index.gltf +0 -2082
- package/dist/website/models/obj/pirate_girl/pirate_girl.obj +0 -18459
- package/dist/website/models/obj/pirate_girl/pirate_girl.png +0 -0
- package/env.d.ts +0 -5
- package/examples/camera/orthographic.js +0 -121
- package/examples/camera/perspective.js +0 -139
- package/examples/camera/tone_mapping.js +0 -187
- package/examples/lights/directional.js +0 -396
- package/examples/lights/multiple_spot_lights.js +0 -305
- package/examples/lights/point.js +0 -336
- package/examples/lights/spot.js +0 -365
- package/examples/loader/gltf/basic.js +0 -78
- package/examples/loader/gltf/material/alpha-blend-mode.js +0 -80
- package/examples/loader/gltf/material/flight_helmet.js +0 -111
- package/examples/loader/gltf/material/iridescence_lamp.js +0 -118
- package/examples/loader/objloader.js +0 -93
- package/examples/material/cullface.js +0 -112
- package/examples/material/materials.js +0 -124
- package/examples/material/standard/basic.js +0 -161
- package/examples/material/standard/reflection_refraction.js +0 -190
- package/examples/mesh/capsule.js +0 -122
- package/examples/mesh/circle.js +0 -122
- package/examples/mesh/cone.js +0 -129
- package/examples/mesh/cuboid.js +0 -156
- package/examples/mesh/cylinder.js +0 -144
- package/examples/mesh/dodecahedron.js +0 -107
- package/examples/mesh/ellipsoid.js +0 -128
- package/examples/mesh/extrude.js +0 -118
- package/examples/mesh/frustum.js +0 -134
- package/examples/mesh/helix.js +0 -133
- package/examples/mesh/icosahedron.js +0 -107
- package/examples/mesh/icosphere.js +0 -112
- package/examples/mesh/lathe.js +0 -124
- package/examples/mesh/meshTopology.js +0 -159
- package/examples/mesh/octahedron.js +0 -107
- package/examples/mesh/plane.js +0 -122
- package/examples/mesh/prism.js +0 -122
- package/examples/mesh/pyramid.js +0 -121
- package/examples/mesh/ring.js +0 -122
- package/examples/mesh/skinning.js +0 -136
- package/examples/mesh/terrain.js +0 -163
- package/examples/mesh/tetrahedron.js +0 -107
- package/examples/mesh/torus-knot.js +0 -137
- package/examples/mesh/torus.js +0 -122
- package/examples/mesh/tube.js +0 -129
- package/examples/mesh/uvsphere.js +0 -118
- package/examples/mesh/wedge.js +0 -117
- package/examples/other/rotatingCube.js +0 -91
- package/examples/other/rotatingSphere.js +0 -93
- package/examples/rendertarget/basic_canvas.js +0 -127
- package/examples/rendertarget/depth_texture.js +0 -137
- package/examples/rendertarget/image_target.js +0 -145
- package/examples/rendertarget/multiple_views.js +0 -153
- package/examples/rendertarget/render_masks.js +0 -171
- package/examples/rendertarget/split_screen.js +0 -127
- package/examples/rendertarget/split_view.js +0 -140
- package/examples/skybox/skybox.js +0 -111
- package/examples/texture/arrays.js +0 -153
- package/examples/texture/textureWrap.js +0 -118
- package/examples/transform/propagation.js +0 -90
- package/rollup.config.js +0 -66
- package/src/caches/cache.js +0 -359
- package/src/caches/index.js +0 -2
- package/src/caches/uniformbuffers.js +0 -93
- package/src/cameracontrols/index.js +0 -258
- package/src/constants/index.js +0 -3
- package/src/constants/mesh.js +0 -197
- package/src/constants/others.js +0 -218
- package/src/constants/texture.js +0 -183
- package/src/content.config.js +0 -1
- package/src/core/constants.js +0 -14
- package/src/core/extensions.js +0 -42
- package/src/core/index.js +0 -7
- package/src/core/layouts/bindgroup.js +0 -167
- package/src/core/layouts/index.js +0 -6
- package/src/core/layouts/meshvertex.js +0 -60
- package/src/core/layouts/pipeline.js +0 -165
- package/src/core/layouts/uniform.js +0 -21
- package/src/core/layouts/uniformbuffer.js +0 -23
- package/src/core/layouts/vertexbuffer.js +0 -43
- package/src/core/limits.js +0 -247
- package/src/core/resources/blendparams.js +0 -89
- package/src/core/resources/gpubuffer.js +0 -53
- package/src/core/resources/gpumesh.js +0 -76
- package/src/core/resources/gpusampler.js +0 -43
- package/src/core/resources/gputexture.js +0 -102
- package/src/core/resources/index.js +0 -7
- package/src/core/resources/newuniformbuffer.js +0 -58
- package/src/core/resources/webglshadermodule.js +0 -58
- package/src/core/shader.js +0 -75
- package/src/core/webgl/bindgroup.js +0 -247
- package/src/core/webgl/descriptors.js +0 -166
- package/src/core/webgl/gpuqueue.js +0 -63
- package/src/core/webgl/index.js +0 -8
- package/src/core/webgl/renderpassencoder.js +0 -783
- package/src/core/webgl/renderpipeline.js +0 -91
- package/src/core/webgl/utils.js +0 -521
- package/src/core/webgl/webglrenderdevice.js +0 -259
- package/src/function.js +0 -358
- package/src/index.js +0 -15
- package/src/loader/gltf.js +0 -2722
- package/src/loader/index.js +0 -3
- package/src/loader/loader.js +0 -174
- package/src/loader/obj.js +0 -188
- package/src/loader/texture.js +0 -138
- package/src/loader/utils.js +0 -60
- package/src/material/alphablend.js +0 -21
- package/src/material/basic.js +0 -89
- package/src/material/depth.js +0 -87
- package/src/material/index.js +0 -9
- package/src/material/lambert.js +0 -87
- package/src/material/material.js +0 -148
- package/src/material/normal.js +0 -44
- package/src/material/phong.js +0 -100
- package/src/material/raw.js +0 -71
- package/src/material/standard.js +0 -309
- package/src/math/index.js +0 -3
- package/src/math/transform.js +0 -38
- package/src/mesh/attribute/attribute.js +0 -79
- package/src/mesh/attribute/index.js +0 -1
- package/src/mesh/attributedata/index.js +0 -1
- package/src/mesh/attributedata/separate.js +0 -180
- package/src/mesh/builders/base.js +0 -41
- package/src/mesh/builders/capsule.js +0 -47
- package/src/mesh/builders/circle.js +0 -63
- package/src/mesh/builders/cone.js +0 -29
- package/src/mesh/builders/cuboid.js +0 -135
- package/src/mesh/builders/cylinder.js +0 -131
- package/src/mesh/builders/dodecahedron.js +0 -130
- package/src/mesh/builders/ellipsoid.js +0 -65
- package/src/mesh/builders/extrude.js +0 -136
- package/src/mesh/builders/frustum.js +0 -26
- package/src/mesh/builders/geometry.js +0 -121
- package/src/mesh/builders/helix.js +0 -35
- package/src/mesh/builders/icosahedron.js +0 -61
- package/src/mesh/builders/icosphere.js +0 -141
- package/src/mesh/builders/index.js +0 -28
- package/src/mesh/builders/lathe.js +0 -85
- package/src/mesh/builders/octahedron.js +0 -43
- package/src/mesh/builders/plane.js +0 -73
- package/src/mesh/builders/polyhedron.js +0 -121
- package/src/mesh/builders/prism.js +0 -19
- package/src/mesh/builders/pyramid.js +0 -90
- package/src/mesh/builders/ring.js +0 -109
- package/src/mesh/builders/surfaces.js +0 -69
- package/src/mesh/builders/terrain.js +0 -80
- package/src/mesh/builders/tetrahedron.js +0 -37
- package/src/mesh/builders/torusknot.js +0 -36
- package/src/mesh/builders/tube.js +0 -209
- package/src/mesh/builders/utils.js +0 -148
- package/src/mesh/builders/uvsphere.js +0 -80
- package/src/mesh/builders/wedge.js +0 -22
- package/src/mesh/builders/wireframe.js +0 -62
- package/src/mesh/index.js +0 -4
- package/src/mesh/mesh.js +0 -157
- package/src/objects/bone.js +0 -17
- package/src/objects/camera/camera.js +0 -159
- package/src/objects/camera/index.js +0 -2
- package/src/objects/camera/projection.js +0 -203
- package/src/objects/debug/index.js +0 -1
- package/src/objects/debug/skeleton.js +0 -28
- package/src/objects/index.js +0 -7
- package/src/objects/light/ambient.js +0 -41
- package/src/objects/light/directional.js +0 -51
- package/src/objects/light/index.js +0 -5
- package/src/objects/light/point.js +0 -56
- package/src/objects/light/shadow/index.js +0 -1
- package/src/objects/light/shadow/shadow.js +0 -67
- package/src/objects/light/spot.js +0 -82
- package/src/objects/mesh.js +0 -89
- package/src/objects/object3d.js +0 -167
- package/src/objects/skybox.js +0 -38
- package/src/plugins/camera/RenderTarget2DPool.js +0 -94
- package/src/plugins/camera/camera.js +0 -27
- package/src/plugins/camera/index.js +0 -4
- package/src/plugins/camera/nodes/canvasblit.js +0 -153
- package/src/plugins/camera/nodes/index.js +0 -5
- package/src/plugins/camera/nodes/opaquepass.js +0 -94
- package/src/plugins/camera/nodes/tonemapping.js +0 -217
- package/src/plugins/camera/nodes/transparentpass.js +0 -87
- package/src/plugins/camera/nodes/view.js +0 -72
- package/src/plugins/camera/resources/cameracolortargets.js +0 -66
- package/src/plugins/camera/resources/canvasblitpipeline.js +0 -6
- package/src/plugins/camera/resources/index.js +0 -3
- package/src/plugins/camera/resources/tonemappingpipeline.js +0 -6
- package/src/plugins/index.js +0 -6
- package/src/plugins/light/index.js +0 -2
- package/src/plugins/light/light.js +0 -19
- package/src/plugins/light/nodes/index.js +0 -1
- package/src/plugins/light/nodes/light.js +0 -127
- package/src/plugins/meshmaterial/index.js +0 -3
- package/src/plugins/meshmaterial/meshmaterial.js +0 -644
- package/src/plugins/meshmaterial/nodes/index.js +0 -1
- package/src/plugins/meshmaterial/nodes/meshmaterial.js +0 -83
- package/src/plugins/meshmaterial/resources/bonetexture.js +0 -176
- package/src/plugins/meshmaterial/resources/environmentmap.js +0 -44
- package/src/plugins/meshmaterial/resources/index.js +0 -5
- package/src/plugins/meshmaterial/resources/materialuniformbuffers.js +0 -94
- package/src/plugins/meshmaterial/resources/meshmaterialbindgroups.js +0 -40
- package/src/plugins/meshmaterial/resources/meshmaterialpipelines.js +0 -50
- package/src/plugins/shadow/index.js +0 -3
- package/src/plugins/shadow/nodes/index.js +0 -3
- package/src/plugins/shadow/nodes/occluder.js +0 -106
- package/src/plugins/shadow/nodes/opaquePass.js +0 -110
- package/src/plugins/shadow/nodes/view.js +0 -272
- package/src/plugins/shadow/resources/ShadowMap.js +0 -99
- package/src/plugins/shadow/resources/index.js +0 -2
- package/src/plugins/shadow/resources/shadowpipelines.js +0 -25
- package/src/plugins/shadow/shadow.js +0 -26
- package/src/plugins/skeletonhelper/index.js +0 -1
- package/src/plugins/skeletonhelper/skeletonhelper.js +0 -202
- package/src/plugins/skybox/index.js +0 -3
- package/src/plugins/skybox/nodes/index.js +0 -1
- package/src/plugins/skybox/nodes/skybox.js +0 -335
- package/src/plugins/skybox/resources/index.js +0 -2
- package/src/plugins/skybox/resources/skyboxmesh.js +0 -14
- package/src/plugins/skybox/resources/skyboxpipeline.js +0 -16
- package/src/plugins/skybox/skybox.js +0 -18
- package/src/renderer/core/index.js +0 -293
- package/src/renderer/graph/index.js +0 -3
- package/src/renderer/graph/nodes.js +0 -34
- package/src/renderer/graph/rendergraph.js +0 -182
- package/src/renderer/index.js +0 -5
- package/src/renderer/plugin.js +0 -16
- package/src/renderer/renderer.js +0 -195
- package/src/renderer/views.js +0 -28
- package/src/rendertarget/canvastarget.js +0 -33
- package/src/rendertarget/image.js +0 -132
- package/src/rendertarget/index.js +0 -3
- package/src/rendertarget/rendertarget.js +0 -89
- package/src/shader/basicFragment.glsl +0 -38
- package/src/shader/basicVertex.glsl +0 -98
- package/src/shader/blitFragment.glsl +0 -9
- package/src/shader/common/color.glsl +0 -7
- package/src/shader/common/common.glsl +0 -54
- package/src/shader/common/index.js +0 -5
- package/src/shader/common/light.glsl +0 -437
- package/src/shader/common/math.glsl +0 -12
- package/src/shader/common/tonemap.glsl +0 -118
- package/src/shader/debug/index.js +0 -2
- package/src/shader/debug/skeletonFragment.glsl +0 -6
- package/src/shader/debug/skeletonVertex.glsl +0 -25
- package/src/shader/depthFragment.glsl +0 -34
- package/src/shader/fullscreenVertex.glsl +0 -26
- package/src/shader/index.js +0 -14
- package/src/shader/lambertFragment.glsl +0 -134
- package/src/shader/normalFragment.glsl +0 -22
- package/src/shader/phongFragment.glsl +0 -148
- package/src/shader/skyboxFragment.glsl +0 -16
- package/src/shader/skyboxVertex.glsl +0 -21
- package/src/shader/standardFragment.glsl +0 -331
- package/src/shader/tonemappingFragment.glsl +0 -37
- package/src/texture/index.js +0 -2
- package/src/texture/sampler.js +0 -191
- package/src/texture/texture.js +0 -438
- package/src/utils/index.js +0 -129
- package/src/utils/rendergraph_gui.js +0 -583
- package/tsconfig.json +0 -11
package/src/constants/others.js
DELETED
|
@@ -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
|
-
})
|
package/src/constants/texture.js
DELETED
|
@@ -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
|
-
}
|
package/src/content.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { collections } from "wima-docs-website-template/loaders";
|
package/src/core/constants.js
DELETED
|
@@ -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
|
-
})
|
package/src/core/extensions.js
DELETED
|
@@ -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,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,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
|
-
}
|