@galacean/effects-core 2.4.0-alpha.0 → 2.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import * as spec from '@galacean/effects-specification';
2
2
  import { MaskMode } from './types';
3
3
  import type { Material } from './material';
4
4
  export declare function valIfUndefined<T>(val: any, def: T): T;
5
- export declare function getPreMultiAlpha(blending?: number): number;
5
+ export declare function getPreMultiAlpha(blending?: spec.BlendingMode): number;
6
6
  export declare function setBlendMode(material: Material, blendMode?: number): void;
7
7
  export declare function setSideMode(material: Material, side: spec.SideMode): void;
8
8
  export declare function setMaskMode(material: Material, maskMode: MaskMode, colorMask?: boolean): void;
@@ -1,17 +1,17 @@
1
+ import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
1
2
  import type { Geometry } from '../../render/geometry';
2
3
  import type { BoundingBoxTriangle } from './click-handler';
3
- import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
4
4
  /**
5
5
  *
6
6
  */
7
7
  export declare class MeshCollider {
8
8
  private boundingBoxData;
9
- private geometry;
10
9
  private triangles;
11
10
  private worldMatrix;
12
11
  getBoundingBoxData(): BoundingBoxTriangle;
13
12
  getBoundingBox(): BoundingBoxTriangle;
14
13
  setGeometry(geometry: Geometry, worldMatrix?: Matrix4): void;
15
14
  private geometryToTriangles;
15
+ private assemblyTriangles;
16
16
  private applyWorldMatrix;
17
17
  }
@@ -3,9 +3,8 @@ import type { ColorPlayableAssetData } from '../../animation';
3
3
  import { BaseRenderComponent } from '../../components';
4
4
  import type { Engine } from '../../engine';
5
5
  import type { MaskProps } from '../../material';
6
- import type { GeometryDrawMode } from '../../render';
7
- import { Geometry } from '../../render';
8
- import type { GeometryFromShape } from '../../shape';
6
+ import type { Geometry } from '../../render';
7
+ import { type GeometryFromShape } from '../../shape';
9
8
  import { type Texture } from '../../texture';
10
9
  import type { Playable, PlayableGraph } from '../cal/playable-graph';
11
10
  import { PlayableAsset } from '../cal/playable-graph';
