How to create Black Smoke in TGE ?
by Ali Khan · in Torque Game Engine · 10/11/2006 (9:20 pm) · 9 replies
Hi everyone,
I am trying to create black colored particles for my smoke but I am unable to do it. I have tried setting the particle color to all black but that results in particles disappearing completely.
I also tried putting a black particle texture but that doesn't work either and the particle remain white. The black part of the texture disappears as alpha. It seems the texture is not being composited onto the particle but instead it is just being used as an alpha on which the particle color is composited.
So if my assumptions are true then I guess there is no way to create black smoke particles in TGE.
This would be bad, right ?
Ali Khan.
I am trying to create black colored particles for my smoke but I am unable to do it. I have tried setting the particle color to all black but that results in particles disappearing completely.
I also tried putting a black particle texture but that doesn't work either and the particle remain white. The black part of the texture disappears as alpha. It seems the texture is not being composited onto the particle but instead it is just being used as an alpha on which the particle color is composited.
So if my assumptions are true then I guess there is no way to create black smoke particles in TGE.
This would be bad, right ?
Ali Khan.
#2
10/11/2006 (11:19 pm)
I tried copying all these values, also used the texture you gave. The lower end particle are yellow but the higher particles are invisible, instead of black.
#3
Drop this after the code above:
I *think* that should do it...I hope...
10/11/2006 (11:31 pm)
Oops.Drop this after the code above:
datablock ParticleEmitterNodeData(DarkSmokeEmitterNode)
{
timeMultiple = 1;
};I *think* that should do it...I hope...
#4
10/11/2006 (11:58 pm)
I have already done that ..
#5
Sorry. =P
10/12/2006 (12:07 am)
Crap. Sorry. Grabbed the wrong emitter. Gave you the fire not the smoke one! datablock ParticleData(ChimneySmoke2)
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
gravityCoefficient = -0.2; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 6000;
lifetimeVarianceMS = 250;
useInvAlpha = true;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
sgAllowLighting = true;
colors[0] = "0.10 0.10 0.10 0.1";
colors[1] = "0.20 0.20 0.10 0.1";
colors[2] = "0.10 0.10 0.10 0.0";
sizes[0] = 1.5;
sizes[1] = 4.75;
sizes[2] = 8.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ChimneySmoke2Emitter)
{
ejectionPeriodMS = 20;
periodVarianceMS = 5;
ejectionVelocity = 0.25;
velocityVariance = 0.10;
thetaMin = 0.0;
thetaMax = 90.0;
particles = ChimneySmoke2;
};
datablock ParticleEmitterNodeData(ChimneySmoke2EmitterNode)
{
timeMultiple = 1;
};Sorry. =P
#6
10/12/2006 (11:27 am)
The key line is this:useInvAlpha = true;That changes the blend mode of particles to be subtractive instead of additive, allowing for darker colours.
#7
I must say though, useInvAlpha might not be the right name for this attribute. It should be blend mode or something. I mean inverse alpha implies that texture alpha will be inverses to make opaque areas transparent and vice versa.
Anyways all is good as long as the funcionality is there.
10/12/2006 (9:15 pm)
This worked great. Thanks a lot. I must say though, useInvAlpha might not be the right name for this attribute. It should be blend mode or something. I mean inverse alpha implies that texture alpha will be inverses to make opaque areas transparent and vice versa.
Anyways all is good as long as the funcionality is there.
#8
10/14/2006 (12:48 am)
Nice and very useful. Now if someone has only made a really nice spark emmiter like a metal contact spark.
#9
10/20/2006 (2:54 pm)
You might want to try using the ParticleEditor. It is incredibly easy to use and you get instant results.
Torque Owner Alan James
Really Really Good Things Studio
Create (or add to a executed script file, like "chimneyfire.cs" or the like):
datablock ParticleData(DarkSmoke) { 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(DarkSmokeEmitter) { ejectionPeriodMS = 200; periodVarianceMS = 10; ejectionVelocity = 0.15; velocityVariance = 0.05; thetaMin = 3.0; thetaMax = 90.0; particles = "DarkSmoke"; };Here's the png:
www.reallyreallygoodthings.com/screens3/smoke.png
Here's an image:
Hope this is kind of what you're looking for.
- Alan