sparcoon 0.5.0 → 0.6.1
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/README.md +6 -6
- package/dist/emitter/FXEmitter.Internal.d.ts +50 -2
- package/dist/emitter/FXEmitter.Internal.js +1 -2
- package/dist/emitter/FXEmitter.d.ts +48 -1
- package/dist/emitter/FXEmitter.js +74 -11
- package/dist/emitter/behavior/FXBehavior.d.ts +12 -2
- package/dist/emitter/behavior/FXBehavior.js +3 -2
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.d.ts +25 -0
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.js +74 -0
- package/dist/emitter/behavior/FXBehaviorPointForce.d.ts +40 -0
- package/dist/emitter/behavior/FXBehaviorPointForce.js +98 -0
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.d.ts +9 -8
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.js +12 -29
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.d.ts +4 -3
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.js +3 -2
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.d.ts +4 -3
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.js +3 -2
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.d.ts +17 -0
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.js +34 -0
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.d.ts +3 -2
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.js +3 -2
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.d.ts +6 -5
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.js +6 -5
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.d.ts +20 -0
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.js +48 -0
- package/dist/emitter/spawn/FXSpawn.d.ts +4 -2
- package/dist/emitter/spawn/FXSpawn.js +3 -2
- package/dist/emitter/spawn/FXSpawnBox.d.ts +8 -16
- package/dist/emitter/spawn/FXSpawnBox.js +23 -39
- package/dist/emitter/spawn/{FXSpawnRandomLifetime.d.ts → FXSpawnLifetime.d.ts} +3 -5
- package/dist/emitter/spawn/{FXSpawnRandomLifetime.js → FXSpawnLifetime.js} +8 -10
- package/dist/emitter/spawn/FXSpawnOffset.d.ts +9 -0
- package/dist/emitter/spawn/FXSpawnOffset.js +9 -0
- package/dist/emitter/spawn/FXSpawnPoint.d.ts +8 -0
- package/dist/emitter/spawn/FXSpawnPoint.js +8 -0
- package/dist/emitter/spawn/{FXSpawnRandomRotation.d.ts → FXSpawnRotation.d.ts} +3 -5
- package/dist/emitter/spawn/{FXSpawnRandomRotation.js → FXSpawnRotation.js} +8 -10
- package/dist/emitter/spawn/{FXSpawnRandomScale.d.ts → FXSpawnScale.d.ts} +4 -6
- package/dist/emitter/spawn/{FXSpawnRandomScale.js → FXSpawnScale.js} +12 -14
- package/dist/emitter/spawn/FXSpawnSphere.d.ts +11 -6
- package/dist/emitter/spawn/FXSpawnSphere.js +11 -6
- package/dist/emitter/spawn/{FXSpawnRandomTorque.d.ts → FXSpawnTorque.d.ts} +3 -5
- package/dist/emitter/spawn/{FXSpawnRandomTorque.js → FXSpawnTorque.js} +8 -10
- package/dist/emitter/spawn/FXSpawnVelocity.d.ts +32 -0
- package/dist/emitter/spawn/{FXSpawnRandomVelocity.js → FXSpawnVelocity.js} +26 -11
- package/dist/index.d.ts +23 -16
- package/dist/index.js +20 -16
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.d.ts +4 -4
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.js +2 -2
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.d.ts +55 -5
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.js +9 -2
- package/dist/materials/FXMaterial/FXDepthMaterial.Internal.d.ts +3 -3
- package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.d.ts +3 -3
- package/dist/materials/FXMaterial/FXMaterial.d.ts +51 -5
- package/dist/materials/FXMaterial/FXMaterial.js +5 -0
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.d.ts +3 -3
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.d.ts +3 -3
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.js +3 -3
- package/dist/miscellaneous/curve/FXCurve1D.Internal.d.ts +20 -0
- package/dist/miscellaneous/curve/FXCurve1D.d.ts +17 -0
- package/dist/miscellaneous/curve/FXCurve1D.js +94 -0
- package/dist/miscellaneous/miscellaneous.d.ts +3 -1
- package/dist/miscellaneous/miscellaneous.js +8 -4
- package/dist/miscellaneous/texture/FXTextureView.Internal.js +6 -0
- package/dist/miscellaneous/texture/FXTextureView.js +234 -0
- package/dist/nodes/color/FXNodeColor.d.ts +7 -0
- package/dist/nodes/color/FXNodeColor.js +11 -0
- package/dist/nodes/color/FXNodeColorOverLife.d.ts +25 -0
- package/dist/nodes/color/FXNodeColorOverLife.js +60 -0
- package/dist/nodes/color/FXNodeSphericalClip.d.ts +18 -0
- package/dist/nodes/color/FXNodeSphericalClip.js +45 -0
- package/dist/nodes/normal/FXNodeFlatNormal.d.ts +7 -0
- package/dist/nodes/normal/FXNodeFlatNormal.js +17 -0
- package/dist/nodes/normal/FXNodeNormal.d.ts +7 -0
- package/dist/nodes/normal/FXNodeNormal.js +7 -0
- package/dist/nodes/normal/FXNodeSphericalNormal.d.ts +7 -0
- package/dist/nodes/normal/{FXSphericalNormalNode.js → FXNodeSphericalNormal.js} +7 -4
- package/dist/nodes/texture/FXNodeAnimatedTexture.d.ts +47 -0
- package/dist/nodes/texture/FXNodeAnimatedTexture.js +137 -0
- package/dist/nodes/texture/FXNodeStaticTexture.d.ts +18 -0
- package/dist/nodes/texture/FXNodeStaticTexture.js +60 -0
- package/dist/nodes/texture/FXNodeTexture.d.ts +7 -0
- package/dist/nodes/texture/FXNodeTexture.js +11 -0
- package/package.json +2 -4
- package/dist/emitter/behavior/FXBehaviorDirectionalGravity.d.ts +0 -21
- package/dist/emitter/behavior/FXBehaviorDirectionalGravity.js +0 -51
- package/dist/emitter/behavior/FXBehaviorPointGravity.d.ts +0 -39
- package/dist/emitter/behavior/FXBehaviorPointGravity.js +0 -116
- package/dist/emitter/spawn/FXSpawnRandomVelocity.d.ts +0 -17
- package/dist/nodes/color/FXColorNode.d.ts +0 -3
- package/dist/nodes/color/FXColorNode.js +0 -8
- package/dist/nodes/color/FXColorOverLifeNode.d.ts +0 -6
- package/dist/nodes/color/FXColorOverLifeNode.js +0 -44
- package/dist/nodes/color/FXSphericalClipNode.d.ts +0 -5
- package/dist/nodes/color/FXSphericalClipNode.js +0 -30
- package/dist/nodes/normal/FXFlatNormalNode.d.ts +0 -4
- package/dist/nodes/normal/FXFlatNormalNode.js +0 -14
- package/dist/nodes/normal/FXNormalNode.d.ts +0 -3
- package/dist/nodes/normal/FXNormalNode.js +0 -4
- package/dist/nodes/normal/FXSphericalNormalNode.d.ts +0 -4
- package/dist/nodes/texture/FXAnimatedTextureNode.d.ts +0 -12
- package/dist/nodes/texture/FXAnimatedTextureNode.js +0 -88
- package/dist/nodes/texture/FXStaticTextureNode.d.ts +0 -6
- package/dist/nodes/texture/FXStaticTextureNode.js +0 -34
- package/dist/nodes/texture/FXTextureNode.d.ts +0 -3
- package/dist/nodes/texture/FXTextureNode.js +0 -8
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { Vector3Like } from "../../miscellaneous/math";
|
|
2
2
|
import type { FXVector3Config } from "../../miscellaneous/miscellaneous";
|
|
3
3
|
import { FXSpawn } from "./FXSpawn";
|
|
4
|
+
/**
|
|
5
|
+
* Spawns all particles at a single fixed position
|
|
6
|
+
*/
|
|
4
7
|
export declare class FXSpawnPoint extends FXSpawn<{
|
|
5
8
|
builtin: "Matrix4";
|
|
6
9
|
}> {
|
|
7
10
|
private positionInternal;
|
|
11
|
+
/**
|
|
12
|
+
* @param position - World-space spawn position. Defaults to `{ x: 0, y: 0, z: 0 }`
|
|
13
|
+
*/
|
|
8
14
|
constructor(position?: FXVector3Config);
|
|
15
|
+
/** Spawn position */
|
|
9
16
|
get position(): Vector3Like;
|
|
17
|
+
/** Spawn position */
|
|
10
18
|
set position(value: FXVector3Config);
|
|
11
19
|
}
|
|
@@ -2,7 +2,13 @@ import { assertValidNumber } from '../../miscellaneous/asserts.js';
|
|
|
2
2
|
import { resolveFXVector3Config, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_Z } from '../../miscellaneous/miscellaneous.js';
|
|
3
3
|
import { FXSpawn } from './FXSpawn.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Spawns all particles at a single fixed position
|
|
7
|
+
*/
|
|
5
8
|
class FXSpawnPoint extends FXSpawn {
|
|
9
|
+
/**
|
|
10
|
+
* @param position - World-space spawn position. Defaults to `{ x: 0, y: 0, z: 0 }`
|
|
11
|
+
*/
|
|
6
12
|
constructor(position = { x: 0, y: 0, z: 0 }) {
|
|
7
13
|
super();
|
|
8
14
|
/** @internal */
|
|
@@ -12,9 +18,11 @@ class FXSpawnPoint extends FXSpawn {
|
|
|
12
18
|
assertValidNumber(this._private_positionInternal.y, "FXSpawnPoint.constructor.position.y");
|
|
13
19
|
assertValidNumber(this._private_positionInternal.z, "FXSpawnPoint.constructor.position.z");
|
|
14
20
|
}
|
|
21
|
+
/** Spawn position */
|
|
15
22
|
get position() {
|
|
16
23
|
return this._private_positionInternal;
|
|
17
24
|
}
|
|
25
|
+
/** Spawn position */
|
|
18
26
|
set position(value) {
|
|
19
27
|
this._private_positionInternal = resolveFXVector3Config(value);
|
|
20
28
|
assertValidNumber(this._private_positionInternal.x, "FXSpawnPoint.position.x");
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
|
|
2
2
|
import { FXSpawn } from "./FXSpawn";
|
|
3
3
|
/**
|
|
4
|
-
* Assigns random rotation to
|
|
5
|
-
*
|
|
6
|
-
* Initial rotation is chosen uniformly from the specified range.
|
|
4
|
+
* Assigns a random initial rotation to each spawned particle
|
|
7
5
|
*/
|
|
8
|
-
export declare class
|
|
6
|
+
export declare class FXSpawnRotation extends FXSpawn<{
|
|
9
7
|
builtin: "Matrix4";
|
|
10
8
|
}> {
|
|
11
9
|
private rotationInternal;
|
|
12
10
|
/**
|
|
13
|
-
* @param rotation - Rotation range in radians.
|
|
11
|
+
* @param rotation - Rotation range in radians. Defaults to `{ min: -Math.PI, max: Math.PI }`
|
|
14
12
|
*/
|
|
15
13
|
constructor(rotation?: FXRangeConfig);
|
|
16
14
|
/** Rotation range in radians */
|
|
@@ -4,21 +4,19 @@ import { resolveFXRangeConfig, BUILTIN_OFFSET_ROTATION } from '../../miscellaneo
|
|
|
4
4
|
import { FXSpawn } from './FXSpawn.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Assigns random rotation to
|
|
8
|
-
*
|
|
9
|
-
* Initial rotation is chosen uniformly from the specified range.
|
|
7
|
+
* Assigns a random initial rotation to each spawned particle
|
|
10
8
|
*/
|
|
11
|
-
class
|
|
9
|
+
class FXSpawnRotation extends FXSpawn {
|
|
12
10
|
/**
|
|
13
|
-
* @param rotation - Rotation range in radians.
|
|
11
|
+
* @param rotation - Rotation range in radians. Defaults to `{ min: -Math.PI, max: Math.PI }`
|
|
14
12
|
*/
|
|
15
13
|
constructor(rotation = { min: -Math.PI, max: Math.PI }) {
|
|
16
14
|
super();
|
|
17
15
|
/** @internal */
|
|
18
16
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
17
|
this._private_rotationInternal = resolveFXRangeConfig(rotation);
|
|
20
|
-
assertValidNumber(this._private_rotationInternal.min, "
|
|
21
|
-
assertValidNumber(this._private_rotationInternal.max, "
|
|
18
|
+
assertValidNumber(this._private_rotationInternal.min, "FXSpawnRotation.constructor.rotation.min");
|
|
19
|
+
assertValidNumber(this._private_rotationInternal.max, "FXSpawnRotation.constructor.rotation.max");
|
|
22
20
|
}
|
|
23
21
|
/** Rotation range in radians */
|
|
24
22
|
get rotation() {
|
|
@@ -27,8 +25,8 @@ class FXSpawnRandomRotation extends FXSpawn {
|
|
|
27
25
|
/** Rotation range in radians */
|
|
28
26
|
set rotation(value) {
|
|
29
27
|
this._private_rotationInternal = resolveFXRangeConfig(value);
|
|
30
|
-
assertValidNumber(this._private_rotationInternal.min, "
|
|
31
|
-
assertValidNumber(this._private_rotationInternal.max, "
|
|
28
|
+
assertValidNumber(this._private_rotationInternal.min, "FXSpawnRotation.rotation.min");
|
|
29
|
+
assertValidNumber(this._private_rotationInternal.max, "FXSpawnRotation.rotation.max");
|
|
32
30
|
}
|
|
33
31
|
/** @internal */
|
|
34
32
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
@@ -42,4 +40,4 @@ class FXSpawnRandomRotation extends FXSpawn {
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
export {
|
|
43
|
+
export { FXSpawnRotation };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import type { FXAspectConfig, FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
|
|
2
2
|
import { FXSpawn } from "./FXSpawn";
|
|
3
3
|
/**
|
|
4
|
-
* Assigns random scale to
|
|
5
|
-
*
|
|
6
|
-
* Base scale is chosen uniformly from the range. Aspect ratio is applied to X scale.
|
|
4
|
+
* Assigns a random initial scale to each spawned particle
|
|
7
5
|
*/
|
|
8
|
-
export declare class
|
|
6
|
+
export declare class FXSpawnScale extends FXSpawn<{
|
|
9
7
|
builtin: "Matrix4";
|
|
10
8
|
}> {
|
|
11
9
|
private scaleInternal;
|
|
12
10
|
private aspectInternal;
|
|
13
11
|
/**
|
|
14
|
-
* @param scale - Base scale range.
|
|
15
|
-
* @param aspect - Width/height ratio.
|
|
12
|
+
* @param scale - Base scale range; must be positive. Defaults to `{ min: 1, max: 2 }`
|
|
13
|
+
* @param aspect - Width/height ratio; must be positive. Defaults to `1`
|
|
16
14
|
*/
|
|
17
15
|
constructor(scale?: FXRangeConfig, aspect?: FXAspectConfig);
|
|
18
16
|
/** Base scale range */
|
|
@@ -4,24 +4,22 @@ import { resolveFXRangeConfig, resolveAspect, BUILTIN_OFFSET_SCALE_X, BUILTIN_OF
|
|
|
4
4
|
import { FXSpawn } from './FXSpawn.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Assigns random scale to
|
|
8
|
-
*
|
|
9
|
-
* Base scale is chosen uniformly from the range. Aspect ratio is applied to X scale.
|
|
7
|
+
* Assigns a random initial scale to each spawned particle
|
|
10
8
|
*/
|
|
11
|
-
class
|
|
9
|
+
class FXSpawnScale extends FXSpawn {
|
|
12
10
|
/**
|
|
13
|
-
* @param scale - Base scale range.
|
|
14
|
-
* @param aspect - Width/height ratio.
|
|
11
|
+
* @param scale - Base scale range; must be positive. Defaults to `{ min: 1, max: 2 }`
|
|
12
|
+
* @param aspect - Width/height ratio; must be positive. Defaults to `1`
|
|
15
13
|
*/
|
|
16
|
-
constructor(scale = { min:
|
|
14
|
+
constructor(scale = { min: 1, max: 2 }, aspect = 1) {
|
|
17
15
|
super();
|
|
18
16
|
/** @internal */
|
|
19
17
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
18
|
this._private_scaleInternal = resolveFXRangeConfig(scale);
|
|
21
19
|
this._private_aspectInternal = resolveAspect(aspect);
|
|
22
|
-
assertValidPositiveNumber(this._private_scaleInternal.min, "
|
|
23
|
-
assertValidPositiveNumber(this._private_scaleInternal.max, "
|
|
24
|
-
assertValidPositiveNumber(this._private_aspectInternal, "
|
|
20
|
+
assertValidPositiveNumber(this._private_scaleInternal.min, "FXSpawnScale.constructor.scale.min");
|
|
21
|
+
assertValidPositiveNumber(this._private_scaleInternal.max, "FXSpawnScale.constructor.scale.max");
|
|
22
|
+
assertValidPositiveNumber(this._private_aspectInternal, "FXSpawnScale.constructor.aspect");
|
|
25
23
|
}
|
|
26
24
|
/** Base scale range */
|
|
27
25
|
get scale() {
|
|
@@ -34,13 +32,13 @@ class FXSpawnRandomScale extends FXSpawn {
|
|
|
34
32
|
/** Base scale range */
|
|
35
33
|
set scale(value) {
|
|
36
34
|
this._private_scaleInternal = resolveFXRangeConfig(value);
|
|
37
|
-
assertValidPositiveNumber(this._private_scaleInternal.min, "
|
|
38
|
-
assertValidPositiveNumber(this._private_scaleInternal.max, "
|
|
35
|
+
assertValidPositiveNumber(this._private_scaleInternal.min, "FXSpawnScale.scale.min");
|
|
36
|
+
assertValidPositiveNumber(this._private_scaleInternal.max, "FXSpawnScale.scale.max");
|
|
39
37
|
}
|
|
40
38
|
/** Width/height aspect ratio */
|
|
41
39
|
set aspect(value) {
|
|
42
40
|
this._private_aspectInternal = resolveAspect(value);
|
|
43
|
-
assertValidPositiveNumber(this._private_aspectInternal, "
|
|
41
|
+
assertValidPositiveNumber(this._private_aspectInternal, "FXSpawnScale.aspect");
|
|
44
42
|
}
|
|
45
43
|
/** @internal */
|
|
46
44
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
@@ -57,4 +55,4 @@ class FXSpawnRandomScale extends FXSpawn {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
export {
|
|
58
|
+
export { FXSpawnScale };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { FXSpawn } from "./FXSpawn";
|
|
2
2
|
/**
|
|
3
|
-
* Spawns particles at random positions within a spherical shell
|
|
3
|
+
* Spawns particles at random positions within a spherical shell
|
|
4
4
|
*
|
|
5
|
+
* @remarks
|
|
5
6
|
* The `angle` parameter controls the polar spread from the equatorial plane:
|
|
6
7
|
* - `0` - flat disk (XZ plane only)
|
|
7
8
|
* - `Math.PI / 2` - full sphere
|
|
8
|
-
* - Values in between produce a spherical band
|
|
9
|
+
* - Values in between produce a spherical band
|
|
9
10
|
*/
|
|
10
11
|
export declare class FXSpawnSphere extends FXSpawn<{
|
|
11
12
|
builtin: "Matrix4";
|
|
@@ -14,9 +15,9 @@ export declare class FXSpawnSphere extends FXSpawn<{
|
|
|
14
15
|
private outerRadiusInternal;
|
|
15
16
|
private angleInternal;
|
|
16
17
|
/**
|
|
17
|
-
* @param innerRadius - Minimum spawn radius
|
|
18
|
-
* @param outerRadius - Maximum spawn radius
|
|
19
|
-
* @param angle - Polar half-angle from equatorial plane
|
|
18
|
+
* @param innerRadius - Minimum spawn radius; must be non-negative. Defaults to `0`
|
|
19
|
+
* @param outerRadius - Maximum spawn radius; must be non-negative. Defaults to `1`
|
|
20
|
+
* @param angle - Polar half-angle from equatorial plane in radians. Defaults to `Math.PI / 2`
|
|
20
21
|
*/
|
|
21
22
|
constructor(innerRadius?: number, outerRadius?: number, angle?: number);
|
|
22
23
|
/**
|
|
@@ -33,6 +34,10 @@ export declare class FXSpawnSphere extends FXSpawn<{
|
|
|
33
34
|
set innerRadius(value: number);
|
|
34
35
|
/** Maximum spawn radius */
|
|
35
36
|
set outerRadius(value: number);
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Polar half-angle from the equatorial plane.
|
|
39
|
+
* - `0` - flat disk
|
|
40
|
+
* - `Math.PI / 2` - full sphere
|
|
41
|
+
*/
|
|
37
42
|
set angle(value: number);
|
|
38
43
|
}
|
|
@@ -4,18 +4,19 @@ import { BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_PO
|
|
|
4
4
|
import { FXSpawn } from './FXSpawn.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Spawns particles at random positions within a spherical shell
|
|
7
|
+
* Spawns particles at random positions within a spherical shell
|
|
8
8
|
*
|
|
9
|
+
* @remarks
|
|
9
10
|
* The `angle` parameter controls the polar spread from the equatorial plane:
|
|
10
11
|
* - `0` - flat disk (XZ plane only)
|
|
11
12
|
* - `Math.PI / 2` - full sphere
|
|
12
|
-
* - Values in between produce a spherical band
|
|
13
|
+
* - Values in between produce a spherical band
|
|
13
14
|
*/
|
|
14
15
|
class FXSpawnSphere extends FXSpawn {
|
|
15
16
|
/**
|
|
16
|
-
* @param innerRadius - Minimum spawn radius
|
|
17
|
-
* @param outerRadius - Maximum spawn radius
|
|
18
|
-
* @param angle - Polar half-angle from equatorial plane
|
|
17
|
+
* @param innerRadius - Minimum spawn radius; must be non-negative. Defaults to `0`
|
|
18
|
+
* @param outerRadius - Maximum spawn radius; must be non-negative. Defaults to `1`
|
|
19
|
+
* @param angle - Polar half-angle from equatorial plane in radians. Defaults to `Math.PI / 2`
|
|
19
20
|
*/
|
|
20
21
|
constructor(innerRadius = 0, outerRadius = 1, angle = Math.PI / 2) {
|
|
21
22
|
super();
|
|
@@ -54,7 +55,11 @@ class FXSpawnSphere extends FXSpawn {
|
|
|
54
55
|
assertValidNonNegativeNumber(value, "FXSpawnSphere.outerRadius");
|
|
55
56
|
this._private_outerRadiusInternal = value;
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Polar half-angle from the equatorial plane.
|
|
60
|
+
* - `0` - flat disk
|
|
61
|
+
* - `Math.PI / 2` - full sphere
|
|
62
|
+
*/
|
|
58
63
|
set angle(value) {
|
|
59
64
|
assertValidNumber(value, "FXSpawnSphere.angle");
|
|
60
65
|
this._private_angleInternal = value;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
|
|
2
2
|
import { FXSpawn } from "./FXSpawn";
|
|
3
3
|
/**
|
|
4
|
-
* Assigns random angular velocity to
|
|
5
|
-
*
|
|
6
|
-
* Torque (rotation speed) is chosen uniformly from the specified range.
|
|
4
|
+
* Assigns a random initial angular velocity to each spawned particle
|
|
7
5
|
*/
|
|
8
|
-
export declare class
|
|
6
|
+
export declare class FXSpawnTorque extends FXSpawn<{
|
|
9
7
|
builtin: "Matrix4";
|
|
10
8
|
}> {
|
|
11
9
|
private torqueInternal;
|
|
12
10
|
/**
|
|
13
|
-
* @param torque - Angular velocity range in radians/second.
|
|
11
|
+
* @param torque - Angular velocity range in radians/second. Defaults to `{ min: -Math.PI, max: Math.PI }`
|
|
14
12
|
*/
|
|
15
13
|
constructor(torque?: FXRangeConfig);
|
|
16
14
|
/** Angular velocity range in radians/second */
|
|
@@ -4,21 +4,19 @@ import { resolveFXRangeConfig, BUILTIN_OFFSET_TORQUE } from '../../miscellaneous
|
|
|
4
4
|
import { FXSpawn } from './FXSpawn.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Assigns random angular velocity to
|
|
8
|
-
*
|
|
9
|
-
* Torque (rotation speed) is chosen uniformly from the specified range.
|
|
7
|
+
* Assigns a random initial angular velocity to each spawned particle
|
|
10
8
|
*/
|
|
11
|
-
class
|
|
9
|
+
class FXSpawnTorque extends FXSpawn {
|
|
12
10
|
/**
|
|
13
|
-
* @param torque - Angular velocity range in radians/second.
|
|
11
|
+
* @param torque - Angular velocity range in radians/second. Defaults to `{ min: -Math.PI, max: Math.PI }`
|
|
14
12
|
*/
|
|
15
13
|
constructor(torque = { min: -Math.PI, max: Math.PI }) {
|
|
16
14
|
super();
|
|
17
15
|
/** @internal */
|
|
18
16
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
17
|
this._private_torqueInternal = resolveFXRangeConfig(torque);
|
|
20
|
-
assertValidNumber(this._private_torqueInternal.min, "
|
|
21
|
-
assertValidNumber(this._private_torqueInternal.max, "
|
|
18
|
+
assertValidNumber(this._private_torqueInternal.min, "FXSpawnTorque.constructor.torque.min");
|
|
19
|
+
assertValidNumber(this._private_torqueInternal.max, "FXSpawnTorque.constructor.torque.max");
|
|
22
20
|
}
|
|
23
21
|
/** Angular velocity range in radians/second */
|
|
24
22
|
get torque() {
|
|
@@ -27,8 +25,8 @@ class FXSpawnRandomTorque extends FXSpawn {
|
|
|
27
25
|
/** Angular velocity range in radians/second */
|
|
28
26
|
set torque(value) {
|
|
29
27
|
this._private_torqueInternal = resolveFXRangeConfig(value);
|
|
30
|
-
assertValidNumber(this._private_torqueInternal.min, "
|
|
31
|
-
assertValidNumber(this._private_torqueInternal.max, "
|
|
28
|
+
assertValidNumber(this._private_torqueInternal.min, "FXSpawnTorque.torque.min");
|
|
29
|
+
assertValidNumber(this._private_torqueInternal.max, "FXSpawnTorque.torque.max");
|
|
32
30
|
}
|
|
33
31
|
/** @internal */
|
|
34
32
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
@@ -42,4 +40,4 @@ class FXSpawnRandomTorque extends FXSpawn {
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
export {
|
|
43
|
+
export { FXSpawnTorque };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Vector3 } from "three";
|
|
2
|
+
import type { FXRange, FXRangeConfig } from "../../miscellaneous/miscellaneous";
|
|
3
|
+
import { FXSpawn } from "./FXSpawn";
|
|
4
|
+
/**
|
|
5
|
+
* Assigns a random initial velocity to each spawned particle within a cone around a direction axis
|
|
6
|
+
*/
|
|
7
|
+
export declare class FXSpawnVelocity extends FXSpawn<{
|
|
8
|
+
builtin: "Matrix4";
|
|
9
|
+
}> {
|
|
10
|
+
private angleInternal;
|
|
11
|
+
private magnitudeInternal;
|
|
12
|
+
private readonly directionInternal;
|
|
13
|
+
/**
|
|
14
|
+
* @param direction - Cone axis; normalized automatically. Defaults to `(0, 1, 0)`
|
|
15
|
+
* @param angle - Cone half-angle range in radians; `{ min: 0, max: 0 }` fires in a straight line.
|
|
16
|
+
* Defaults to `{ min: 0, max: Math.PI }`
|
|
17
|
+
* @param magnitude - Speed range in units/second. Defaults to `{ min: -1, max: 1 }`
|
|
18
|
+
*/
|
|
19
|
+
constructor(direction?: Vector3, angle?: FXRangeConfig, magnitude?: FXRangeConfig);
|
|
20
|
+
/** Cone half-angle range in radians */
|
|
21
|
+
get angle(): FXRange;
|
|
22
|
+
/** Speed range in units/second */
|
|
23
|
+
get magnitude(): FXRange;
|
|
24
|
+
/** Cone axis (always normalized) */
|
|
25
|
+
get direction(): Vector3;
|
|
26
|
+
/** Cone half-angle range in radians */
|
|
27
|
+
set angle(value: FXRangeConfig);
|
|
28
|
+
/** Speed range in units/second */
|
|
29
|
+
set magnitude(value: FXRangeConfig);
|
|
30
|
+
/** Cone axis - normalized on assignment */
|
|
31
|
+
set direction(value: Vector3);
|
|
32
|
+
}
|
|
@@ -6,38 +6,53 @@ import { FXSpawn } from './FXSpawn.js';
|
|
|
6
6
|
const TEMP_TANGENT = new Vector3();
|
|
7
7
|
const TEMP_BITANGENT = new Vector3();
|
|
8
8
|
const TEMP_VELOCITY = new Vector3();
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Assigns a random initial velocity to each spawned particle within a cone around a direction axis
|
|
11
|
+
*/
|
|
12
|
+
class FXSpawnVelocity extends FXSpawn {
|
|
13
|
+
/**
|
|
14
|
+
* @param direction - Cone axis; normalized automatically. Defaults to `(0, 1, 0)`
|
|
15
|
+
* @param angle - Cone half-angle range in radians; `{ min: 0, max: 0 }` fires in a straight line.
|
|
16
|
+
* Defaults to `{ min: 0, max: Math.PI }`
|
|
17
|
+
* @param magnitude - Speed range in units/second. Defaults to `{ min: -1, max: 1 }`
|
|
18
|
+
*/
|
|
19
|
+
constructor(direction = new Vector3(0, 1, 0), angle = { min: 0, max: Math.PI }, magnitude = { min: -1, max: 1 }) {
|
|
11
20
|
super();
|
|
12
21
|
/** @internal */
|
|
13
22
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
14
23
|
this._private_directionInternal = direction.clone().normalize();
|
|
15
24
|
this._private_angleInternal = resolveFXRangeConfig(angle);
|
|
16
25
|
this._private_magnitudeInternal = resolveFXRangeConfig(magnitude);
|
|
17
|
-
assertValidNumber(this._private_angleInternal.min, "
|
|
18
|
-
assertValidNumber(this._private_angleInternal.max, "
|
|
19
|
-
assertValidNumber(this._private_magnitudeInternal.min, "
|
|
20
|
-
assertValidNumber(this._private_magnitudeInternal.max, "
|
|
26
|
+
assertValidNumber(this._private_angleInternal.min, "FXSpawnVelocity.constructor.angle.min");
|
|
27
|
+
assertValidNumber(this._private_angleInternal.max, "FXSpawnVelocity.constructor.angle.max");
|
|
28
|
+
assertValidNumber(this._private_magnitudeInternal.min, "FXSpawnVelocity.constructor.magnitude.min");
|
|
29
|
+
assertValidNumber(this._private_magnitudeInternal.max, "FXSpawnVelocity.constructor.magnitude.max");
|
|
21
30
|
}
|
|
31
|
+
/** Cone half-angle range in radians */
|
|
22
32
|
get angle() {
|
|
23
33
|
return this._private_angleInternal;
|
|
24
34
|
}
|
|
35
|
+
/** Speed range in units/second */
|
|
25
36
|
get magnitude() {
|
|
26
37
|
return this._private_magnitudeInternal;
|
|
27
38
|
}
|
|
39
|
+
/** Cone axis (always normalized) */
|
|
28
40
|
get direction() {
|
|
29
41
|
return this._private_directionInternal;
|
|
30
42
|
}
|
|
43
|
+
/** Cone half-angle range in radians */
|
|
31
44
|
set angle(value) {
|
|
32
45
|
this._private_angleInternal = resolveFXRangeConfig(value);
|
|
33
|
-
assertValidNumber(this._private_angleInternal.min, "
|
|
34
|
-
assertValidNumber(this._private_angleInternal.max, "
|
|
46
|
+
assertValidNumber(this._private_angleInternal.min, "FXSpawnVelocity.angle.min");
|
|
47
|
+
assertValidNumber(this._private_angleInternal.max, "FXSpawnVelocity.angle.max");
|
|
35
48
|
}
|
|
49
|
+
/** Speed range in units/second */
|
|
36
50
|
set magnitude(value) {
|
|
37
51
|
this._private_magnitudeInternal = resolveFXRangeConfig(value);
|
|
38
|
-
assertValidNumber(this._private_magnitudeInternal.min, "
|
|
39
|
-
assertValidNumber(this._private_magnitudeInternal.max, "
|
|
52
|
+
assertValidNumber(this._private_magnitudeInternal.min, "FXSpawnVelocity.magnitude.min");
|
|
53
|
+
assertValidNumber(this._private_magnitudeInternal.max, "FXSpawnVelocity.magnitude.max");
|
|
40
54
|
}
|
|
55
|
+
/** Cone axis - normalized on assignment */
|
|
41
56
|
set direction(value) {
|
|
42
57
|
this._private_directionInternal.copy(value).normalize();
|
|
43
58
|
}
|
|
@@ -76,4 +91,4 @@ class FXSpawnRandomVelocity extends FXSpawn {
|
|
|
76
91
|
}
|
|
77
92
|
}
|
|
78
93
|
|
|
79
|
-
export {
|
|
94
|
+
export { FXSpawnVelocity };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { FXBehaviorDirectionalForce } from "./emitter/behavior/FXBehaviorDirectionalForce";
|
|
2
|
+
export { FXBehaviorPointForce } from "./emitter/behavior/FXBehaviorPointForce";
|
|
3
3
|
export { FXBehaviorScaleOverLife } from "./emitter/behavior/FXBehaviorScaleOverLife";
|
|
4
4
|
export { FXBehaviorTorqueDamping } from "./emitter/behavior/FXBehaviorTorqueDamping";
|
|
5
5
|
export { FXBehaviorTorqueNoise } from "./emitter/behavior/FXBehaviorTorqueNoise";
|
|
6
|
+
export { FXBehaviorTorqueOverLife } from "./emitter/behavior/FXBehaviorTorqueOverLife";
|
|
6
7
|
export { FXBehaviorVelocityDamping } from "./emitter/behavior/FXBehaviorVelocityDamping";
|
|
7
8
|
export { FXBehaviorVelocityNoise } from "./emitter/behavior/FXBehaviorVelocityNoise";
|
|
9
|
+
export { FXBehaviorVelocityOverLife } from "./emitter/behavior/FXBehaviorVelocityOverLife";
|
|
8
10
|
export { FXEmitter } from "./emitter/FXEmitter";
|
|
9
11
|
export { FXSpawnBox } from "./emitter/spawn/FXSpawnBox";
|
|
12
|
+
export { FXSpawnLifetime } from "./emitter/spawn/FXSpawnLifetime";
|
|
10
13
|
export { FXSpawnOffset } from "./emitter/spawn/FXSpawnOffset";
|
|
11
14
|
export { FXSpawnPoint } from "./emitter/spawn/FXSpawnPoint";
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { FXSpawnRandomScale } from "./emitter/spawn/FXSpawnRandomScale";
|
|
15
|
-
export { FXSpawnRandomTorque } from "./emitter/spawn/FXSpawnRandomTorque";
|
|
16
|
-
export { FXSpawnRandomVelocity } from "./emitter/spawn/FXSpawnRandomVelocity";
|
|
15
|
+
export { FXSpawnRotation } from "./emitter/spawn/FXSpawnRotation";
|
|
16
|
+
export { FXSpawnScale } from "./emitter/spawn/FXSpawnScale";
|
|
17
17
|
export { FXSpawnSphere } from "./emitter/spawn/FXSpawnSphere";
|
|
18
|
+
export { FXSpawnTorque } from "./emitter/spawn/FXSpawnTorque";
|
|
19
|
+
export { FXSpawnVelocity } from "./emitter/spawn/FXSpawnVelocity";
|
|
18
20
|
export { FXDiffuseMaterial } from "./materials/FXDiffuseMaterial/FXDiffuseMaterial";
|
|
19
21
|
export { FXMaterial } from "./materials/FXMaterial/FXMaterial";
|
|
20
22
|
export { FXUnlitMaterial } from "./materials/FXUnlitMaterial/FXUnlitMaterial";
|
|
21
23
|
export { FXColor } from "./miscellaneous/color/FXColor";
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
24
|
+
export { FXCurve1D } from "./miscellaneous/curve/FXCurve1D";
|
|
25
|
+
export type { FXCurve1DAnchor, FXCurve1DConfig, FXCurve1DPoint, } from "./miscellaneous/curve/FXCurve1D";
|
|
26
|
+
export { FXTextureView } from "./miscellaneous/texture/FXTextureView";
|
|
27
|
+
export type { FXTextureAtlasConfig, FXTextureConfig, FXTextureRect, FXTextureSize, FXTextureTrim, } from "./miscellaneous/texture/FXTextureView.Internal";
|
|
28
|
+
export { FXNodeColor } from "./nodes/color/FXNodeColor";
|
|
29
|
+
export { FXNodeColorOverLife } from "./nodes/color/FXNodeColorOverLife";
|
|
30
|
+
export { FXNodeSphericalClip } from "./nodes/color/FXNodeSphericalClip";
|
|
31
|
+
export { FXNodeFlatNormal } from "./nodes/normal/FXNodeFlatNormal";
|
|
32
|
+
export { FXNodeNormal } from "./nodes/normal/FXNodeNormal";
|
|
33
|
+
export { FXNodeSphericalNormal } from "./nodes/normal/FXNodeSphericalNormal";
|
|
34
|
+
export { FXNodeAnimatedTexture } from "./nodes/texture/FXNodeAnimatedTexture";
|
|
35
|
+
export type { FXNodeAnimatedTextureOptions } from "./nodes/texture/FXNodeAnimatedTexture";
|
|
36
|
+
export { FXNodeStaticTexture } from "./nodes/texture/FXNodeStaticTexture";
|
|
37
|
+
export { FXNodeTexture } from "./nodes/texture/FXNodeTexture";
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { FXBehaviorDirectionalForce } from './emitter/behavior/FXBehaviorDirectionalForce.js';
|
|
2
|
+
export { FXBehaviorPointForce } from './emitter/behavior/FXBehaviorPointForce.js';
|
|
3
3
|
export { FXBehaviorScaleOverLife } from './emitter/behavior/FXBehaviorScaleOverLife.js';
|
|
4
4
|
export { FXBehaviorTorqueDamping } from './emitter/behavior/FXBehaviorTorqueDamping.js';
|
|
5
5
|
export { FXBehaviorTorqueNoise } from './emitter/behavior/FXBehaviorTorqueNoise.js';
|
|
6
|
+
export { FXBehaviorTorqueOverLife } from './emitter/behavior/FXBehaviorTorqueOverLife.js';
|
|
6
7
|
export { FXBehaviorVelocityDamping } from './emitter/behavior/FXBehaviorVelocityDamping.js';
|
|
7
8
|
export { FXBehaviorVelocityNoise } from './emitter/behavior/FXBehaviorVelocityNoise.js';
|
|
9
|
+
export { FXBehaviorVelocityOverLife } from './emitter/behavior/FXBehaviorVelocityOverLife.js';
|
|
8
10
|
export { FXEmitter } from './emitter/FXEmitter.js';
|
|
9
11
|
export { FXSpawnBox } from './emitter/spawn/FXSpawnBox.js';
|
|
12
|
+
export { FXSpawnLifetime } from './emitter/spawn/FXSpawnLifetime.js';
|
|
10
13
|
export { FXSpawnOffset } from './emitter/spawn/FXSpawnOffset.js';
|
|
11
14
|
export { FXSpawnPoint } from './emitter/spawn/FXSpawnPoint.js';
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { FXSpawnRandomScale } from './emitter/spawn/FXSpawnRandomScale.js';
|
|
15
|
-
export { FXSpawnRandomTorque } from './emitter/spawn/FXSpawnRandomTorque.js';
|
|
16
|
-
export { FXSpawnRandomVelocity } from './emitter/spawn/FXSpawnRandomVelocity.js';
|
|
15
|
+
export { FXSpawnRotation } from './emitter/spawn/FXSpawnRotation.js';
|
|
16
|
+
export { FXSpawnScale } from './emitter/spawn/FXSpawnScale.js';
|
|
17
17
|
export { FXSpawnSphere } from './emitter/spawn/FXSpawnSphere.js';
|
|
18
|
+
export { FXSpawnTorque } from './emitter/spawn/FXSpawnTorque.js';
|
|
19
|
+
export { FXSpawnVelocity } from './emitter/spawn/FXSpawnVelocity.js';
|
|
18
20
|
export { FXDiffuseMaterial } from './materials/FXDiffuseMaterial/FXDiffuseMaterial.js';
|
|
19
21
|
export { FXMaterial } from './materials/FXMaterial/FXMaterial.js';
|
|
20
22
|
export { FXUnlitMaterial } from './materials/FXUnlitMaterial/FXUnlitMaterial.js';
|
|
21
23
|
export { FXColor } from './miscellaneous/color/FXColor.js';
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
24
|
+
export { FXCurve1D } from './miscellaneous/curve/FXCurve1D.js';
|
|
25
|
+
export { FXTextureView } from './miscellaneous/texture/FXTextureView.js';
|
|
26
|
+
export { FXNodeColor } from './nodes/color/FXNodeColor.js';
|
|
27
|
+
export { FXNodeColorOverLife } from './nodes/color/FXNodeColorOverLife.js';
|
|
28
|
+
export { FXNodeSphericalClip } from './nodes/color/FXNodeSphericalClip.js';
|
|
29
|
+
export { FXNodeFlatNormal } from './nodes/normal/FXNodeFlatNormal.js';
|
|
30
|
+
export { FXNodeNormal } from './nodes/normal/FXNodeNormal.js';
|
|
31
|
+
export { FXNodeSphericalNormal } from './nodes/normal/FXNodeSphericalNormal.js';
|
|
32
|
+
export { FXNodeAnimatedTexture } from './nodes/texture/FXNodeAnimatedTexture.js';
|
|
33
|
+
export { FXNodeStaticTexture } from './nodes/texture/FXNodeStaticTexture.js';
|
|
34
|
+
export { FXNodeTexture } from './nodes/texture/FXNodeTexture.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Blending } from "three";
|
|
2
2
|
import { Color, MeshLambertMaterial } from "three";
|
|
3
3
|
import type { GLTypeInfo } from "../../instancedParticle/shared";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import {
|
|
4
|
+
import type { FXNodeColor } from "../../nodes/color/FXNodeColor";
|
|
5
|
+
import type { FXNodeNormal } from "../../nodes/normal/FXNodeNormal";
|
|
6
|
+
import { FXNodeTexture } from "../../nodes/texture/FXNodeTexture";
|
|
7
7
|
export interface FXScatterUniforms {
|
|
8
8
|
u_ScatterTint: {
|
|
9
9
|
value: Color;
|
|
@@ -18,6 +18,6 @@ export interface FXScatterUniforms {
|
|
|
18
18
|
value: number;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
export declare function buildFXDiffuseMaterial(varyings: Record<string, GLTypeInfo>, blending: Blending, useAlphaHashing: boolean, alphaTest: number, premultipliedAlpha: boolean, albedoNodes: readonly (
|
|
21
|
+
export declare function buildFXDiffuseMaterial(varyings: Record<string, GLTypeInfo>, blending: Blending, useAlphaHashing: boolean, alphaTest: number, premultipliedAlpha: boolean, albedoNodes: readonly (FXNodeColor | FXNodeTexture)[], normalNodes: readonly (FXNodeTexture | FXNodeNormal)[], emissionNodes: readonly (FXNodeColor | FXNodeTexture)[], scatterUniforms?: FXScatterUniforms, shadowSensitivity?: {
|
|
22
22
|
value: number;
|
|
23
23
|
}): MeshLambertMaterial;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MeshLambertMaterial, Color, DoubleSide } from 'three';
|
|
2
2
|
import { PARTICLE_DEFINES } from '../../miscellaneous/miscellaneous.js';
|
|
3
|
-
import {
|
|
3
|
+
import { FXNodeTexture } from '../../nodes/texture/FXNodeTexture.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Wraps every `getShadow(...)` call in the shader source with
|
|
@@ -191,7 +191,7 @@ function buildFXDiffuseMaterial(varyings, blending, useAlphaHashing, alphaTest,
|
|
|
191
191
|
let fragmentShader = shader.fragmentShader;
|
|
192
192
|
if (useNormals) {
|
|
193
193
|
const normalExpressions = normalNodes.map((node) => {
|
|
194
|
-
if (node instanceof
|
|
194
|
+
if (node instanceof FXNodeTexture) {
|
|
195
195
|
return `normalize(${node.colorExpression}.rgb * 2.0 - 1.0)`;
|
|
196
196
|
}
|
|
197
197
|
return node.normalExpression;
|