OXY11 Posted June 19, 2016 Share Posted June 19, 2016 Hi, some doubts about the Fire Procedural Texture parameters "var fireTexture = new BABYLON.FireProceduralTexture("fire", 512, scene);" this seems not to work: fireTexture.autoGenerateTime = false; fireTexture.time = 0; and the array of 6 colors in which parts of the fire/flames refer exactly? fireTexture.fireColors = [ new BABYLON.Color3(0.1, 0.0, 0.5), new BABYLON.Color3(0.0, 0.0, 0.5), new BABYLON.Color3(0.1, 0.0, 0.2), new BABYLON.Color3(0.0, 0.0, 1.0), new BABYLON.Color3(0.1, 0.2, 0.3), new BABYLON.Color3(0.0, 0.2, 0.9) ]; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 Summoning @Luaacro julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 20, 2016 Share Posted June 20, 2016 Hello What do you mean by "seems not to work" ? It works on my machine These 6 colors are used to be mixed together following some weights (the weights which are used to interpolate the two given color values): mix(color1, color2, weight1) + mix(color3, color4, weight2) - mix(color5, color6, weight3) It looks like the color5 and color6 are related to the Y coordinates of the texture. color3 and color4 related to the X coordinates of the texture. color1 and color2 mostly used to be ambient colors of the flames. Following this shader's code: https://github.com/BabylonJS/Babylon.js/blob/master/proceduralTexturesLibrary/proceduralTextures/fire/fireProceduralTexture.fragment.fx#L40 Quote Link to comment Share on other sites More sharing options...
OXY11 Posted June 21, 2016 Author Share Posted June 21, 2016 hi, first of all thank you! if I change "time" value, i can't see difference in the fire animation? eg what value I need to see the fire go slowest? Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 21, 2016 Share Posted June 21, 2016 oh I understand well you should call "fireTexture.updateShaderUniforms()" when you modify a property like the time are you managing the time yourself ? I don't know if it's possible to set time with a lower animation ratio using the automatic timer @meulta will have the answer Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 21, 2016 Share Posted June 21, 2016 Any Playground scene? Quote Link to comment Share on other sites More sharing options...
Meulta Posted June 21, 2016 Share Posted June 21, 2016 Hello, You can the speed using the speed property of the FireProceduralTexture It is a BABYLON.Vector2. Here is a sample : http://babylonjs-playground.com/#KM3TC#13 Hope this help. julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
OXY11 Posted June 22, 2016 Author Share Posted June 22, 2016 ok, thanks again, but what is and what sets the "time" parameter? Quote Link to comment Share on other sites More sharing options...
Meulta Posted June 22, 2016 Share Posted June 22, 2016 Time is the parameter used to "move" the fire. A specific fire state is related to a specific "time" value. By default this is set by the render method of the FireProceduralTexture : https://github.com/BabylonJS/Babylon.js/blob/master/proceduralTexturesLibrary/proceduralTextures/fire/babylon.fireProceduralTexture.ts#L29 You can set that yourself setting _autoGenerateTime to false and change its value in your rendering loop. In most cases setting the speed is enough julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
OXY11 Posted June 23, 2016 Author Share Posted June 23, 2016 ok, tx again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.