Fire Procedural Texture

Fire Procedural texture

Using the Fire procedural texture

Fire procedural texture can be found here:

A demo can be found here: Fire Procedural Texture

This texture has 4 parameters :

  • time can be set manually(float) if autoGenerateTime(boolean) is set to false. It is used inside the fire shader to animate it
  • speed controls the velocity (speed and direction) of the flames (BABYLON.Vector2)
  • fireColors is an array of 6 (BABYLON.Color3/4) defining the different color of the fire. You can define them manually of use presets available as static properties of the class (PurpleFireColors, GreenFireColors, RedFireColors, BlueFireColors)
var fireMaterial = new BABYLON.StandardMaterial("fireMat", scene);
var fireTexture = new BABYLON.FireProceduralTexture("fireTex", 256, scene);
fireMaterial.diffuseTexture = fireTexture;
fireMaterial.opacityTexture = fireTexture;