JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://preview.babylonjs.com/babylon.js"></script>
<script src="https://pixijs.download/v5.1.2/pixi.min.js"></script>
<canvas id="renderCanvas" touch-action="none" width='500px' height='500px'></canvas>
JavaScript
var canvas = document.getElementById("renderCanvas");
// babylon.js rendering
var engine = new BABYLON.Engine(canvas, true);
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
camera.setTarget(BABYLON.Vector3.Zero());
camera.attachControl(canvas, true);
var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
light.intensity = 0.7;
var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
sphere.position.y = 1;
var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
var hdrTexture = new BABYLON.CubeTexture("https://playground.babylonjs.com/textures/environment.dds", scene, 512);
var envir = new BABYLON.PBRMaterial("envir", scene);
envir.albedoColor = new BABYLON.Color3(1.0, 0.766, 0.336);
envir.reflectivityColor = new BABYLON.Color3(1.0, 0.766, 0.336);
envir.microSurface = 1.0; // Let the texture controls the value
envir.reflectionTexture = hdrTexture.clone();
envir.useMicroSurfaceFromReflectivityMapAlpha = true;
sphere.material = envir;
ground.material = envir;
// Create a particle system
var ps1 = new BABYLON.ParticleSystem("particles", 20000, scene);
//Texture of each particle
ps1.particleTexture = new BABYLON.Texture("https://www.babylonjs-playground.com/textures/flare.png", scene);
ps1.translationPivot = new BABYLON.Vector3(0, 100,30);
// Where the particles come from
// ps1.emitter = fountain; // the starting object, the emitter
ps1.emitter = camera;
ps1.minEmitBox = new BABYLON.Vector3(-.3, 0, 0); // Starting all from
ps1.maxEmitBox = new BABYLON.Vector3(.3, 0, 0); // To...
// Colors of all particles
ps1.color1 = new BABYLON.Color4(0.7, 0.8, 1.0, 1.0);
ps1.color2 = new BABYLON.Color4(0.2, 0.5, 1.0, 1.0);
ps1.colorDead = new BABYLON.Color4(0, 0, 0.2, 0.0);
// Size of each particle (random between...
ps1.minSize = 0.1;
ps1.maxSize = 1;
// Life time of each particle (random between...
ps1.minLifeTime =...