Game Development Community

Smoke

by Jason Pfaff · in General Discussion · 12/07/2006 (1:12 pm) · 4 replies

I have been trying to get a really good datablock for smoke, but I have had no luck getting it right. Does anyone know of a good tutorial or some code I could look at. Thanks

#1
12/07/2006 (1:54 pm)
This probably should be in a more specific forum, but I don't stress about things like that. I'm sure if someone does, they'll let you know. =)

Anyway, here is some script for large black smoke, not sure if it is what you're looking for. just add it to a existing script file (chimneyfire.cs, or equivalent or create a new .cs file and make sure you exec it in your game.cs script).

datablock ParticleData(ChimneyFire3)
{
   textureName          = "~/data/shapes/particles/smoke";
   dragCoefficient     = 0.0;
   gravityCoefficient   = -0.5;   // rises slowly
   inheritedVelFactor   = 0.00;
   lifetimeMS           = 1900;
   lifetimeVarianceMS   = 450;
   useInvAlpha = false;
   spinRandomMin = -30.0;
   spinRandomMax = 30.0;

   colors[0]     = "0.6 0.6 0.0 0.1";
   colors[1]     = "0.6 0.6 0.0 0.1";
   colors[2]     = "0.0 0.0 0.0 0.0";

   sizes[0]      = 4.5;
   sizes[1]      = 4.5;
   sizes[2]      = 4.5;

   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(ChimneyFire3Emitter)
{
   ejectionPeriodMS = 200;
   periodVarianceMS = 10;

   ejectionVelocity = 0.15;
   velocityVariance = 0.05;

   thetaMin         = 3.0;
   thetaMax         = 90.0;  

   particles = "ChimneyFire3";
};

datablock ParticleEmitterNodeData(ChimneyFire3EmitterNode)
{
   timeMultiple = 1;
};

- Alan
#2
12/07/2006 (2:14 pm)
Do not use the General Forums for tech questions.
#3
12/12/2006 (7:43 am)
Thanks, Alan works great!! I will post in a better place next time, sorry.
#4
12/12/2006 (10:12 am)
Thanks, Alan works great!! I will post in a better place next time, sorry.