babylon.quarks 0.18.1 → 0.19.0

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 CHANGED
@@ -8,10 +8,10 @@ High-performance particle system for [Babylon.js](https://www.babylonjs.com/). B
8
8
 
9
9
  [**Live demos**](https://soullnik.github.io/babylon.quarks-standalone/)
10
10
 
11
- | | | | |
12
- |---|---|---|---|
13
- | [![Muzzle Flash](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/muzzle-flash.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#MuzzleFlashDemo) | [![Explosion](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/explosion.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#ExplosionDemo) | [![Trail](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/trail.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#TrailDemo) | [![Sub Emitter](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/sub-emitter.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#SubEmitterDemo) |
14
- | [![Electric Ball](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/electric-ball.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#ElectricBallDemo) | [![Black Hole](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/black-hole.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#BlackHoleDemo) | [![Soft Particles](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/soft-particle.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#SoftParticleDemo) | [![Level-Up](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/level-up.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#LevelUpDemo) |
11
+ | | | | |
12
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | [![Muzzle Flash](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/muzzle-flash.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#MuzzleFlashDemo) | [![Explosion](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/explosion.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#ExplosionDemo) | [![Trail](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/trail.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#TrailDemo) | [![Sub Emitter](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/sub-emitter.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#SubEmitterDemo) |
14
+ | [![Electric Ball](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/electric-ball.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#ElectricBallDemo) | [![Black Hole](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/black-hole.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#BlackHoleDemo) | [![Soft Particles](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/soft-particle.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#SoftParticleDemo) | [![Level-Up](https://raw.githubusercontent.com/Soullnik/babylon.quarks-standalone/main/examples/public/previews/level-up.png)](https://soullnik.github.io/babylon.quarks-standalone/babylonDemo.html#LevelUpDemo) |
15
15
 
16
16
  ## Features
17
17
 
@@ -35,7 +35,7 @@ Peer dependency: `@babylonjs/core` >= 9.
35
35
  ## Quick start
36
36
 
37
37
  ```ts
38
- import {Constants} from "@babylonjs/core/Engines/constants";
38
+ import {Constants} from '@babylonjs/core/Engines/constants';
39
39
  import {
40
40
  BatchedRenderer,
41
41
  ParticleSystem,
@@ -45,10 +45,10 @@ import {
45
45
  IntervalValue,
46
46
  ConstantColor,
47
47
  Vector4,
48
- } from "babylon.quarks";
48
+ } from 'babylon.quarks';
49
49
 
50
50
  // One renderer per scene; it batches all systems added to it.
51
- const batchRenderer = new BatchedRenderer("particles", scene);
51
+ const batchRenderer = new BatchedRenderer('particles', scene);
52
52
 
53
53
  const system = new ParticleSystem({
54
54
  scene,
@@ -80,13 +80,13 @@ The package ships a UMD bundle (`dist/babylon.quarks.umd.min.js`, exposed as the
80
80
  ```js
81
81
  var createScene = async function () {
82
82
  var scene = new BABYLON.Scene(engine);
83
- var camera = new BABYLON.ArcRotateCamera("cam", -Math.PI / 2, 1.2, 10, BABYLON.Vector3.Zero(), scene);
83
+ var camera = new BABYLON.ArcRotateCamera('cam', -Math.PI / 2, 1.2, 10, BABYLON.Vector3.Zero(), scene);
84
84
  camera.attachControl(canvas, true);
85
85
 
86
- await BABYLON.Tools.LoadScriptAsync("https://cdn.jsdelivr.net/npm/babylon.quarks/dist/babylon.quarks.umd.min.js");
86
+ await BABYLON.Tools.LoadScriptAsync('https://cdn.jsdelivr.net/npm/babylon.quarks/dist/babylon.quarks.umd.min.js');
87
87
  const Q = BabylonQuarks;
88
88
 
89
- const batchRenderer = new Q.BatchedRenderer("particles", scene);
89
+ const batchRenderer = new Q.BatchedRenderer('particles', scene);
90
90
  const system = new Q.ParticleSystem({
91
91
  scene,
92
92
  duration: 5,
@@ -98,7 +98,7 @@ var createScene = async function () {
98
98
  emissionOverTime: new Q.ConstantValue(60),
99
99
  shape: new Q.ConeEmitter({radius: 0.3, angle: 0.4}),
100
100
  renderMode: Q.RenderMode.BillBoard,
101
- texture: new BABYLON.Texture("textures/flare.png", scene),
101
+ texture: new BABYLON.Texture('textures/flare.png', scene),
102
102
  transparent: true,
103
103
  blendMode: BABYLON.Constants.ALPHA_ADD,
104
104
  });
@@ -124,8 +124,8 @@ The same bundle works in any plain `<script>` setup alongside the global `babylo
124
124
  The library runs on Babylon's `WebGPUEngine` — its GLSL shaders are transpiled to WGSL automatically by Babylon (glslang/twgsl are fetched by Babylon on engine init). Everything except engine creation stays the same:
125
125
 
126
126
  ```ts
127
- import {WebGPUEngine} from "@babylonjs/core/Engines/webgpuEngine";
128
- import "@babylonjs/core/Engines/WebGPU/Extensions/index";
127
+ import {WebGPUEngine} from '@babylonjs/core/Engines/webgpuEngine';
128
+ import '@babylonjs/core/Engines/WebGPU/Extensions/index';
129
129
 
130
130
  const engine = new WebGPUEngine(canvas, {antialias: true});
131
131
  await engine.initAsync();
@@ -143,11 +143,11 @@ Design an effect with one of these tools, then load the exported JSON with `Quar
143
143
  - **quarks.art** — effects exported from the [quarks.art](https://quarks.art/) editor also load fine, since it's the same JSON envelope.
144
144
 
145
145
  ```ts
146
- import {BatchedRenderer, QuarksLoader, QuarksUtil} from "babylon.quarks";
146
+ import {BatchedRenderer, QuarksLoader, QuarksUtil} from 'babylon.quarks';
147
147
 
148
- const batchRenderer = new BatchedRenderer("particles", scene);
148
+ const batchRenderer = new BatchedRenderer('particles', scene);
149
149
  const loader = new QuarksLoader(scene);
150
- const effect = await loader.load("effects/explosion.json");
150
+ const effect = await loader.load('effects/explosion.json');
151
151
  QuarksUtil.addToBatchRenderer(effect, batchRenderer);
152
152
  QuarksUtil.play(effect);
153
153
  ```