ris-framework 0.2.0-dev.11 → 0.2.0-dev.12
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/CHANGELOG.md +22 -29
- package/README.md +13 -1
- package/dist/Framework.d.ts +26 -8
- package/dist/Framework.d.ts.map +1 -1
- package/dist/api/IFramework.d.ts +43 -0
- package/dist/api/IFramework.d.ts.map +1 -1
- package/dist/api/_export.d.ts +1 -1
- package/dist/api/_export.d.ts.map +1 -1
- package/dist/api/content/ContentManager.d.ts +5 -57
- package/dist/api/content/ContentManager.d.ts.map +1 -1
- package/dist/api/content/IContentManager.d.ts +24 -21
- package/dist/api/content/IContentManager.d.ts.map +1 -1
- package/dist/api/lights/LightsBuffer.d.ts +13 -6
- package/dist/api/lights/LightsBuffer.d.ts.map +1 -1
- package/dist/api/loaders/ObjGeometryMapper.d.ts +2 -2
- package/dist/api/loaders/ObjLoader.d.ts +61 -0
- package/dist/api/loaders/ObjLoader.d.ts.map +1 -0
- package/dist/api/loaders/_export.d.ts +1 -0
- package/dist/api/loaders/_export.d.ts.map +1 -1
- package/dist/api/loaders/obj/{ObjLoader.d.ts → ObjParser.d.ts} +20 -5
- package/dist/api/loaders/obj/ObjParser.d.ts.map +1 -0
- package/dist/api/loaders/obj/ObjTypes.d.ts +17 -1
- package/dist/api/loaders/obj/ObjTypes.d.ts.map +1 -1
- package/dist/api/loaders/obj/index.d.ts +1 -1
- package/dist/api/material/ForwardBlinnPhongMaterial.d.ts +22 -11
- package/dist/api/material/ForwardBlinnPhongMaterial.d.ts.map +1 -1
- package/dist/api/material/ICameraMaterial.d.ts +18 -0
- package/dist/api/material/ICameraMaterial.d.ts.map +1 -0
- package/dist/api/material/ILightsMaterial.d.ts +26 -0
- package/dist/api/material/ILightsMaterial.d.ts.map +1 -0
- package/dist/api/material/IMaterial.d.ts +2 -8
- package/dist/api/material/IMaterial.d.ts.map +1 -1
- package/dist/api/material/InspectTextureMipsMaterial.d.ts +2 -2
- package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -1
- package/dist/api/material/SpriteMaterial.d.ts +2 -2
- package/dist/api/material/SpriteMaterial.d.ts.map +1 -1
- package/dist/api/material/UnlitMaterial.d.ts +4 -3
- package/dist/api/material/UnlitMaterial.d.ts.map +1 -1
- package/dist/api/material/_export.d.ts +2 -0
- package/dist/api/material/_export.d.ts.map +1 -1
- package/dist/api/meshes/IMesh.d.ts +29 -34
- package/dist/api/meshes/IMesh.d.ts.map +1 -1
- package/dist/api/meshes/IMeshFactory.d.ts +13 -8
- package/dist/api/meshes/IMeshFactory.d.ts.map +1 -1
- package/dist/api/meshes/IRenderableMesh.d.ts +47 -0
- package/dist/api/meshes/IRenderableMesh.d.ts.map +1 -0
- package/dist/api/meshes/Mesh.d.ts +11 -57
- package/dist/api/meshes/Mesh.d.ts.map +1 -1
- package/dist/api/meshes/MeshFactory.d.ts +6 -3
- package/dist/api/meshes/MeshFactory.d.ts.map +1 -1
- package/dist/api/meshes/QuadMesh.d.ts +3 -5
- package/dist/api/meshes/QuadMesh.d.ts.map +1 -1
- package/dist/api/meshes/RenderableMesh.d.ts +95 -0
- package/dist/api/meshes/RenderableMesh.d.ts.map +1 -0
- package/dist/api/meshes/_export.d.ts +2 -1
- package/dist/api/meshes/_export.d.ts.map +1 -1
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +8 -2
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -1
- package/dist/api/rendering/IRenderer.d.ts +28 -1
- package/dist/api/rendering/IRenderer.d.ts.map +1 -1
- package/dist/api/rendering/enums.d.ts +7 -0
- package/dist/api/rendering/enums.d.ts.map +1 -1
- package/dist/api/rendering/renderer-interface.d.ts +1 -31
- package/dist/api/rendering/renderer-interface.d.ts.map +1 -1
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +2 -6
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -1
- package/dist/api/rendering/swapchain/ISwapChain.d.ts +1 -3
- package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -1
- package/dist/api/rendering/texture/TextureFormat.d.ts +88 -14
- package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -1
- package/dist/api/rendering/texture/TextureUtilities.d.ts +23 -0
- package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -1
- package/dist/api/scene/Scene.d.ts +30 -21
- package/dist/api/scene/Scene.d.ts.map +1 -1
- package/dist/api/scene/SceneMesh.d.ts +27 -0
- package/dist/api/scene/SceneMesh.d.ts.map +1 -0
- package/dist/api/utilities/AlignUtilities.d.ts.map +1 -1
- package/dist/api/window/WindowManager.d.ts.map +1 -1
- package/dist/core/rendering/ARenderer.d.ts +5 -5
- package/dist/core/rendering/ARenderer.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4006 -1355
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +4 -0
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -1
- package/dist/webgl/WebGlRenderer.d.ts +1 -3
- package/dist/webgl/WebGlRenderer.d.ts.map +1 -1
- package/dist/webgl/lights/WebGlLightsBuffer.d.ts +8 -4
- package/dist/webgl/lights/WebGlLightsBuffer.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +2 -0
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +3 -2
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -1
- package/dist/webgl/texture/WebGlTextureFactory.d.ts +7 -0
- package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlConstants.d.ts +91 -0
- package/dist/webgl/utilities/WebGlConstants.d.ts.map +1 -0
- package/dist/webgl/utilities/WebGlConverter.d.ts +0 -7
- package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlErrorUtilities.d.ts +10 -0
- package/dist/webgl/utilities/WebGlErrorUtilities.d.ts.map +1 -0
- package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlUtilities.d.ts +3 -0
- package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -1
- package/dist/webgpu/WebGpuGpuInfo.d.ts +28 -0
- package/dist/webgpu/WebGpuGpuInfo.d.ts.map +1 -0
- package/dist/webgpu/WebGpuGraphicsDevice.d.ts +80 -0
- package/dist/webgpu/WebGpuGraphicsDevice.d.ts.map +1 -0
- package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts +26 -0
- package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts.map +1 -0
- package/dist/webgpu/WebGpuRenderer.d.ts +26 -0
- package/dist/webgpu/WebGpuRenderer.d.ts.map +1 -0
- package/dist/webgpu/WebGpuTypes.d.ts +355 -0
- package/dist/webgpu/WebGpuTypes.d.ts.map +1 -0
- package/dist/webgpu/blending/WebGpuBlendState.d.ts +30 -0
- package/dist/webgpu/blending/WebGpuBlendState.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts +20 -0
- package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts +46 -0
- package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts +43 -0
- package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts +49 -0
- package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts.map +1 -0
- package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts +32 -0
- package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts.map +1 -0
- package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts +28 -0
- package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts +50 -0
- package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts +34 -0
- package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts +26 -0
- package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts +72 -0
- package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts +40 -0
- package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/sampler/WebGpuSampler.d.ts +39 -0
- package/dist/webgpu/sampler/WebGpuSampler.d.ts.map +1 -0
- package/dist/webgpu/shader/WebGpuShaderModule.d.ts +29 -0
- package/dist/webgpu/shader/WebGpuShaderModule.d.ts.map +1 -0
- package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts +21 -0
- package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts.map +1 -0
- package/dist/webgpu/shader/WgslShaderContent.d.ts +9 -0
- package/dist/webgpu/shader/WgslShaderContent.d.ts.map +1 -0
- package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts +41 -0
- package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTexture2D.d.ts +47 -0
- package/dist/webgpu/texture/WebGpuTexture2D.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTextureFactory.d.ts +21 -0
- package/dist/webgpu/texture/WebGpuTextureFactory.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTextureView.d.ts +25 -0
- package/dist/webgpu/texture/WebGpuTextureView.d.ts.map +1 -0
- package/dist/webgpu/utilities/WebGpuConverter.d.ts +45 -0
- package/dist/webgpu/utilities/WebGpuConverter.d.ts.map +1 -0
- package/package.json +2 -2
- package/shaders/glsl/main_render_target_flip_y_fs.glsl +35 -1
- package/shaders/wgsl/forward_blinn_phong_material.wgsl +150 -0
- package/shaders/wgsl/inspect_texture_mips.wgsl +51 -0
- package/shaders/wgsl/main_frame_buffer.wgsl +35 -0
- package/shaders/wgsl/main_render_target_flip_y.wgsl +35 -0
- package/shaders/wgsl/sprite.wgsl +40 -0
- package/shaders/wgsl/unlit_material.wgsl +49 -0
- package/src/Framework.ts +121 -37
- package/src/api/IFramework.ts +55 -0
- package/src/api/_export.ts +1 -1
- package/src/api/content/ContentManager.ts +46 -180
- package/src/api/content/IContentManager.ts +25 -21
- package/src/api/lights/LightsBuffer.ts +13 -6
- package/src/api/loaders/ObjGeometryMapper.ts +2 -2
- package/src/api/loaders/ObjLoader.ts +126 -0
- package/src/api/loaders/_export.ts +1 -0
- package/src/api/loaders/obj/{ObjLoader.ts → ObjParser.ts} +35 -4
- package/src/api/loaders/obj/ObjTypes.ts +19 -1
- package/src/api/loaders/obj/index.ts +1 -1
- package/src/api/material/ForwardBlinnPhongMaterial.ts +48 -22
- package/src/api/material/ICameraMaterial.ts +22 -0
- package/src/api/material/ILightsMaterial.ts +32 -0
- package/src/api/material/IMaterial.ts +2 -9
- package/src/api/material/InspectTextureMipsMaterial.ts +2 -2
- package/src/api/material/SpriteMaterial.ts +2 -2
- package/src/api/material/UnlitMaterial.ts +4 -3
- package/src/api/material/_export.ts +2 -0
- package/src/api/meshes/IMesh.ts +32 -37
- package/src/api/meshes/IMeshFactory.ts +14 -8
- package/src/api/meshes/IRenderableMesh.ts +58 -0
- package/src/api/meshes/Mesh.ts +17 -132
- package/src/api/meshes/MeshFactory.ts +14 -5
- package/src/api/meshes/QuadMesh.ts +4 -6
- package/src/api/meshes/RenderableMesh.ts +207 -0
- package/src/api/meshes/_export.ts +6 -5
- package/src/api/rendering/IGraphicsDeviceFeatures.ts +28 -21
- package/src/api/rendering/IRenderer.ts +34 -1
- package/src/api/rendering/enums.ts +10 -0
- package/src/api/rendering/renderer-interface.ts +1 -36
- package/src/api/rendering/renderpass/RenderPassDescriptor.ts +10 -14
- package/src/api/rendering/swapchain/ISwapChain.ts +1 -3
- package/src/api/rendering/texture/TextureFormat.ts +128 -14
- package/src/api/rendering/texture/TextureUtilities.ts +225 -10
- package/src/api/scene/Scene.ts +102 -69
- package/src/api/scene/SceneMesh.ts +61 -0
- package/src/api/sprites/SpriteBatchMesh.ts +1 -1
- package/src/api/utilities/AlignUtilities.ts +2 -1
- package/src/api/window/WindowManager.ts +1 -1
- package/src/core/rendering/ARenderer.ts +24 -15
- package/src/index.ts +0 -1
- package/src/main.ts +2 -3
- package/src/webgl/WebGLGraphicsDeviceFeatures.ts +12 -2
- package/src/webgl/WebGlGpuInfo.ts +1 -1
- package/src/webgl/WebGlRenderer.ts +2 -5
- package/src/webgl/lights/WebGlLightsBuffer.ts +14 -4
- package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +18 -1
- package/src/webgl/swap-chain/WebGlSwapChain.ts +7 -6
- package/src/webgl/texture/WebGlTextureFactory.ts +49 -7
- package/src/webgl/utilities/WebGlConstants.ts +136 -0
- package/src/webgl/utilities/WebGlConverter.ts +91 -22
- package/src/webgl/utilities/WebGlErrorUtilities.ts +15 -0
- package/src/webgl/utilities/WebGlTextureUtilities.ts +5 -2
- package/src/webgl/utilities/WebGlUtilities.ts +4 -0
- package/src/webgpu/WebGpuGpuInfo.ts +61 -0
- package/src/webgpu/WebGpuGraphicsDevice.ts +199 -0
- package/src/webgpu/WebGpuGraphicsDeviceFeatures.ts +41 -0
- package/src/webgpu/WebGpuRenderer.ts +49 -0
- package/src/webgpu/WebGpuTypes.ts +288 -0
- package/src/webgpu/blending/WebGpuBlendState.ts +53 -0
- package/src/webgpu/buffers/WebGpuBuffersFactory.ts +46 -0
- package/src/webgpu/buffers/WebGpuIndexBuffer.ts +118 -0
- package/src/webgpu/buffers/WebGpuUniformBuffer.ts +102 -0
- package/src/webgpu/buffers/WebGpuVertexBuffer.ts +119 -0
- package/src/webgpu/primitive/WebGpuPrimitiveState.ts +52 -0
- package/src/webgpu/render-pass/WebGpuRenderPass.ts +131 -0
- package/src/webgpu/render-pipelines/AWebGpuRenderPipeline.ts +123 -0
- package/src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts +119 -0
- package/src/webgpu/render-pipelines/WebGpuRenderPipelineFactory.ts +66 -0
- package/src/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.ts +249 -0
- package/src/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.ts +101 -0
- package/src/webgpu/sampler/WebGpuSampler.ts +84 -0
- package/src/webgpu/shader/WebGpuShaderModule.ts +65 -0
- package/src/webgpu/shader/WebGpuShaderModuleLoader.ts +38 -0
- package/src/webgpu/shader/WgslShaderContent.ts +20 -0
- package/src/webgpu/swap-chain/WebGpuSwapChain.ts +93 -0
- package/src/webgpu/texture/WebGpuTexture2D.ts +197 -0
- package/src/webgpu/texture/WebGpuTextureFactory.ts +118 -0
- package/src/webgpu/texture/WebGpuTextureView.ts +43 -0
- package/src/webgpu/utilities/WebGpuConverter.ts +299 -0
- package/src/wgsl-raw.d.ts +4 -0
- package/dist/api/FrameworkConfiguration.d.ts +0 -23
- package/dist/api/FrameworkConfiguration.d.ts.map +0 -1
- package/dist/api/IFrameworkConfiguration.d.ts +0 -25
- package/dist/api/IFrameworkConfiguration.d.ts.map +0 -1
- package/dist/api/loaders/obj/ObjLoader.d.ts.map +0 -1
- package/dist/api/meshes/SubMesh.d.ts +0 -47
- package/dist/api/meshes/SubMesh.d.ts.map +0 -1
- package/src/api/FrameworkConfiguration.ts +0 -29
- package/src/api/IFrameworkConfiguration.ts +0 -30
- package/src/api/meshes/SubMesh.ts +0 -71
|
@@ -6,49 +6,123 @@ export declare enum TextureFormat {
|
|
|
6
6
|
* Default value.
|
|
7
7
|
For unknown texture format.
|
|
8
8
|
*/
|
|
9
|
-
UNDEFINED =
|
|
9
|
+
UNDEFINED = "UNDEFINED",
|
|
10
10
|
/**
|
|
11
11
|
* Red, green, blue, and alpha channels.
|
|
12
12
|
* 8-bit integer per channel.
|
|
13
13
|
* [0, 255] converted to/from float [0, 1] in shader.
|
|
14
14
|
* */
|
|
15
|
-
RGBA_8_UNORM =
|
|
15
|
+
RGBA_8_UNORM = "RGBA_8_UNORM",
|
|
16
16
|
/**
|
|
17
17
|
* Red, green, blue, and alpha channels.
|
|
18
18
|
* 8-bit integer per channel.
|
|
19
19
|
* Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.
|
|
20
20
|
*/
|
|
21
|
-
RGBA_8_UNORM_SRGB =
|
|
21
|
+
RGBA_8_UNORM_SRGB = "RGBA_8_UNORM_SRGB",
|
|
22
22
|
/**
|
|
23
23
|
* Depth 24 and stencil 8.
|
|
24
24
|
*/
|
|
25
|
-
DEPTH_24_STENCIL_8 =
|
|
25
|
+
DEPTH_24_STENCIL_8 = "DEPTH_24_STENCIL_8",
|
|
26
26
|
/**
|
|
27
27
|
* The depth 32 float.
|
|
28
28
|
*/
|
|
29
|
-
DEPTH_32_FLOAT =
|
|
30
|
-
RED_32_FLOAT =
|
|
29
|
+
DEPTH_32_FLOAT = "DEPTH_32_FLOAT_8",
|
|
30
|
+
RED_32_FLOAT = "RED_32_FLOAT_8",
|
|
31
31
|
/**
|
|
32
32
|
* The 32-bit float format with one red component. It is typeless.
|
|
33
33
|
|
|
34
34
|
Valid only for D3D11.
|
|
35
35
|
*/
|
|
36
|
-
RED_32_TYPELESS =
|
|
36
|
+
RED_32_TYPELESS = "RED_32_TYPELE_8",
|
|
37
37
|
/**
|
|
38
38
|
* The BC7 compressed format with four 8-bit normalized unsigned integer components in RGBA order.
|
|
39
39
|
*/
|
|
40
|
-
BC7_RGBA_UNORM =
|
|
40
|
+
BC7_RGBA_UNORM = "BC7_RGBA_UNORM",
|
|
41
41
|
/**
|
|
42
42
|
* The BC3 compressed format with four 8-bit normalized unsigned integer components in RGBA order.
|
|
43
43
|
*/
|
|
44
|
-
BC3_RGBA_UNORM =
|
|
44
|
+
BC3_RGBA_UNORM = "BC3_RGBA_UNORM",
|
|
45
45
|
/**
|
|
46
46
|
* The ETC2 compressed format with four 8-bit normalized unsigned integer components in RGBA order.
|
|
47
47
|
*/
|
|
48
|
-
ETC2_RGBA8_UNORM =
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
ETC2_RGBA8_UNORM = "ETC2_RGBA8_UNORM",
|
|
49
|
+
/** BC7 RGBA, sRGB. Requires EXT_texture_compression_bptc (WebGL) or texture-compression-bc (WebGPU). */
|
|
50
|
+
BC7_RGBA_SRGB = "BC7_RGBA_SRGB",
|
|
51
|
+
/** BC3 (DXT5) RGBA, sRGB. Requires WEBGL_compressed_texture_s3tc_srgb (WebGL) or texture-compression-bc (WebGPU). */
|
|
52
|
+
BC3_RGBA_SRGB = "BC3_RGBA_SRGB",
|
|
53
|
+
/** BC1 (DXT1) RGB. Requires WEBGL_compressed_texture_s3tc (WebGL) or texture-compression-bc (WebGPU). */
|
|
54
|
+
BC1_RGB_UNORM = "BC1_RGB_UNORM",
|
|
55
|
+
/** BC1 (DXT1) RGB, sRGB. Requires WEBGL_compressed_texture_s3tc_srgb (WebGL). WebGPU only has BC1 RGBA, which is used instead. */
|
|
56
|
+
BC1_RGB_SRGB = "BC1_RGB_SRGB",
|
|
57
|
+
/** ETC2 RGBA8 with EAC alpha, sRGB. Requires WEBGL_compressed_texture_etc (WebGL) or texture-compression-etc2 (WebGPU). */
|
|
58
|
+
ETC2_RGBA8_SRGB = "ETC2_RGBA8_SRGB",
|
|
59
|
+
/** ETC2 RGB8. Requires WEBGL_compressed_texture_etc (WebGL) or texture-compression-etc2 (WebGPU). */
|
|
60
|
+
ETC2_RGB8_UNORM = "ETC2_RGB8_UNORM",
|
|
61
|
+
/** ETC2 RGB8, sRGB. Requires WEBGL_compressed_texture_etc (WebGL) or texture-compression-etc2 (WebGPU). */
|
|
62
|
+
ETC2_RGB8_SRGB = "ETC2_RGB8_SRGB",
|
|
63
|
+
/** The ASTC 4x4 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
64
|
+
ASTC_4X4_RGBA_UNORM = "ASTC_4X4_RGBA_UNORM",
|
|
65
|
+
/** The ASTC 4x4 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
66
|
+
ASTC_4X4_RGBA_SRGB = "ASTC_4X4_RGBA_SRGB",
|
|
67
|
+
/** The ASTC 5x4 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
68
|
+
ASTC_5X4_RGBA_UNORM = "ASTC_5X4_RGBA_UNORM",
|
|
69
|
+
/** The ASTC 5x4 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
70
|
+
ASTC_5X4_RGBA_SRGB = "ASTC_5X4_RGBA_SRGB",
|
|
71
|
+
/** The ASTC 5x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
72
|
+
ASTC_5X5_RGBA_UNORM = "ASTC_5X5_RGBA_UNORM",
|
|
73
|
+
/** The ASTC 5x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
74
|
+
ASTC_5X5_RGBA_SRGB = "ASTC_5X5_RGBA_SRGB",
|
|
75
|
+
/** The ASTC 6x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
76
|
+
ASTC_6X5_RGBA_UNORM = "ASTC_6X5_RGBA_UNORM",
|
|
77
|
+
/** The ASTC 6x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
78
|
+
ASTC_6X5_RGBA_SRGB = "ASTC_6X5_RGBA_SRGB",
|
|
79
|
+
/** The ASTC 6x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
80
|
+
ASTC_6X6_RGBA_UNORM = "ASTC_6X6_RGBA_UNORM",
|
|
81
|
+
/** The ASTC 6x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
82
|
+
ASTC_6X6_RGBA_SRGB = "ASTC_6X6_RGBA_SRGB",
|
|
83
|
+
/** The ASTC 8x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
84
|
+
ASTC_8X5_RGBA_UNORM = "ASTC_8X5_RGBA_UNORM",
|
|
85
|
+
/** The ASTC 8x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
86
|
+
ASTC_8X5_RGBA_SRGB = "ASTC_8X5_RGBA_SRGB",
|
|
87
|
+
/** The ASTC 8x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
88
|
+
ASTC_8X6_RGBA_UNORM = "ASTC_8X6_RGBA_UNORM",
|
|
89
|
+
/** The ASTC 8x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
90
|
+
ASTC_8X6_RGBA_SRGB = "ASTC_8X6_RGBA_SRGB",
|
|
91
|
+
/** The ASTC 8x8 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
92
|
+
ASTC_8X8_RGBA_UNORM = "ASTC_8X8_RGBA_UNORM",
|
|
93
|
+
/** The ASTC 8x8 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
94
|
+
ASTC_8X8_RGBA_SRGB = "ASTC_8X8_RGBA_SRGB",
|
|
95
|
+
/** The ASTC 10x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
96
|
+
ASTC_10X5_RGBA_UNORM = "ASTC_10X5_RGBA_UNORM",
|
|
97
|
+
/** The ASTC 10x5 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
98
|
+
ASTC_10X5_RGBA_SRGB = "ASTC_10X5_RGBA_SRGB",
|
|
99
|
+
/** The ASTC 10x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
100
|
+
ASTC_10X6_RGBA_UNORM = "ASTC_10X6_RGBA_UNORM",
|
|
101
|
+
/** The ASTC 10x6 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
102
|
+
ASTC_10X6_RGBA_SRGB = "ASTC_10X6_RGBA_SRGB",
|
|
103
|
+
/** The ASTC 10x8 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
104
|
+
ASTC_10X8_RGBA_UNORM = "ASTC_10X8_RGBA_UNORM",
|
|
105
|
+
/** The ASTC 10x8 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
106
|
+
ASTC_10X8_RGBA_SRGB = "ASTC_10X8_RGBA_SRGB",
|
|
107
|
+
/** The ASTC 10x10 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
108
|
+
ASTC_10X10_RGBA_UNORM = "ASTC_10X10_RGBA_UNORM",
|
|
109
|
+
/** The ASTC 10x10 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
110
|
+
ASTC_10X10_RGBA_SRGB = "ASTC_10X10_RGBA_SRGB",
|
|
111
|
+
/** The ASTC 12x10 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
112
|
+
ASTC_12X10_RGBA_UNORM = "ASTC_12X10_RGBA_UNORM",
|
|
113
|
+
/** The ASTC 12x10 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
114
|
+
ASTC_12X10_RGBA_SRGB = "ASTC_12X10_RGBA_SRGB",
|
|
115
|
+
/** The ASTC 12x12 compressed format with four 8-bit normalized unsigned integer components in RGBA order. */
|
|
116
|
+
ASTC_12X12_RGBA_UNORM = "ASTC_12X12_RGBA_UNORM",
|
|
117
|
+
/** The ASTC 12x12 compressed format with four 8-bit normalized unsigned integer components in RGBA order, sRGB-encoded color. */
|
|
118
|
+
ASTC_12X12_RGBA_SRGB = "ASTC_12X12_RGBA_SRGB",
|
|
119
|
+
/** The PVRTC1 compressed format at 4 bits per pixel with RGBA components. Requires WEBGL_compressed_texture_pvrtc. */
|
|
120
|
+
PVRTC_4BPPV1_RGBA = "PVRTC_4BPPV1_RGBA",
|
|
121
|
+
/** The PVRTC1 compressed format at 4 bits per pixel with RGB components. Requires WEBGL_compressed_texture_pvrtc. */
|
|
122
|
+
PVRTC_4BPPV1_RGB = "PVRTC_4BPPV1_RGB",
|
|
123
|
+
/** The PVRTC1 compressed format at 2 bits per pixel with RGBA components. Requires WEBGL_compressed_texture_pvrtc. */
|
|
124
|
+
PVRTC_2BPPV1_RGBA = "PVRTC_2BPPV1_RGBA",
|
|
125
|
+
/** The PVRTC1 compressed format at 2 bits per pixel with RGB components. Requires WEBGL_compressed_texture_pvrtc. */
|
|
126
|
+
PVRTC_2BPPV1_RGB = "PVRTC_2BPPV1_RGB"
|
|
53
127
|
}
|
|
54
128
|
//# sourceMappingURL=TextureFormat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextureFormat.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/texture/TextureFormat.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACrB;;;OAGG;IACH,SAAS,
|
|
1
|
+
{"version":3,"file":"TextureFormat.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/texture/TextureFormat.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACrB;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;;SAIK;IACL,YAAY,iBAAiB;IAE7B;;;;OAIG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,cAAc,qBAAqB;IAEnC,YAAY,mB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C,gIAAgI;IAChI,mBAAmB,wBAAwB;IAE3C,6GAA6G;IAC7G,qBAAqB,0BAA0B;IAE/C,iIAAiI;IACjI,oBAAoB,yBAAyB;IAE7C,6GAA6G;IAC7G,qBAAqB,0BAA0B;IAE/C,iIAAiI;IACjI,oBAAoB,yBAAyB;IAE7C,6GAA6G;IAC7G,qBAAqB,0BAA0B;IAE/C,iIAAiI;IACjI,oBAAoB,yBAAyB;IAE7C,sHAAsH;IACtH,iBAAiB,sBAAsB;IAEvC,qHAAqH;IACrH,gBAAgB,qBAAqB;IAErC,sHAAsH;IACtH,iBAAiB,sBAAsB;IAEvC,qHAAqH;IACrH,gBAAgB,qBAAqB;CACxC"}
|
|
@@ -5,10 +5,33 @@ import { KtxTranscodeFormat, VkFormat } from "ris-ktx2";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class TextureUtilities {
|
|
7
7
|
private static readonly _compressedTextureFormats;
|
|
8
|
+
/** Linear compressed format → its sRGB variant. */
|
|
9
|
+
private static readonly _srgbVariant;
|
|
8
10
|
private static readonly _vkFormatTextureFormat;
|
|
9
11
|
private static readonly _textureFormatVkFormat;
|
|
10
12
|
private static readonly _mapTextureFormatKtxTranscodeFormat;
|
|
11
13
|
private static readonly _mapKtxTranscodeFormatVkFormat;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the format stores sRGB-encoded colour (sampled as linear by the GPU).
|
|
16
|
+
* @param format The texture format.
|
|
17
|
+
*/
|
|
18
|
+
static isSrgbFormat(format: TextureFormat): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the sRGB variant of a linear format, or the format itself if it has none or is already sRGB.
|
|
21
|
+
* @param format The texture format.
|
|
22
|
+
*/
|
|
23
|
+
static toSrgbFormat(format: TextureFormat): TextureFormat;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the linear variant of an sRGB format, or the format itself.
|
|
26
|
+
* @param format The texture format.
|
|
27
|
+
*/
|
|
28
|
+
static toLinearFormat(format: TextureFormat): TextureFormat;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the block size (width, height) of a format: 1x1 for uncompressed, 4x4 for BC/ETC2, and the ASTC block.
|
|
31
|
+
* Returns null for formats it does not know.
|
|
32
|
+
* @param format The texture format.
|
|
33
|
+
*/
|
|
34
|
+
static getBlockSize(format: TextureFormat): [number, number] | null;
|
|
12
35
|
/**
|
|
13
36
|
* Checks if the given texture format is a compressed texture format.
|
|
14
37
|
* @param format - The texture format to check.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextureUtilities.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/texture/TextureUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAqB,QAAQ,EAAC,MAAM,UAAU,CAAC;AAGzE;;GAEG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"TextureUtilities.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/texture/TextureUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAqB,QAAQ,EAAC,MAAM,UAAU,CAAC;AAGzE;;GAEG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAkD/C;IAEF,mDAAmD;IACnD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAqBlC;IACF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAgD7C;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAsD5C;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mCAAmC,CAazD;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAmBpD;IAEF;;;OAGG;WACW,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAI1D;;;OAGG;WACW,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;IAIhE;;;OAGG;WACW,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;IAOlE;;;;OAIG;WACW,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAoB1E;;;;OAIG;WACW,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAIvE;;;;;;OAMG;WACW,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAI9D;;;;;;;OAOG;WACW,WAAW,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAkB9F;;;;OAIG;WACW,8BAA8B,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa;IAQ/E;;;;OAIG;WACW,wCAAwC,CAAC,aAAa,EAAE,aAAa,GAAG,kBAAkB;IAQxG;;;;OAIG;WACW,mCAAmC,CAAC,eAAe,EAAE,kBAAkB,GAAG,QAAQ;CAQnG"}
|
|
@@ -2,19 +2,27 @@ import { AmbientLight } from "../lights/AmbientLight.js";
|
|
|
2
2
|
import { DirectionalLight } from "../lights/DirectionalLight.js";
|
|
3
3
|
import { PointLight } from "../lights/PointLight.js";
|
|
4
4
|
import type { IDisposable } from "../core/IDisposable.js";
|
|
5
|
-
import type { LightsBuffer } from "../lights/LightsBuffer.js";
|
|
6
5
|
import type { IFramework } from "../IFramework.js";
|
|
7
|
-
import type {
|
|
6
|
+
import type { IRenderableMesh } from "../meshes/IRenderableMesh.js";
|
|
7
|
+
import { SceneMesh } from "./SceneMesh.js";
|
|
8
8
|
import type { GameTime } from "../time/GameTime.js";
|
|
9
9
|
import type { ICamera } from "../camera/ICamera.js";
|
|
10
10
|
/** Anything a scene can hold: a mesh, a light (ambient, directional, point) or a camera. */
|
|
11
|
-
export type SceneItem =
|
|
11
|
+
export type SceneItem = IRenderableMesh | SceneMesh | AmbientLight | DirectionalLight | PointLight | ICamera;
|
|
12
12
|
/**
|
|
13
|
-
* The scene.
|
|
14
|
-
* meshes
|
|
13
|
+
* The scene. Lights and cameras given a scene in their constructor add themselves through {@link add};
|
|
14
|
+
* meshes are added with `scene.add(mesh)` (wrapped in a {@link SceneMesh}, which owns the mesh's materials).
|
|
15
|
+
* Like C#, the scene keeps the light lists and hands its active ambient light and the lists themselves (not copies)
|
|
16
|
+
* to every lights material in {@link update}; each material owns and uploads its own lights buffer. Call {@link update} once per frame and {@link render} in the render listener.
|
|
15
17
|
*/
|
|
16
18
|
export declare class Scene implements IDisposable {
|
|
17
|
-
private readonly
|
|
19
|
+
private readonly _sceneMeshes;
|
|
20
|
+
private readonly _directionalLights;
|
|
21
|
+
private readonly _pointLights;
|
|
22
|
+
/** The directional light slots (matches the Blinn-Phong material). */
|
|
23
|
+
static readonly MAX_DIRECTIONAL_LIGHTS = 3;
|
|
24
|
+
/** The point light slots (matches the Blinn-Phong material). */
|
|
25
|
+
static readonly MAX_POINT_LIGHTS = 5;
|
|
18
26
|
private _activeAmbientLight;
|
|
19
27
|
private _disposed;
|
|
20
28
|
private _activeCamera?;
|
|
@@ -32,13 +40,10 @@ export declare class Scene implements IDisposable {
|
|
|
32
40
|
* @param framework The framework.
|
|
33
41
|
*/
|
|
34
42
|
constructor(framework: IFramework);
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
__forwardLightsBuffer: LightsBuffer;
|
|
40
|
-
/** The meshes in this scene, in the order they were added. */
|
|
41
|
-
get meshes(): readonly IMesh[];
|
|
43
|
+
/** The scene meshes, in the order they were added. */
|
|
44
|
+
get sceneMeshes(): readonly SceneMesh[];
|
|
45
|
+
/** The root meshes in this scene, in the order they were added. */
|
|
46
|
+
get meshes(): readonly IRenderableMesh[];
|
|
42
47
|
/** The directional lights in this scene. */
|
|
43
48
|
get directionalLights(): readonly DirectionalLight[];
|
|
44
49
|
/** The point lights in this scene. */
|
|
@@ -51,17 +56,18 @@ export declare class Scene implements IDisposable {
|
|
|
51
56
|
set activeAmbientLight(value: AmbientLight);
|
|
52
57
|
/**
|
|
53
58
|
* Adds a mesh, a light or a camera. Adding an item that is already in the scene does nothing.
|
|
54
|
-
* -
|
|
59
|
+
* - Renderable mesh or {@link SceneMesh}: drawn by {@link render}; its materials get the scene camera and lights.
|
|
60
|
+
* A mesh is wrapped in a `SceneMesh`, so {@link dispose} also disposes its materials.
|
|
55
61
|
* - Ambient light: added to {@link ambientLights} (use {@link activeAmbientLight} to make it the lit one).
|
|
56
|
-
* - Directional / point light: added to
|
|
62
|
+
* - Directional / point light: added to {@link directionalLights} / {@link pointLights}.
|
|
57
63
|
* - Camera: becomes the scene {@link camera}.
|
|
58
|
-
* Constructors given a scene (
|
|
64
|
+
* Constructors given a scene (lights, the perspective camera) call this themselves.
|
|
59
65
|
* @param item The item to add.
|
|
60
66
|
* @throws Error when all slots for a light kind are in use (3 directional, 5 point), or for an unsupported item.
|
|
61
67
|
*/
|
|
62
68
|
add(item: SceneItem): void;
|
|
63
69
|
/**
|
|
64
|
-
* Removes a mesh, a light or a camera. The mesh
|
|
70
|
+
* Removes a mesh (or scene mesh), a light or a camera. The mesh and its materials are not disposed.
|
|
65
71
|
* Removing the active camera clears {@link camera}.
|
|
66
72
|
* @param item The item to remove.
|
|
67
73
|
* @returns True when the item was in the scene (for a camera: was the active camera).
|
|
@@ -80,25 +86,28 @@ export declare class Scene implements IDisposable {
|
|
|
80
86
|
* @returns True when the light was in the scene.
|
|
81
87
|
*/
|
|
82
88
|
removeLight(light: DirectionalLight | PointLight): boolean;
|
|
89
|
+
private _addLight;
|
|
83
90
|
private _addAmbientLight;
|
|
84
91
|
private static _removeFrom;
|
|
85
92
|
/** Cameras have the camera buffers and updateBuffers(); meshes and lights do not. */
|
|
86
93
|
private static _isCamera;
|
|
87
|
-
/**
|
|
94
|
+
/** Renderable meshes have render() and sub meshes. */
|
|
88
95
|
private static _isMesh;
|
|
89
96
|
/**
|
|
90
|
-
* Updates the scene: assigns {@link camera}
|
|
97
|
+
* Updates the scene: assigns {@link camera}, the active ambient light and the light lists to the mesh materials.
|
|
98
|
+
* Each lights material uploads its lights buffer when drawn, only if the lights changed.
|
|
91
99
|
* @param _time The game time.
|
|
92
100
|
* @public
|
|
93
101
|
*/
|
|
94
102
|
update(_time: GameTime): void;
|
|
95
|
-
|
|
103
|
+
/** Assigns the camera (when set) and the lights to the scene mesh's materials. */
|
|
104
|
+
private _bind;
|
|
96
105
|
private static _assignCamera;
|
|
97
106
|
/**
|
|
98
107
|
* Renders the meshes.
|
|
99
108
|
*/
|
|
100
109
|
render(): void;
|
|
101
|
-
/** Disposes the meshes still in the scene
|
|
110
|
+
/** Disposes the scene meshes still in the scene: their meshes and materials. Calling it twice does nothing. */
|
|
102
111
|
dispose(): void;
|
|
103
112
|
}
|
|
104
113
|
//# sourceMappingURL=Scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../../src/api/scene/Scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../../src/api/scene/Scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,UAAU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AAW,iBAAiB,IAAI,SAAS,gBAAgB,EAAE,CAE1D;IAED,sCAAsC;IACtC,IAAW,WAAW,IAAI,SAAS,UAAU,EAAE,CAE9C;IAED;;OAEG;IACH,IAAW,kBAAkB,IAAI,YAAY,CAE5C;IAED,qFAAqF;IACrF,IAAW,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAGhD;IAED;;;;;;;;;;OAUG;IACI,GAAG,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAmBjC;;;;;;OAMG;IACI,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IA+BvC;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI;IAI3D;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,UAAU,GAAG,OAAO;IAIjE,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B,qFAAqF;IACrF,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,sDAAsD;IACtD,OAAO,CAAC,MAAM,CAAC,OAAO;IAKtB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAM7B,kFAAkF;IAClF,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,MAAM,CAAC,aAAa;IAc5B;;OAEG;IACH,MAAM,IAAI,IAAI;IAQd,+GAA+G;IACxG,OAAO,IAAI,IAAI;CAUzB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IDisposable } from "../core/IDisposable.js";
|
|
2
|
+
import type { IRenderableMesh } from "../meshes/IRenderableMesh.js";
|
|
3
|
+
import type { IMaterial } from "../material/IMaterial.js";
|
|
4
|
+
/**
|
|
5
|
+
* A renderable mesh held by a scene (C# `SceneMesh`): `new SceneMesh(renderableMesh)`.
|
|
6
|
+
* It covers the mesh and all its sub meshes, and owns their materials:
|
|
7
|
+
* disposing it disposes the mesh (buffers once) and each distinct material once.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare class SceneMesh implements IDisposable {
|
|
11
|
+
readonly mesh: IRenderableMesh;
|
|
12
|
+
private _disposed;
|
|
13
|
+
/**
|
|
14
|
+
* The constructor.
|
|
15
|
+
* @param mesh The root renderable mesh.
|
|
16
|
+
*/
|
|
17
|
+
constructor(mesh: IRenderableMesh);
|
|
18
|
+
/** The mesh and all its sub meshes, depth first. */
|
|
19
|
+
get meshes(): IRenderableMesh[];
|
|
20
|
+
/** The distinct materials of the mesh and its sub meshes. */
|
|
21
|
+
get materials(): IMaterial[];
|
|
22
|
+
/** Draws the mesh and its sub meshes. */
|
|
23
|
+
render(): void;
|
|
24
|
+
/** Disposes the mesh and its materials. Calling it twice does nothing. */
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=SceneMesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneMesh.d.ts","sourceRoot":"","sources":["../../../src/api/scene/SceneMesh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,WAAW;aAQN,IAAI,EAAE,eAAe;IANxD,OAAO,CAAC,SAAS,CAAS;IAE1B;;;OAGG;gBACgC,IAAI,EAAE,eAAe;IAGxD,oDAAoD;IACpD,IAAW,MAAM,IAAI,eAAe,EAAE,CAQrC;IAED,6DAA6D;IAC7D,IAAW,SAAS,IAAI,SAAS,EAAE,CAQlC;IAED,yCAAyC;IAClC,MAAM,IAAI,IAAI;IAIrB,0EAA0E;IACnE,OAAO,IAAI,IAAI;CAWzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlignUtilities.d.ts","sourceRoot":"","sources":["../../../src/api/utilities/AlignUtilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,cAAc;IAEvB;;;;;OAKG;WACW,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"AlignUtilities.d.ts","sourceRoot":"","sources":["../../../src/api/utilities/AlignUtilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,cAAc;IAEvB;;;;;OAKG;WACW,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAK7D;;;;;OAKG;WACW,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;CAgB3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WindowManager.d.ts","sourceRoot":"","sources":["../../../src/api/window/WindowManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WindowManager.d.ts","sourceRoot":"","sources":["../../../src/api/window/WindowManager.ts"],"names":[],"mappings":"AAAI,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,aAAa,CAAC;AAE9D;;GAEG;AACH,qBAAa,aAAc,YAAW,cAAc;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAC1D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,SAAS,CAAS;IAE1B;;;OAGG;gBACgB,MAAM,GAAE,iBAAiB,GAAG,IAAW;IAQ1D,eAAe,UAAQ;IACrB,YAAY,eAAsB;IAClC,KAAK,SAAM;IACX,iBAAiB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IAG1C,oBAAoB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IAM7C,iBAAiB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IAG1C,oBAAoB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IAM7C,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAG7E,sBAAsB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAGhF,mBAAmB,IAAI,IAAI;IAG3B,kBAAkB,IAAI,IAAI;IAG1B,qGAAqG;IACrG,OAAO,IAAI,IAAI;IAgBjB,kBAAkB;IAClB,YAAY,IAAI,IAAI;IAcpB,kBAAkB;IAClB,IAAW,MAAM,IAAI,iBAAiB,CAErC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ITempRenderer } from "../../api/rendering/renderer-interface.js";
|
|
2
2
|
import type { vec2 } from "gl-matrix";
|
|
3
3
|
import type { RenderingLimits } from "../../api/rendering/rendering-limits.js";
|
|
4
|
-
import { type IFramework, type IGraphicsDevice, type IMainRenderTargetRenderPipeline, type IRenderPass, type ISwapChain, type ITexture2D, RenderingBackend } from "../../api/index.js";
|
|
5
|
-
import { TextureFormat, Color } from "../../api/index.js";
|
|
4
|
+
import { Color, type IFramework, type IGraphicsDevice, type IMainRenderTargetRenderPipeline, type IRendererConfiguration, type IRenderPass, type ISwapChain, type ITexture2D, RenderingBackend, TextureFormat } from "../../api/index.js";
|
|
6
5
|
export declare abstract class ARenderer implements ITempRenderer {
|
|
7
6
|
protected readonly _framework: IFramework;
|
|
8
7
|
/**
|
|
@@ -11,7 +10,6 @@ export declare abstract class ARenderer implements ITempRenderer {
|
|
|
11
10
|
protected _resizeListeners: ((sender: any, size: vec2) => void)[];
|
|
12
11
|
private readonly _windowManager;
|
|
13
12
|
private _graphicsDevice;
|
|
14
|
-
private _preferredTextureFormat;
|
|
15
13
|
private _preferredDepthStencilFormat;
|
|
16
14
|
private readonly _currentBackBufferSize;
|
|
17
15
|
private _swapChainRequiresResize;
|
|
@@ -24,6 +22,7 @@ export declare abstract class ARenderer implements ITempRenderer {
|
|
|
24
22
|
protected _swapChainRenderPass: IRenderPass;
|
|
25
23
|
protected _mainRenderTargetRenderPass?: IRenderPass;
|
|
26
24
|
protected _mainRenderTargetPipeline?: IMainRenderTargetRenderPipeline;
|
|
25
|
+
protected _renderConfiguration: IRendererConfiguration;
|
|
27
26
|
/** @inheritdoc */
|
|
28
27
|
get graphicsDevice(): IGraphicsDevice;
|
|
29
28
|
/** @inheritdoc */
|
|
@@ -32,7 +31,7 @@ export declare abstract class ARenderer implements ITempRenderer {
|
|
|
32
31
|
set clearColor(color: Color);
|
|
33
32
|
get limits(): RenderingLimits | null;
|
|
34
33
|
/** @inheritdoc */
|
|
35
|
-
|
|
34
|
+
readonly preferredTextureFormat: TextureFormat;
|
|
36
35
|
/** @inheritdoc */
|
|
37
36
|
get preferredDepthStencilFormat(): TextureFormat;
|
|
38
37
|
/** @inheritdoc */
|
|
@@ -44,8 +43,9 @@ export declare abstract class ARenderer implements ITempRenderer {
|
|
|
44
43
|
/**
|
|
45
44
|
* The constructor.
|
|
46
45
|
* @param framework The framework.
|
|
46
|
+
* @param configuration The renderer configuration.
|
|
47
47
|
*/
|
|
48
|
-
constructor(framework: IFramework);
|
|
48
|
+
protected constructor(framework: IFramework, configuration: IRendererConfiguration);
|
|
49
49
|
backend: RenderingBackend;
|
|
50
50
|
/** @inheritDoc */
|
|
51
51
|
addOnResizedListener(event: (sender: any, e: vec2) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ARenderer.d.ts","sourceRoot":"","sources":["../../../src/core/rendering/ARenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ARenderer.d.ts","sourceRoot":"","sources":["../../../src/core/rendering/ARenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EACH,KAAK,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,+BAA+B,EAAE,KAAK,sBAAsB,EACjE,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,gBAAgB,EAKhB,aAAa,EAEhB,MAAM,oBAAoB,CAAC;AAG5B,8BAAsB,SAAU,YAAW,aAAa;IAEpD,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,EAAE,CAAM;IAEvE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,4BAA4B,CAAmD;IACvF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAgB;IACvD,OAAO,CAAC,wBAAwB,CAAkB;IAClD,OAAO,CAAC,oBAAoB,CAAQ;IACpC,OAAO,CAAC,WAAW,CAA4B;IAE/C,SAAS,CAAC,+BAA+B,EAAE,OAAO,CAAS;IAC3D,SAAS,CAAC,UAAU,EAAE,UAAU,CAAS;IACzC,SAAS,CAAC,iBAAiB,EAAE,UAAU,CAAS;IAChD,SAAS,CAAC,mBAAmB,EAAE,UAAU,CAAS;IAClD,SA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oBAAoB;IA6B5B,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,eAAe;IAwBvB,kBAAkB;IACX,eAAe,IAAI,IAAI;IAI9B,kBAAkB;IACX,aAAa,IAAI,IAAI;CAiB/B"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,6BAA6B,EAAC,MAAM,2BAA2B,CAAC;AACxE,cAAc,gBAAgB,CAAC"}
|