babylon.quarks 0.17.7 → 0.17.9
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/CHANGELOG.md +7 -0
- package/dist/babylon.quarks.cjs +1 -1
- package/dist/babylon.quarks.cjs.map +1 -1
- package/dist/babylon.quarks.esm.js +1 -1
- package/dist/babylon.quarks.esm.js.map +1 -1
- package/dist/babylon.quarks.umd.min.js +1 -1
- package/dist/babylon.quarks.umd.min.js.map +1 -1
- package/package.json +13 -5
- package/src/ParticleSystem.ts +6 -4
- package/src/SpriteBatch.ts +2 -1
- package/src/TrailBatch.ts +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylon.quarks",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.9",
|
|
4
4
|
"description": "A High-Performance Particle System for Babylon.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -37,13 +37,21 @@
|
|
|
37
37
|
"url": "git+https://github.com/Soullnik/babylon.quarks-standalone.git"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
|
+
"babylonjs",
|
|
41
|
+
"babylon.js",
|
|
42
|
+
"particles",
|
|
43
|
+
"particle-system",
|
|
40
44
|
"particle",
|
|
41
|
-
"
|
|
45
|
+
"vfx",
|
|
46
|
+
"visual-effects",
|
|
47
|
+
"gpu-particles",
|
|
48
|
+
"webgl",
|
|
49
|
+
"webgpu",
|
|
50
|
+
"quarks",
|
|
51
|
+
"three.quarks",
|
|
42
52
|
"3d",
|
|
43
53
|
"game",
|
|
44
|
-
"performance"
|
|
45
|
-
"babylonjs",
|
|
46
|
-
"vfx"
|
|
54
|
+
"performance"
|
|
47
55
|
],
|
|
48
56
|
"author": "soullnik <soullnik96@gmail.com>",
|
|
49
57
|
"license": "MIT",
|
package/src/ParticleSystem.ts
CHANGED
|
@@ -899,9 +899,11 @@ export class ParticleSystem implements IParticleSystem {
|
|
|
899
899
|
const emissionBurstCount = emissionBursts.length;
|
|
900
900
|
const qualityFactor = this.qualityFactor;
|
|
901
901
|
|
|
902
|
-
const totalSpawn = Math.
|
|
903
|
-
|
|
904
|
-
|
|
902
|
+
const totalSpawn = Math.floor(emissionState.waitEmiting);
|
|
903
|
+
if (totalSpawn > 0) {
|
|
904
|
+
this.spawn(totalSpawn, emissionState, emitterMatrix);
|
|
905
|
+
emissionState.waitEmiting -= totalSpawn;
|
|
906
|
+
}
|
|
905
907
|
|
|
906
908
|
while (
|
|
907
909
|
emissionState.burstIndex < emissionBurstCount &&
|
|
@@ -1074,7 +1076,7 @@ export class ParticleSystem implements IParticleSystem {
|
|
|
1074
1076
|
rendererEmitterSettings,
|
|
1075
1077
|
renderOrder: json.renderOrder,
|
|
1076
1078
|
texture,
|
|
1077
|
-
material: materialMeta?.sourceMaterial,
|
|
1079
|
+
material: materialMeta?.sourceMaterial ?? materialMeta,
|
|
1078
1080
|
blendMode: materialMeta?.alphaMode ?? json.blending ?? Constants.ALPHA_ADD,
|
|
1079
1081
|
transparent: materialMeta?.transparent ?? json.transparent ?? true,
|
|
1080
1082
|
depthTest: materialMeta?.depthTest ?? json.depthTest ?? true,
|
package/src/SpriteBatch.ts
CHANGED
|
@@ -379,8 +379,9 @@ export class SpriteBatch extends VFXBatch {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
+
// Keep the mesh enabled even when count is 0 — toggling visibility off for a
|
|
383
|
+
// single frame (common with short lifetimes + low emission overlap) causes flicker.
|
|
382
384
|
this.mesh.forcedInstanceCount = index;
|
|
383
|
-
this.mesh.setEnabled(index > 0);
|
|
384
385
|
|
|
385
386
|
if (index > 0) {
|
|
386
387
|
this.offsetVB.update(this.offsetBuffer);
|
package/src/TrailBatch.ts
CHANGED
|
@@ -41,7 +41,6 @@ export class TrailBatch extends VFXBatch {
|
|
|
41
41
|
this.maxParticles = 10000;
|
|
42
42
|
this.setupBuffers();
|
|
43
43
|
this.rebuildMaterial();
|
|
44
|
-
this.mesh.setEnabled(false);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
setupBuffers(): void {
|
|
@@ -397,7 +396,6 @@ export class TrailBatch extends VFXBatch {
|
|
|
397
396
|
const colorVB = this.mesh.getVertexBuffer(VertexBuffer.ColorKind);
|
|
398
397
|
if (colorVB) colorVB.update(this.colorBuffer);
|
|
399
398
|
|
|
400
|
-
this.mesh.setEnabled(true);
|
|
401
399
|
if (this.mesh.subMeshes && this.mesh.subMeshes.length > 0) {
|
|
402
400
|
const meshBoundingInfo = this.mesh.getBoundingInfo();
|
|
403
401
|
for (const subMesh of this.mesh.subMeshes) {
|
|
@@ -406,8 +404,9 @@ export class TrailBatch extends VFXBatch {
|
|
|
406
404
|
this.mesh.subMeshes[0].indexCount = triangles * 3;
|
|
407
405
|
this.mesh.subMeshes[0].verticesCount = index;
|
|
408
406
|
}
|
|
409
|
-
} else {
|
|
410
|
-
this.mesh.
|
|
407
|
+
} else if (this.mesh.subMeshes && this.mesh.subMeshes.length > 0) {
|
|
408
|
+
this.mesh.subMeshes[0].indexCount = 0;
|
|
409
|
+
this.mesh.subMeshes[0].verticesCount = 0;
|
|
411
410
|
}
|
|
412
411
|
}
|
|
413
412
|
|