ris-framework 0.2.0-dev.13 → 0.2.0-dev.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/CHANGELOG.md +43 -2
  2. package/README.md +13 -5
  3. package/dist/api/IFramework.d.ts +3 -3
  4. package/dist/api/IFramework.d.ts.map +1 -1
  5. package/dist/api/_export.d.ts +3 -0
  6. package/dist/api/_export.d.ts.map +1 -1
  7. package/dist/api/camera/CameraTransformUtilities.d.ts +65 -0
  8. package/dist/api/camera/CameraTransformUtilities.d.ts.map +1 -0
  9. package/dist/api/camera/ICamera.d.ts +36 -2
  10. package/dist/api/camera/ICamera.d.ts.map +1 -1
  11. package/dist/api/camera/OrbitCamera.d.ts +22 -14
  12. package/dist/api/camera/OrbitCamera.d.ts.map +1 -1
  13. package/dist/api/camera/OrthographicCamera.d.ts +33 -11
  14. package/dist/api/camera/OrthographicCamera.d.ts.map +1 -1
  15. package/dist/api/camera/PerspectiveCamera.d.ts +32 -18
  16. package/dist/api/camera/PerspectiveCamera.d.ts.map +1 -1
  17. package/dist/api/content/ContentManager.d.ts +2 -2
  18. package/dist/api/content/ContentManager.d.ts.map +1 -1
  19. package/dist/api/content/IContentManager.d.ts +2 -2
  20. package/dist/api/content/IContentManager.d.ts.map +1 -1
  21. package/dist/api/lights/AmbientLight.d.ts +7 -2
  22. package/dist/api/lights/AmbientLight.d.ts.map +1 -1
  23. package/dist/api/lights/DirectionalLight.d.ts +18 -4
  24. package/dist/api/lights/DirectionalLight.d.ts.map +1 -1
  25. package/dist/api/lights/ILight.d.ts +18 -0
  26. package/dist/api/lights/ILight.d.ts.map +1 -0
  27. package/dist/api/lights/PointLight.d.ts +17 -4
  28. package/dist/api/lights/PointLight.d.ts.map +1 -1
  29. package/dist/api/lights/_export.d.ts +1 -0
  30. package/dist/api/lights/_export.d.ts.map +1 -1
  31. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts +2 -2
  32. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts.map +1 -1
  33. package/dist/api/material/IMaterial.d.ts +7 -0
  34. package/dist/api/material/IMaterial.d.ts.map +1 -1
  35. package/dist/api/material/IMaterialFactory.d.ts +3 -2
  36. package/dist/api/material/IMaterialFactory.d.ts.map +1 -1
  37. package/dist/api/material/IUnlitMaterialDescriptor.d.ts +16 -0
  38. package/dist/api/material/IUnlitMaterialDescriptor.d.ts.map +1 -0
  39. package/dist/api/material/MaterialFactory.d.ts +3 -2
  40. package/dist/api/material/MaterialFactory.d.ts.map +1 -1
  41. package/dist/api/material/SpriteMaterial.d.ts +3 -0
  42. package/dist/api/material/SpriteMaterial.d.ts.map +1 -1
  43. package/dist/api/material/UnlitMaterial.d.ts +5 -12
  44. package/dist/api/material/UnlitMaterial.d.ts.map +1 -1
  45. package/dist/api/material/_export.d.ts +1 -1
  46. package/dist/api/material/_export.d.ts.map +1 -1
  47. package/dist/api/meshes/IRenderableMesh.d.ts +3 -14
  48. package/dist/api/meshes/IRenderableMesh.d.ts.map +1 -1
  49. package/dist/api/meshes/RenderableMesh.d.ts +5 -20
  50. package/dist/api/meshes/RenderableMesh.d.ts.map +1 -1
  51. package/dist/api/rendering/IGraphicsDevice.d.ts +2 -2
  52. package/dist/api/rendering/IGraphicsDevice.d.ts.map +1 -1
  53. package/dist/api/rendering/IRenderer.d.ts +13 -6
  54. package/dist/api/rendering/IRenderer.d.ts.map +1 -1
  55. package/dist/api/rendering/_export-rendering.d.ts +1 -0
  56. package/dist/api/rendering/_export-rendering.d.ts.map +1 -1
  57. package/dist/api/rendering/enums.d.ts +5 -5
  58. package/dist/api/rendering/enums.d.ts.map +1 -1
  59. package/dist/api/rendering/primitive/IPrimitiveStateDescriptor.d.ts +24 -0
  60. package/dist/api/rendering/primitive/IPrimitiveStateDescriptor.d.ts.map +1 -0
  61. package/dist/api/rendering/primitive/_export.d.ts +1 -1
  62. package/dist/api/rendering/primitive/_export.d.ts.map +1 -1
  63. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts +5 -0
  64. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts.map +1 -1
  65. package/dist/api/rendering/texture/ITextureDescriptor.d.ts +53 -0
  66. package/dist/api/rendering/texture/ITextureDescriptor.d.ts.map +1 -0
  67. package/dist/api/rendering/texture/ITextureFactory.d.ts +5 -3
  68. package/dist/api/rendering/texture/ITextureFactory.d.ts.map +1 -1
  69. package/dist/api/rendering/texture/TextureUtilities.d.ts +29 -21
  70. package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -1
  71. package/dist/api/rendering/texture/_export-texture.d.ts +1 -1
  72. package/dist/api/rendering/texture/_export-texture.d.ts.map +1 -1
  73. package/dist/api/scene/ISceneObject.d.ts +12 -0
  74. package/dist/api/scene/ISceneObject.d.ts.map +1 -0
  75. package/dist/api/scene/Scene.d.ts +17 -6
  76. package/dist/api/scene/Scene.d.ts.map +1 -1
  77. package/dist/api/scene/node/Node.d.ts +26 -0
  78. package/dist/api/scene/node/Node.d.ts.map +1 -0
  79. package/dist/api/scene/node/TransformNode.d.ts +46 -0
  80. package/dist/api/scene/node/TransformNode.d.ts.map +1 -0
  81. package/dist/core/material/UnlitMaterialDescriptorUtilities.d.ts +17 -0
  82. package/dist/core/material/UnlitMaterialDescriptorUtilities.d.ts.map +1 -0
  83. package/dist/core/rendering/AGraphicsDevice.d.ts +2 -2
  84. package/dist/core/rendering/AGraphicsDevice.d.ts.map +1 -1
  85. package/dist/core/rendering/ARenderer.d.ts +7 -1
  86. package/dist/core/rendering/ARenderer.d.ts.map +1 -1
  87. package/dist/core/rendering/primitive/PrimitiveStateDescriptorUtilities.d.ts +15 -0
  88. package/dist/core/rendering/primitive/PrimitiveStateDescriptorUtilities.d.ts.map +1 -0
  89. package/dist/core/rendering/texture/TextureDescriptorUtilities.d.ts +14 -0
  90. package/dist/core/rendering/texture/TextureDescriptorUtilities.d.ts.map +1 -0
  91. package/dist/core/rendering/texture/texture.d.ts +3 -2
  92. package/dist/core/rendering/texture/texture.d.ts.map +1 -1
  93. package/dist/index.js +959 -540
  94. package/dist/webgl/WebGlGraphicsDevice.d.ts +2 -2
  95. package/dist/webgl/WebGlGraphicsDevice.d.ts.map +1 -1
  96. package/dist/webgl/lights/WebGlLightsBuffer.d.ts.map +1 -1
  97. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts +3 -3
  98. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts.map +1 -1
  99. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +8 -0
  100. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
  101. package/dist/webgl/texture/WebGlTexture2D.d.ts +3 -2
  102. package/dist/webgl/texture/WebGlTexture2D.d.ts.map +1 -1
  103. package/dist/webgl/texture/WebGlTextureFactory.d.ts +2 -9
  104. package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
  105. package/dist/webgl/utilities/WebGlErrorUtilities.d.ts.map +1 -1
  106. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
  107. package/dist/webgpu/WebGpuGraphicsDevice.d.ts +2 -2
  108. package/dist/webgpu/WebGpuGraphicsDevice.d.ts.map +1 -1
  109. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts +2 -2
  110. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts.map +1 -1
  111. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts +5 -0
  112. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts.map +1 -1
  113. package/dist/webgpu/texture/WebGpuTexture2D.d.ts +3 -2
  114. package/dist/webgpu/texture/WebGpuTexture2D.d.ts.map +1 -1
  115. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts +2 -2
  116. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts.map +1 -1
  117. package/package.json +2 -2
  118. package/src/Framework.ts +2 -2
  119. package/src/api/IFramework.ts +3 -3
  120. package/src/api/_export.ts +3 -0
  121. package/src/api/camera/CameraTransformUtilities.ts +182 -0
  122. package/src/api/camera/ICamera.ts +42 -2
  123. package/src/api/camera/OrbitCamera.ts +71 -38
  124. package/src/api/camera/OrthographicCamera.ts +71 -28
  125. package/src/api/camera/PerspectiveCamera.ts +69 -33
  126. package/src/api/content/ContentManager.ts +18 -12
  127. package/src/api/content/IContentManager.ts +2 -2
  128. package/src/api/lights/AmbientLight.ts +8 -2
  129. package/src/api/lights/DirectionalLight.ts +30 -5
  130. package/src/api/lights/ILight.ts +22 -0
  131. package/src/api/lights/PointLight.ts +26 -5
  132. package/src/api/lights/_export.ts +1 -0
  133. package/src/api/material/ForwardBlinnPhongMaterial.ts +2 -2
  134. package/src/api/material/IMaterial.ts +8 -0
  135. package/src/api/material/IMaterialFactory.ts +3 -2
  136. package/src/api/material/IUnlitMaterialDescriptor.ts +18 -0
  137. package/src/api/material/MaterialFactory.ts +4 -3
  138. package/src/api/material/SpriteMaterial.ts +4 -0
  139. package/src/api/material/UnlitMaterial.ts +11 -18
  140. package/src/api/material/_export.ts +1 -1
  141. package/src/api/meshes/IRenderableMesh.ts +3 -18
  142. package/src/api/meshes/RenderableMesh.ts +15 -45
  143. package/src/api/rendering/IGraphicsDevice.ts +2 -2
  144. package/src/api/rendering/IRenderer.ts +14 -6
  145. package/src/api/rendering/_export-rendering.ts +2 -1
  146. package/src/api/rendering/enums.ts +5 -5
  147. package/src/api/rendering/primitive/IPrimitiveStateDescriptor.ts +27 -0
  148. package/src/api/rendering/primitive/_export.ts +1 -1
  149. package/src/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.ts +6 -0
  150. package/src/api/rendering/texture/ITextureDescriptor.ts +62 -0
  151. package/src/api/rendering/texture/ITextureFactory.ts +5 -3
  152. package/src/api/rendering/texture/TextureUtilities.ts +59 -61
  153. package/src/api/rendering/texture/_export-texture.ts +1 -1
  154. package/src/api/scene/ISceneObject.ts +13 -0
  155. package/src/api/scene/Scene.ts +52 -11
  156. package/src/api/scene/node/Node.ts +54 -0
  157. package/src/api/scene/node/TransformNode.ts +88 -0
  158. package/src/core/material/UnlitMaterialDescriptorUtilities.ts +21 -0
  159. package/src/core/rendering/AGraphicsDevice.ts +2 -2
  160. package/src/core/rendering/ARenderer.ts +26 -4
  161. package/src/core/rendering/primitive/PrimitiveStateDescriptorUtilities.ts +22 -0
  162. package/src/core/rendering/texture/TextureDescriptorUtilities.ts +28 -0
  163. package/src/core/rendering/texture/texture.ts +2 -2
  164. package/src/main.ts +5 -4
  165. package/src/webgl/WebGlGraphicsDevice.ts +2 -3
  166. package/src/webgl/lights/WebGlLightsBuffer.ts +21 -8
  167. package/src/webgl/primitive/WebGlPrimitiveState.ts +8 -6
  168. package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +14 -0
  169. package/src/webgl/texture/WebGlTexture2D.ts +9 -8
  170. package/src/webgl/texture/WebGlTextureFactory.ts +62 -65
  171. package/src/webgl/utilities/WebGlErrorUtilities.ts +3 -2
  172. package/src/webgl/utilities/WebGlTextureUtilities.ts +10 -4
  173. package/src/webgpu/WebGpuGraphicsDevice.ts +3 -3
  174. package/src/webgpu/primitive/WebGpuPrimitiveState.ts +7 -5
  175. package/src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts +6 -0
  176. package/src/webgpu/texture/WebGpuTexture2D.ts +10 -9
  177. package/src/webgpu/texture/WebGpuTextureFactory.ts +20 -17
  178. package/dist/api/material/ICameraMaterial.d.ts +0 -18
  179. package/dist/api/material/ICameraMaterial.d.ts.map +0 -1
  180. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts +0 -24
  181. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts.map +0 -1
  182. package/dist/api/rendering/texture/TextureDescriptor.d.ts +0 -42
  183. package/dist/api/rendering/texture/TextureDescriptor.d.ts.map +0 -1
  184. package/src/api/material/ICameraMaterial.ts +0 -22
  185. package/src/api/rendering/primitive/PrimitiveStateDescriptor.ts +0 -27
  186. package/src/api/rendering/texture/TextureDescriptor.ts +0 -52
