@galacean/engine-core 2.0.0-alpha.25 → 2.0.0-alpha.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "2.0.0-alpha.25",
3
+ "version": "2.0.0-alpha.27",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -18,10 +18,10 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-math": "2.0.0-alpha.25"
21
+ "@galacean/engine-math": "2.0.0-alpha.27"
22
22
  },
23
23
  "devDependencies": {
24
- "@galacean/engine-design": "2.0.0-alpha.25"
24
+ "@galacean/engine-design": "2.0.0-alpha.27"
25
25
  },
26
26
  "scripts": {
27
27
  "b:types": "tsc"
@@ -7,6 +7,7 @@ import { MainModule } from "./modules/MainModule";
7
7
  import { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
8
8
  import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
9
9
  import { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
10
+ import { NoiseModule } from "./modules/NoiseModule";
10
11
  import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
11
12
  /**
12
13
  * Particle Generator.
@@ -44,6 +45,8 @@ export declare class ParticleGenerator {
44
45
  readonly colorOverLifetime: ColorOverLifetimeModule;
45
46
  /** Texture sheet animation module. */
46
47
  readonly textureSheetAnimation: TextureSheetAnimationModule;
48
+ /** Noise module. */
49
+ readonly noise: NoiseModule;
47
50
  private _isPlaying;
48
51
  private _instanceBufferResized;
49
52
  private _waitProcessRetiredElementCount;
@@ -20,4 +20,5 @@ export { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
20
20
  export { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
21
21
  export { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
22
22
  export { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
23
+ export { NoiseModule } from "./modules/NoiseModule";
23
24
  export * from "./modules/shape/index";
@@ -0,0 +1,90 @@
1
+ import { ShaderMacro, ShaderProperty } from "../../shader";
2
+ import { ParticleGenerator } from "../ParticleGenerator";
3
+ import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
4
+ import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
5
+ /**
6
+ * Noise module for particle system.
7
+ * Adds simplex noise-based turbulence displacement to particles.
8
+ */
9
+ export declare class NoiseModule extends ParticleGeneratorModule {
10
+ static readonly _enabledMacro: ShaderMacro;
11
+ static readonly _strengthCurveMacro: ShaderMacro;
12
+ static readonly _strengthIsRandomTwoMacro: ShaderMacro;
13
+ static readonly _separateAxesMacro: ShaderMacro;
14
+ static readonly _noiseProperty: ShaderProperty;
15
+ static readonly _noiseOctaveProperty: ShaderProperty;
16
+ static readonly _strengthMinConstProperty: ShaderProperty;
17
+ static readonly _strengthMaxCurveXProperty: ShaderProperty;
18
+ static readonly _strengthMaxCurveYProperty: ShaderProperty;
19
+ static readonly _strengthMaxCurveZProperty: ShaderProperty;
20
+ static readonly _strengthMinCurveXProperty: ShaderProperty;
21
+ static readonly _strengthMinCurveYProperty: ShaderProperty;
22
+ static readonly _strengthMinCurveZProperty: ShaderProperty;
23
+ private _enabledModuleMacro;
24
+ private _strengthCurveModeMacro;
25
+ private _strengthIsRandomTwoModeMacro;
26
+ private _separateAxesModeMacro;
27
+ private _noiseParams;
28
+ private _noiseOctaveParams;
29
+ private _strengthMinConst;
30
+ private _strengthX;
31
+ private _strengthY;
32
+ private _strengthZ;
33
+ private _scrollSpeed;
34
+ private _separateAxes;
35
+ private _frequency;
36
+ private _octaveCount;
37
+ private _octaveIntensityMultiplier;
38
+ private _octaveFrequencyMultiplier;
39
+ /**
40
+ * Specifies whether the strength is separate on each axis, when disabled, only `strength` is used.
41
+ */
42
+ get separateAxes(): boolean;
43
+ set separateAxes(value: boolean);
44
+ /**
45
+ * Noise strength. When `separateAxes` is disabled, applies to all axes.
46
+ * When `separateAxes` is enabled, applies only to x axis.
47
+ */
48
+ get strengthX(): ParticleCompositeCurve;
49
+ set strengthX(value: ParticleCompositeCurve);
50
+ /**
51
+ * Noise strength for y axis, used when `separateAxes` is enabled.
52
+ */
53
+ get strengthY(): ParticleCompositeCurve;
54
+ set strengthY(value: ParticleCompositeCurve);
55
+ /**
56
+ * Noise strength for z axis, used when `separateAxes` is enabled.
57
+ */
58
+ get strengthZ(): ParticleCompositeCurve;
59
+ set strengthZ(value: ParticleCompositeCurve);
60
+ /**
61
+ * Noise spatial frequency.
62
+ */
63
+ get frequency(): number;
64
+ set frequency(value: number);
65
+ /**
66
+ * Noise field scroll speed over time.
67
+ */
68
+ get scrollSpeed(): number;
69
+ set scrollSpeed(value: number);
70
+ /**
71
+ * Number of noise octave layers (1-3).
72
+ */
73
+ get octaveCount(): number;
74
+ set octaveCount(value: number);
75
+ /**
76
+ * Intensity multiplier for each successive octave, only effective when `octaveCount` > 1.
77
+ * Each layer's contribution is scaled by this factor relative to the previous layer, range [0, 1].
78
+ */
79
+ get octaveIntensityMultiplier(): number;
80
+ set octaveIntensityMultiplier(value: number);
81
+ /**
82
+ * Frequency multiplier for each successive octave, only effective when `octaveCount` > 1.
83
+ * Each layer samples at this multiple of the previous layer's frequency, range [1, 4].
84
+ */
85
+ get octaveFrequencyMultiplier(): number;
86
+ set octaveFrequencyMultiplier(value: number);
87
+ get enabled(): boolean;
88
+ set enabled(value: boolean);
89
+ constructor(generator: ParticleGenerator);
90
+ }
@@ -61,6 +61,8 @@ export declare class Shader implements IReferable {
61
61
  * @param name - Name of the shader
62
62
  */
63
63
  static find(name: string): Shader;
64
+ private static _resolveUsePass;
65
+ private static _applyRenderStates;
64
66
  private static _applyConstRenderStates;
65
67
  private _refCount;
66
68
  private _destroyed;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,14 @@
1
+ import type { ShaderInstruction } from "@galacean/engine-design";
1
2
  import { ShaderPart } from "./ShaderPart";
3
+ import { ShaderLanguage } from "./enums/ShaderLanguage";
2
4
  /**
3
5
  * Shader pass containing vertex and fragment source.
4
6
  */
5
7
  export declare class ShaderPass extends ShaderPart {
6
- private _vertexSource;
7
- private _fragmentSource;
8
+ private _vertexSource?;
9
+ private _fragmentSource?;
10
+ private static _shaderMacroList;
11
+ private static _macroMap;
8
12
  /**
9
13
  * Create a shader pass.
10
14
  * @param name - Shader pass name
@@ -20,6 +24,16 @@ export declare class ShaderPass extends ShaderPart {
20
24
  * @param tags - Tags
21
25
  */
22
26
  constructor(vertexSource: string, fragmentSource: string, tags?: Record<string, number | string | boolean>);
27
+ /**
28
+ * Create a shader pass from precompiled instructions.
29
+ * @param name - Shader pass name
30
+ * @param vertexShaderInstructions - Precompiled vertex instruction array
31
+ * @param fragmentShaderInstructions - Precompiled fragment instruction array
32
+ * @param platformTarget - Target shader language
33
+ * @param tags - Tags
34
+ */
35
+ constructor(name: string, vertexShaderInstructions: ShaderInstruction[], fragmentShaderInstructions: ShaderInstruction[], platformTarget: ShaderLanguage, tags?: Record<string, number | string | boolean>);
23
36
  private _getCanonicalShaderProgram;
24
- private _getShaderLabProgram;
37
+ private _compilePlatformSource;
38
+ private _compileShaderLabSource;
25
39
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Directive types for shader preprocessor instructions.
3
+ */
4
+ export declare enum ShaderPreprocessorDirective {
5
+ Text = 0,
6
+ IfDef = 1,
7
+ IfNdef = 2,
8
+ IfCmp = 3,
9
+ IfExpr = 4,
10
+ Else = 5,
11
+ Endif = 6,
12
+ Define = 7,
13
+ DefineVal = 8,
14
+ DefineFunc = 9,
15
+ Undef = 10
16
+ }
@@ -7,6 +7,7 @@ export declare const ShaderLib: {
7
7
  texture_sheet_animation_module: string;
8
8
  force_over_lifetime_module: string;
9
9
  limit_velocity_over_lifetime_module: string;
10
+ noise_module: string;
10
11
  particle_feedback_simulation: string;
11
12
  sphere_billboard: string;
12
13
  stretched_billboard: string;
@@ -57,19 +58,5 @@ export declare const ShaderLib: {
57
58
  begin_viewdir_frag: string;
58
59
  mobile_blinnphong_frag: string;
59
60
  noise_common: string;
60
- noise_cellular_2D: string;
61
- noise_cellular_2x2: string;
62
- noise_cellular_2x2x2: string;
63
- noise_cellular_3D: string;
64
- noise_cellular: string;
65
- noise_perlin_2D: string;
66
- noise_perlin_3D: string;
67
- noise_perlin_4D: string;
68
- noise_perlin: string;
69
- noise_psrd_2D: string;
70
- noise_simplex_2D: string;
71
61
  noise_simplex_3D_grad: string;
72
- noise_simplex_3D: string;
73
- noise_simplex_4D: string;
74
- noise_simplex: string;
75
62
  };
@@ -7,6 +7,7 @@ declare const _default: {
7
7
  texture_sheet_animation_module: string;
8
8
  force_over_lifetime_module: string;
9
9
  limit_velocity_over_lifetime_module: string;
10
+ noise_module: string;
10
11
  particle_feedback_simulation: string;
11
12
  sphere_billboard: string;
12
13
  stretched_billboard: string;