@predy-js/render-interface 0.1.32-beta.4 → 0.1.32

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.
@@ -1,7 +1,6 @@
1
1
  import type { RenderPass, RenderPassAttachmentOptions, RenderPassClearAction, RenderPassDelegate, RenderPassDepthStencilAttachment, RenderPassDestroyOptions, RenderPassOptions, RenderPassStoreAction } from '../../types/RenderPass';
2
2
  import { RenderPassAttachmentStorageType, RenderPassMeshOrder } from '../../types/RenderPass';
3
3
  import type { MarsMesh } from './MarsMesh';
4
- import type { Camera } from '../../types/Camera';
5
4
  import type { MarsRenderer } from './MarsRenderer';
6
5
  import { GLFrameBuffer } from '../webgl/GLFrameBuffer';
7
6
  import { MarsRenderPassColorAttachment } from './MarsRenderPassColorAttachment';
@@ -13,7 +12,6 @@ export declare class MarsRenderPass implements RenderPass {
13
12
  readonly name: string;
14
13
  readonly priority: number;
15
14
  readonly meshes: MarsMesh[];
16
- readonly camera: Camera;
17
15
  readonly options: RenderPassAttachmentOptions;
18
16
  readonly renderer: MarsRenderer;
19
17
  readonly frameBuffer?: GLFrameBuffer;
@@ -16,8 +16,8 @@ export declare class MarsRenderPassColorAttachment implements RenderPassColorAtt
16
16
  textureOptions?: MarsRenderPassColorAttachmentTextureOptions;
17
17
  private _isDestroyed;
18
18
  multisample: number;
19
+ readonly storageType = RenderPassAttachmentStorageType.color;
19
20
  get isDestroyed(): boolean;
20
- get storageType(): RenderPassAttachmentStorageType;
21
21
  constructor(options: MarsRenderPassColorAttachmentOptions);
22
22
  get size(): [x: number, y: number];
23
23
  get width(): number;
package/dist/statistic.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.32-beta.4
5
+ * Version: v0.1.32
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -2,10 +2,11 @@ import type { TypedArray } from './type';
2
2
  import type { IGPUResource, IGPURenderer } from './IGPURenderer';
3
3
  import type { GPURenderer } from './Renderer';
4
4
  export type GPUBufferTarget = WebGLRenderingContext['ARRAY_BUFFER'] | WebGLRenderingContext['ELEMENT_ARRAY_BUFFER'] | WebGL2RenderingContext['COPY_READ_BUFFER'] | WebGL2RenderingContext['COPY_WRITE_BUFFER'] | WebGL2RenderingContext['TRANSFORM_FEEDBACK_BUFFER'] | WebGL2RenderingContext['UNIFORM_BUFFER'] | WebGL2RenderingContext['PIXEL_PACK_BUFFER'] | WebGL2RenderingContext['PIXEL_UNPACK_BUFFER'];
5
+ type GPUBufferType = WebGLRenderingContext['FLOAT'] | WebGLRenderingContext['INT'] | WebGLRenderingContext['SHORT'];
5
6
  export interface GPUBufferOptions {
6
7
  name?: string;
7
8
  target?: GPUBufferTarget;
8
- type?: WebGLRenderingContext['FLOAT'] | WebGLRenderingContext['INT'] | WebGLRenderingContext['SHORT'];
9
+ type?: GPUBufferType;
9
10
  /**
10
11
  * 数据元素的总量
11
12
  */
@@ -23,7 +24,7 @@ export declare class GPUBuffer implements IGPUResource {
23
24
  readonly isDestroyed: boolean;
24
25
  readonly level: number;
25
26
  readonly target: GPUBufferTarget;
26
- readonly type: WebGLRenderingContext['FLOAT'] | WebGLRenderingContext['INT'] | WebGLRenderingContext['SHORT'];
27
+ readonly type: GPUBufferOptions['type'];
27
28
  readonly byteLength: number;
28
29
  readonly bytesPerElement: number;
29
30
  destroy(): void;
@@ -52,3 +53,4 @@ export declare class GPUBuffer implements IGPUResource {
52
53
  readSubData(elementOffset: number, typedArray: TypedArray, elementCount?: number): boolean;
53
54
  assignRenderer(renderer: GPURenderer): GPUBuffer;
54
55
  }
56
+ export {};
@@ -1,6 +1,5 @@
1
1
  import type { UniformValue } from './Material';
2
2
  import type { RenderPass, RenderPassClearAction, RenderPassDestroyOptions, SemanticMap } from './RenderPass';
3
- import type { Camera } from './Camera';
4
3
  import type { Mesh } from './Mesh';
5
4
  import type { GPUBuffer } from './GPUBuffer';
6
5
  import type { vec4 } from './type';
@@ -9,7 +8,6 @@ import type { IGPURenderer, IGPUResource } from './IGPURenderer';
9
8
  import type { DestroyOptions } from './constants';
10
9
  import type { InstancedMesh } from './Mesh';
11
10
  export interface RenderState {
12
- currentCamera: Camera;
13
11
  currentMesh: Mesh | InstancedMesh;
14
12
  currentFrame: RenderFrame;
15
13
  currentPass: RenderPass;
@@ -1,5 +1,4 @@
1
1
  import type { Texture, TextureConfigOptions, TextureFormatOptions } from './Texture';
2
- import type { Camera } from './Camera';
3
2
  import type { Mesh, MeshDestroyOptions } from './Mesh';
4
3
  import type { vec4 } from './type';
5
4
  import type { IGPURenderer, IGPUResource } from './IGPURenderer';
@@ -130,7 +129,6 @@ export declare class RenderPass implements IGPUResource {
130
129
  readonly depthAttachment?: RenderPassDepthStencilAttachment;
131
130
  readonly stencilAttachment?: RenderPassDepthStencilAttachment;
132
131
  readonly viewport: [x: number, y: number, width: number, height: number];
133
- readonly camera: Camera;
134
132
  readonly meshes: Mesh[];
135
133
  readonly renderer?: IGPURenderer;
136
134
  readonly semantics: SemanticMap;
@@ -6,7 +6,6 @@ import type { IGPURenderer } from './IGPURenderer';
6
6
  import type { Canvas } from './Canvas';
7
7
  import type { Texture } from './Texture';
8
8
  import type { RenderPass } from './RenderPass';
9
- export { Camera, CameraOptions } from './Camera';
10
9
  export interface RendererOptions {
11
10
  gl?: WebGLRenderingContext | WebGL2RenderingContext;
12
11
  canvas?: HTMLCanvasElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.32-beta.4",
3
+ "version": "0.1.32",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -1,12 +0,0 @@
1
- import type { mat4 } from './type';
2
- export interface CameraOptions {
3
- priority?: number;
4
- name?: string;
5
- type?: any;
6
- }
7
- export interface Camera {
8
- readonly name: string;
9
- readonly view?: Float32Array | mat4;
10
- readonly projection?: Float32Array | mat4;
11
- readonly viewProjection?: Float32Array | mat4;
12
- }