@@ -39,8 +38,7 @@ export declare class SpriteComponent extends BaseRenderComponent {
39
38
  constructor(engine: Engine, props?: SpriteItemProps);
40
39
  onUpdate(dt: number): void;
41
40
  onDestroy(): void;
42
- createGeometry(mode: GeometryDrawMode): Geometry;
43
- getItemGeometryData(): {
41
+ getItemGeometryData(geometry: Geometry): {
44
42
  index: number[];
45
43
  atlasOffset: number[];
46
44
  };
@@ -1,8 +1,7 @@
1
1
  import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
2
2
  import type * as spec from '@galacean/effects-specification';
3
- import type { GPUCapabilityDetail, SharedShaderWithSource } from '../../render';
3
+ import type { GPUCapabilityDetail } from '../../render';
4
4
  import type { Transform } from '../../transform';
5
- import type { ItemRenderInfo } from '../../components';
6
5
  export type SpriteRenderData = {
7
6
  life: number;
8
7
  transform: Transform;
@@ -21,10 +20,4 @@ export type SpriteRegionData = {
21
20
  };
22
21
  export declare let maxSpriteMeshItemCount: number;
23
22
  export declare function setSpriteMeshMaxItemCountByGPU(gpuCapability: GPUCapabilityDetail): 16 | 32 | undefined;
24
- export declare function spriteMeshShaderFromFilter(level: number, options?: {
25
- wireframe?: boolean;
26
- env?: string;
27
- }): SharedShaderWithSource;
28
- export declare function spriteMeshShaderIdFromRenderInfo(renderInfo: ItemRenderInfo, count: number): string;
29
- export declare function spriteMeshShaderFromRenderInfo(renderInfo: ItemRenderInfo, count: number, level: number, env?: string): SharedShaderWithSource;
30
23
  export declare function setMaxSpriteMeshItemCount(count: number): void;
@@ -19,32 +19,6 @@ export declare enum GLSLVersion {
19
19
  'GLSL1' = "100",
20
20
  'GLSL3' = "300 es"
21
21
  }
22
- export interface InstancedShaderWithSource {
23
- /**
24
- * fragment shader字符串
25
- */
26
- fragment: string;
27
- /**
28
- * vertex shader字符串
29
- */
30
- vertex: string;
31
- /**
32
- * shader 字符串的版本,用于添加版本头
33
- */
34
- glslVersion?: GLSLVersion;
35
- /**
36
- * shader的name
37
- */
38
- name?: string;
39
- /**
40
- * shader的宏定义
41
- */
42
- macros?: ShaderMacros;
43
- /**
44
- * shader是否共享
45
- */
46
- shared?: boolean;
47
- }
48
22
  export interface SharedShaderWithSource {
49
23
  /**
50
24
  * fragment shader字符串
@@ -78,7 +52,7 @@ export interface SharedShaderWithSource {
78
52
  */
79
53
  cacheId?: string;
80
54
  }
81
- export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
55
+ export type ShaderWithSource = SharedShaderWithSource;
82
56
  export declare abstract class ShaderVariant extends EffectsObject {
83
57
  readonly source: ShaderWithSource;
84
58
  shader: Shader;
@@ -2,7 +2,7 @@ import { Vector3 } from '@galacean/effects-math/es/core/vector3';
2
2
  import * as spec from '@galacean/effects-specification';
3
3
  import type { Component } from './components';
4
4
  import { RendererComponent } from './components';
5
- import type { Composition } from './composition';
5
+ import { type Composition } from './composition';
6
6
  import { EffectsObject } from './effects-object';
7
7
  import type { Engine } from './engine';
8
8
  import type { EventEmitterListener, EventEmitterOptions, ItemEvent } from './events';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.4.0-alpha.0",
3
+ "version": "2.4.0-beta.0",
4
4
  "description": "Galacean Effects runtime core for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "registry": "https://registry.npmjs.org"
43
43
  },
44
44
  "dependencies": {
45
- "@galacean/effects-specification": "2.3.0-alpha.0",
45
+ "@galacean/effects-specification": "2.3.0",
46
46
  "@galacean/effects-math": "1.1.0",
47
47
  "flatbuffers": "24.3.25",
48
48
  "uuid": "9.0.1",
@@ -1,36 +0,0 @@
1
- import * as spec from '@galacean/effects-specification';
2
- import type { SceneBindingData } from './comp-vfx-item';
3
- import type { Engine } from './engine';
4
- import type { Scene, SceneRenderLevel } from './scene';
5
- import type { Texture } from './texture';
6
- import type { Disposable } from './utils';
7
- export interface ContentOptions {
8
- id: string;
9
- duration: number;
10
- name: string;
11
- endBehavior: spec.EndBehavior;
12
- items: spec.DataPath[];
13
- camera: spec.CameraOptions;
14
- startTime: number;
15
- timelineAsset: spec.DataPath;
16
- sceneBindings: SceneBindingData[];
17
- }
18
- /**
19
- * 合成资源管理
20
- */
21
- export declare class CompositionSourceManager implements Disposable {
22
- engine: Engine;
23
- sourceContent?: spec.CompositionData;
24
- renderLevel?: SceneRenderLevel;
25
- imgUsage: Record<string, number>;
26
- textures: Texture[];
27
- jsonScene?: spec.JSONScene;
28
- mask: number;
29
- constructor(scene: Scene, engine: Engine);
30
- private getContent;
31
- private assembleItems;
32
- private preProcessItemContent;
33
- private changeTex;
34
- private addTextureUsage;
35
- dispose(): void;
36
- }