babylon.quarks 0.17.8 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylon.quarks",
3
- "version": "0.17.8",
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",
@@ -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.ceil(emissionState.waitEmiting);
903
- this.spawn(totalSpawn, emissionState, emitterMatrix);
904
- emissionState.waitEmiting -= totalSpawn;
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,
@@ -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.setEnabled(false);
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