@@ -2,10 +2,11 @@ import {
2
2
  type CullMode,
3
3
  type FrontFace,
4
4
  type IPrimitiveState,
5
- type PrimitiveStateDescriptor,
5
+ type IPrimitiveStateDescriptor,
6
6
  type PrimitiveTopology,
7
7
  } from "../../api/index.ts";
8
8
  import type {GpuCullMode, GpuFrontFace, GpuPrimitiveTopology} from "../WebGpuTypes.ts";
9
+ import {resolvePrimitiveStateDescriptor} from "../../core/rendering/primitive/PrimitiveStateDescriptorUtilities.ts";
9
10
  import {WebGpuConverter} from "../utilities/WebGpuConverter.ts";
10
11
 
11
12
  /**
@@ -18,10 +19,11 @@ export class WebGpuPrimitiveState implements IPrimitiveState {
18
19
  * The constructor.
19
20
  * @param descriptor The primitive state descriptor.
20
21
  */
21
- public constructor(descriptor: PrimitiveStateDescriptor) {
22
- this.topology = descriptor.topology;
23
- this.cullFace = descriptor.cullFace;
24
- this.frontFace = descriptor.frontFace;
22
+ public constructor(descriptor?: IPrimitiveStateDescriptor) {
23
+ const resolved = resolvePrimitiveStateDescriptor(descriptor);
24
+ this.topology = resolved.topology;
25
+ this.cullFace = resolved.cullFace;
26
+ this.frontFace = resolved.frontFace;
25
27
  this.gpuTopology = WebGpuConverter.convertTopology(this.topology);
26
28
  this.gpuCullMode = WebGpuConverter.convertCullMode(this.cullFace);
27
29
  this.gpuFrontFace = WebGpuConverter.convertFrontFace(this.frontFace);
@@ -1,3 +1,4 @@
1
+ import {ColorSpace} from "../../api/rendering/enums.ts";
1
2
  import {vec2} from "gl-matrix";
2
3
  import {
3
4
  BufferUsage,
@@ -81,6 +82,11 @@ export class WebGpuMainRenderTargetRenderPipeline extends AWebGpuRenderPipeline
81
82
  this._graphicsDevice.swapChain?.textureFormat ?? this._framework.renderer.preferredTextureFormat);
82
83
  }
83
84
 
85
+ /**
86
+ * The color space. Stored only; it has no effect on WebGPU yet.
87
+ */
88
+ public colorSpace: ColorSpace = ColorSpace.LINEAR;
89
+
84
90
  private _getBindGroup(): GpuBindGroup {
85
91
  if (!this._bindGroup) {
86
92
  this._bindGroup = this._graphicsDevice.device.createBindGroup({
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  type IFramework,
3
3
  State,
4
- TextureDescriptor,
5
4
  TextureUsage,
6
5
  TextureUtilities,
7
6
  type ITextureView,
@@ -13,6 +12,7 @@ import type {WebGpuGraphicsDevice} from "../WebGpuGraphicsDevice.ts";
13
12
  import {GpuTextureUsage, type GpuTexture, type GpuTextureView} from "../WebGpuTypes.ts";
14
13
  import {WebGpuConverter} from "../utilities/WebGpuConverter.ts";
15
14
  import {WebGpuTextureView} from "./WebGpuTextureView.ts";
15
+ import {type ResolvedTextureDescriptor, resolveTextureDescriptor} from "../../core/rendering/texture/TextureDescriptorUtilities.ts";
16
16
 
17
17
  /**
18
18
  * The WebGPU 2D texture.
@@ -34,7 +34,7 @@ export class WebGpuTexture2D extends ATexture2D {
34
34
  * @param descriptor The texture descriptor.
35
35
  * @param image An optional image to upload instead of `descriptor.data`.
36
36
  */
37
- public constructor(framework: IFramework, descriptor: TextureDescriptor, image?: HTMLImageElement) {
37
+ public constructor(framework: IFramework, descriptor: ResolvedTextureDescriptor, image?: HTMLImageElement) {
38
38
  super(descriptor);
39
39
  this._graphicsDevice = framework.renderer.graphicsDevice as WebGpuGraphicsDevice;
40
40
  this._image = image;
@@ -171,13 +171,14 @@ export class WebGpuTexture2D extends ATexture2D {
171
171
  public static getOrCreateDefault(framework: IFramework): WebGpuTexture2D {
172
172
  let texture = WebGpuTexture2D._defaultFilled.get(framework);
173
173
  if (!texture || texture.state === State.DISPOSED) {
174
- const desc = new TextureDescriptor();
175
- desc.width = 1;
176
- desc.height = 1;
177
- desc.data = [new Uint8Array([255, 255, 255, 255])];
178
- desc.textureFormat = framework.renderer.preferredTextureFormat;
179
- desc.textureUsage = TextureUsage.TEXTURE_BINDING | TextureUsage.COPY_DST;
180
- desc.label = "RisDefaultFilledTexture";
174
+ const desc = resolveTextureDescriptor({
175
+ width: 1,
176
+ height: 1,
177
+ data: [new Uint8Array([255, 255, 255, 255])],
178
+ textureFormat: framework.renderer.preferredTextureFormat,
179
+ textureUsage: TextureUsage.TEXTURE_BINDING | TextureUsage.COPY_DST,
180
+ label: "RisDefaultFilledTexture",
181
+ });
181
182
  texture = new WebGpuTexture2D(framework, desc);
182
183
  texture.initialize();
183
184
  WebGpuTexture2D._defaultFilled.set(framework, texture);
@@ -3,12 +3,13 @@ import {
3
3
  type IFramework,
4
4
  type ITexture2D,
5
5
  type ITextureFactory,
6
- TextureDescriptor,
6
+ type ITextureDescriptor,
7
7
  TextureFormat,
8
8
  TextureUsage,
9
9
  } from "../../api/index.ts";
10
10
  import type {IKtx2Texture} from "ris-ktx2";
11
11
  import {WebGpuTexture2D} from "./WebGpuTexture2D.ts";
12
+ import {resolveTextureDescriptor} from "../../core/rendering/texture/TextureDescriptorUtilities.ts";
12
13
 
13
14
  /**
14
15
  * The WebGPU texture factory.
@@ -24,7 +25,7 @@ export class WebGpuTextureFactory implements ITextureFactory {
24
25
  }
25
26
 
26
27
  /** @inheritDoc */
27
- public createFromKtx2(_ktxTexture: IKtx2Texture, _descriptor?: TextureDescriptor): ITexture2D {
28
+ public createFromKtx2(_ktxTexture: IKtx2Texture, _descriptor?: ITextureDescriptor): ITexture2D {
28
29
  throw new Error("createFromKtx2 is not implemented for WebGPU.");
29
30
  }
30
31
 
@@ -35,7 +36,7 @@ export class WebGpuTextureFactory implements ITextureFactory {
35
36
  channels: number = 4,
36
37
  label: string | null | undefined = null,
37
38
  textureUsage = TextureUsage.COPY_DST | TextureUsage.TEXTURE_BINDING,
38
- textureFormat = TextureFormat.RGBA_8_UNORM,
39
+ textureFormat = TextureFormat.UNDEFINED,
39
40
  useMipMaps = false): ITexture2D {
40
41
 
41
42
  if (!data) {
@@ -51,13 +52,14 @@ export class WebGpuTextureFactory implements ITextureFactory {
51
52
  textureFormat = this._framework.renderer.preferredTextureFormat;
52
53
  }
53
54
 
54
- const desc = new TextureDescriptor();
55
- desc.width = width;
56
- desc.height = height;
57
- desc.textureFormat = textureFormat;
58
- desc.textureUsage = textureUsage;
59
- desc.generateMipmaps = useMipMaps;
60
- desc.label = label ?? null;
55
+ const desc = resolveTextureDescriptor({
56
+ width,
57
+ height,
58
+ textureFormat,
59
+ textureUsage,
60
+ generateMipmaps: useMipMaps,
61
+ label: label ?? null,
62
+ });
61
63
 
62
64
  let image: HTMLImageElement | undefined;
63
65
  if (typeof HTMLImageElement !== "undefined" && data instanceof HTMLImageElement) {
@@ -90,13 +92,14 @@ export class WebGpuTextureFactory implements ITextureFactory {
90
92
  textureFormat = this._framework.renderer.preferredTextureFormat;
91
93
  }
92
94
 
93
- const desc = new TextureDescriptor();
94
- desc.width = width;
95
- desc.height = height;
96
- desc.textureUsage = textureUsage;
97
- desc.textureFormat = textureFormat;
98
- desc.label = label;
99
- desc.generateMipmaps = useMipmap;
95
+ const desc = resolveTextureDescriptor({
96
+ width,
97
+ height,
98
+ textureUsage,
99
+ textureFormat,
100
+ label,
101
+ generateMipmaps: useMipmap,
102
+ });
100
103
 
101
104
  // WebGPU zero-initializes textures, so transparent black needs no upload; neither do depth textures.
102
105
  if (!color || (color.r === 0 && color.g === 0 && color.b === 0 && color.a === 0)) {
@@ -1,18 +0,0 @@
1
- import type { IMaterial } from "./IMaterial.js";
2
- import type { ICamera } from "../camera/ICamera.js";
3
- /**
4
- * A material that renders with a camera (unlit, Blinn-Phong, inspect mips).
5
- * A `Scene` assigns its camera to these materials in `scene.update()`.
6
- * @public
7
- */
8
- export interface ICameraMaterial extends IMaterial {
9
- /** The camera. Setting it binds the camera's buffers. */
10
- camera?: ICamera;
11
- }
12
- /**
13
- * Whether a material is an {@link ICameraMaterial}.
14
- * @param material The material.
15
- * @public
16
- */
17
- export declare function isCameraMaterial(material: IMaterial | undefined): material is ICameraMaterial;
18
- //# sourceMappingURL=ICameraMaterial.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ICameraMaterial.d.ts","sourceRoot":"","sources":["../../../src/api/material/ICameraMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAE9C,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,IAAI,eAAe,CAE7F"}
@@ -1,24 +0,0 @@
1
- import { PrimitiveTopology } from "./PrimitiveTopology.js";
2
- import { CullMode } from "./CullMode.js";
3
- import { FrontFace } from "./FrontFace.js";
4
- /**
5
- * Describes the state of a primitive.
6
- */
7
- export declare class PrimitiveStateDescriptor {
8
- /**
9
- * The topology of the primitive.
10
- * By default, it is set to TRIANGLE_LIST.
11
- */
12
- topology: PrimitiveTopology;
13
- /**
14
- * The culling mode.
15
- * By default, it is set to BACK.
16
- */
17
- cullFace: CullMode;
18
- /**
19
- * The front face.
20
- * By default, it is set to CCW(counter clock-wise).
21
- */
22
- frontFace: FrontFace;
23
- }
24
- //# sourceMappingURL=PrimitiveStateDescriptor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PrimitiveStateDescriptor.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/primitive/PrimitiveStateDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;GAEG;AACH,qBAAa,wBAAwB;IAEjC;;;OAGG;IACI,QAAQ,EAAE,iBAAiB,CAAmC;IAErE;;;OAGG;IACI,QAAQ,EAAE,QAAQ,CAAiB;IAE1C;;;OAGG;IACI,SAAS,EAAE,SAAS,CAAiB;CAC/C"}
@@ -1,42 +0,0 @@
1
- import { TextureFormat } from "./TextureFormat.js";
2
- import { vec2 } from "gl-matrix";
3
- /**
4
- * The texture descriptor.
5
- */
6
- export declare class TextureDescriptor {
7
- /**
8
- * The texture width.
9
- */
10
- width: number;
11
- /**
12
- * The texture height.
13
- */
14
- height: number;
15
- /**
16
- * The texture format.
17
- * By default, it is UNDEFINED.
18
- */
19
- textureFormat: TextureFormat;
20
- /**
21
- * The texture usage.
22
- * By default, it is TEXTURE_BINDING | COPY_DST.
23
- */
24
- textureUsage: number;
25
- /**
26
- * The texture label.
27
- */
28
- label: string | null;
29
- /**
30
- * The data per mip level.
31
- */
32
- data?: Uint8Array[];
33
- /**
34
- * Should mipmaps be generated.
35
- */
36
- generateMipmaps: boolean;
37
- /**
38
- * The block size of a texture, which must be set for compressed textures.
39
- */
40
- blockSize?: vec2;
41
- }
42
- //# sourceMappingURL=TextureDescriptor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextureDescriptor.d.ts","sourceRoot":"","sources":["../../../../src/api/rendering/texture/TextureDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;GAEG;AACH,qBAAa,iBAAiB;IAE1B;;OAEG;IACI,KAAK,EAAE,MAAM,CAAK;IAEzB;;OAEG;IACI,MAAM,EAAE,MAAM,CAAK;IAE1B;;;OAGG;IACI,aAAa,gBAA2B;IAE/C;;;OAGG;IACI,YAAY,SAAwD;IAE3E;;OAEG;IACI,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEnC;;OAEG;IACI,IAAI,CAAC,EAAE,UAAU,EAAE,CAAa;IAEvC;;OAEG;IACI,eAAe,UAAS;IAE/B;;OAEG;IACI,SAAS,CAAC,EAAE,IAAI,CAAC;CAE3B"}
@@ -1,22 +0,0 @@
1
- import type { IMaterial } from "./IMaterial.ts";
2
- import type { ICamera } from "../camera/ICamera.ts";
3
-
4
- /**
5
- * A material that renders with a camera (unlit, Blinn-Phong, inspect mips).
6
- * A `Scene` assigns its camera to these materials in `scene.update()`.
7
- * @public
8
- */
9
- export interface ICameraMaterial extends IMaterial {
10
-
11
- /** The camera. Setting it binds the camera's buffers. */
12
- camera?: ICamera;
13
- }
14
-
15
- /**
16
- * Whether a material is an {@link ICameraMaterial}.
17
- * @param material The material.
18
- * @public
19
- */
20
- export function isCameraMaterial(material: IMaterial | undefined): material is ICameraMaterial {
21
- return !!material && "camera" in material;
22
- }
@@ -1,27 +0,0 @@
1
- import {PrimitiveTopology} from "./PrimitiveTopology.ts";
2
- import {CullMode} from "./CullMode.ts";
3
- import {FrontFace} from "./FrontFace.ts";
4
-
5
- /**
6
- * Describes the state of a primitive.
7
- */
8
- export class PrimitiveStateDescriptor {
9
-
10
- /**
11
- * The topology of the primitive.
12
- * By default, it is set to TRIANGLE_LIST.
13
- */
14
- public topology: PrimitiveTopology = PrimitiveTopology.TRIANGLE_LIST;
15
-
16
- /**
17
- * The culling mode.
18
- * By default, it is set to BACK.
19
- */
20
- public cullFace: CullMode = CullMode.BACK;
21
-
22
- /**
23
- * The front face.
24
- * By default, it is set to CCW(counter clock-wise).
25
- */
26
- public frontFace: FrontFace = FrontFace.CCW;
27
- }
@@ -1,52 +0,0 @@
1
- import {TextureFormat} from "./TextureFormat.ts";
2
- import {TextureUsage} from "./TextureUsage.ts";
3
- import {vec2} from "gl-matrix";
4
-
5
- /**
6
- * The texture descriptor.
7
- */
8
- export class TextureDescriptor {
9
-
10
- /**
11
- * The texture width.
12
- */
13
- public width: number = 0;
14
-
15
- /**
16
- * The texture height.
17
- */
18
- public height: number = 0;
19
-
20
- /**
21
- * The texture format.
22
- * By default, it is UNDEFINED.
23
- */
24
- public textureFormat = TextureFormat.UNDEFINED;
25
-
26
- /**
27
- * The texture usage.
28
- * By default, it is TEXTURE_BINDING | COPY_DST.
29
- */
30
- public textureUsage = TextureUsage.TEXTURE_BINDING | TextureUsage.COPY_DST;
31
-
32
- /**
33
- * The texture label.
34
- */
35
- public label: string | null = null;
36
-
37
- /**
38
- * The data per mip level.
39
- */
40
- public data?: Uint8Array[] = undefined;
41
-
42
- /**
43
- * Should mipmaps be generated.
44
- */
45
- public generateMipmaps = false;
46
-
47
- /**
48
- * The block size of a texture, which must be set for compressed textures.
49
- */
50
- public blockSize?: vec2;
51
-
52
- }