babylon.quarks 0.17.1 → 0.17.2

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.1",
3
+ "version": "0.17.2",
4
4
  "description": "A High-Performance Particle System for Babylon.js",
5
5
  "type": "module",
6
6
  "types": "./dist/types/index.d.ts",
@@ -487,7 +487,11 @@ export class QuarksLoader {
487
487
  const subEmitter = system.behaviors[i] as EmitSubParticleSystem;
488
488
  const targetUUID = subEmitter.subParticleSystem as any;
489
489
  if (typeof targetUUID === 'string' && nodesMap[targetUUID]) {
490
- (subEmitter as any).subParticleSystem = nodesMap[targetUUID];
490
+ const resolved = nodesMap[targetUUID];
491
+ (subEmitter as any).subParticleSystem = resolved;
492
+ if (resolved instanceof ParticleEmitter) {
493
+ (resolved.system as ParticleSystem).onlyUsedByOther = true;
494
+ }
491
495
  }
492
496
  }
493
497
  }
@@ -22,6 +22,11 @@ varying vec4 vColor;
22
22
  varying vec3 vNormal;
23
23
  varying vec3 vWorldPos;
24
24
 
25
+ #ifdef TILE_BLEND
26
+ varying vec2 vUV2;
27
+ varying float vTileBlend;
28
+ #endif
29
+
25
30
  #ifdef SOFT_PARTICLES
26
31
  varying vec4 projPosition;
27
32
  varying float linearDepth;
@@ -54,9 +59,17 @@ void main() {
54
59
 
55
60
  #ifdef UV_TILE
56
61
  vec2 tc = vec2(tileCountX, tileCountY);
57
- float tileU = mod(uvTile, tc.x) / tc.x;
58
- float tileV = 1.0 - floor(uvTile / tc.x) / tc.y - 1.0 / tc.y;
62
+ float baseTile = floor(uvTile);
63
+ float tileU = mod(baseTile, tc.x) / tc.x;
64
+ float tileV = 1.0 - floor(baseTile / tc.x) / tc.y - 1.0 / tc.y;
59
65
  vUV = uv / tc + vec2(tileU, tileV);
66
+ #ifdef TILE_BLEND
67
+ float nextTile = ceil(uvTile);
68
+ float nextU = mod(nextTile, tc.x) / tc.x;
69
+ float nextV = 1.0 - floor(nextTile / tc.x) / tc.y - 1.0 / tc.y;
70
+ vUV2 = uv / tc + vec2(nextU, nextV);
71
+ vTileBlend = fract(uvTile);
72
+ #endif
60
73
  #else
61
74
  vUV = uv;
62
75
  #endif