TSE Particles Not Rendering
by William Harding · in Torque Game Engine Advanced · 04/16/2006 (6:31 pm) · 12 replies
I am in the process of modifying the TSE engine (head version) for my game, and have noticed that the entire ParticleEmitter::renderObject method (from particleEngine.cpp) is commented, as is ParticleEmitter::renderBillboardParticle. Uncommenting these results in a number of errors seeming indicate the existence of a dlg library of functions that doesn't exist in TSE currently. That is, I get errors like:
error C3861: 'dglIsInCanonicalState': identifier not found
error C3861: 'dglGetViewport': identifier not found
My first question is if the renderObject method is supposed to render particles in TSE? And if so, why has its code been commented? And more importantly, what modifications are necessary to start using it?
If it is relevant, I am developing a game that will eventually be on the XBLA, so I don't want to change code that will not be compatible with the TSE Xbox libraries. Having particles excised from the engine seems like a pretty huge omission though, so I'm hoping that this render routine has been deprecated in favor of some other one...?
error C3861: 'dglIsInCanonicalState': identifier not found
error C3861: 'dglGetViewport': identifier not found
My first question is if the renderObject method is supposed to render particles in TSE? And if so, why has its code been commented? And more importantly, what modifications are necessary to start using it?
If it is relevant, I am developing a game that will eventually be on the XBLA, so I don't want to change code that will not be compatible with the TSE Xbox libraries. Having particles excised from the engine seems like a pretty huge omission though, so I'm hoping that this render routine has been deprecated in favor of some other one...?
#2
04/16/2006 (9:56 pm)
So what function or method is rendering the particles currently? I am trying to attach particles to a projectile currently, and everything looks legit -- I've set breakpoints to verify that the ProjectileEmitter is being created, which is in turn creating and updating particles, but I don't see anything on screen. Is there any code reference available to show an example of working particles that render with the current version of TSE?
#3
04/19/2006 (2:34 am)
Its working in my code. Have a look at the CVS history for the particle code?
#4
If it helps, I am using the default sparkles on the Crossbow.cs projectile object, maybe there are certain particles that render using a different method than ParticleEmitter::renderObject?
04/29/2006 (11:19 am)
Phil -- I've reviewed the current version of the TSE engine and it does in fact still have the renderObject code commented out in the particle module. If anyone has any idea as to where else particles are being rendered, I could set a break point at that location and figure out why my particles aren't rendering, but the only place that seems to be getting called is ParticleEmitter::renderObject (via the SceneState object), and that method doesn't do anything currently.If it helps, I am using the default sparkles on the Crossbow.cs projectile object, maybe there are certain particles that render using a different method than ParticleEmitter::renderObject?
#5
04/29/2006 (5:25 pm)
And if you use the default Crossbow.cs do the particles appear?
#6
explosion = CrossbowExplosion;
waterExplosion = CrossbowWaterExplosion;
particleEmitter = CrossbowBoltEmitter;
particleWaterEmitter= CrossbowBoltBubbleEmitter;
As I've said before, I've used breakpoints to determine that the SceneState is indeed trying to render particles, so they do seem to be getting set up right. Frankly, I am pretty astounded that everyone seems to be having no problem with particles when their entire render method is commented out. I wish *someone* could explain how exactly particles are supposed to render without a valid render method, it seems like if I am using the main, current version of TSE (which I have every reason to believe I am) this should not be an uncommon problem???
If it helps, here are the particleEmitter and particle datablocks for the BoltEmitter that the projectile uses. They are just the default ones in Crossbow.cs, but maybe this helps somehow:
datablock ParticleEmitterData(CrossbowBoltEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.10;
thetaMin = 0.0;
thetaMax = 90.0;
particles = CrossbowBoltParticle;
};
datablock ParticleData(CrossbowBoltParticle)
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
gravityCoefficient = -0.1; // rises slowly
inheritedVelFactor = 0.0;
lifetimeMS = 150;
lifetimeVarianceMS = 10; // ...more or less
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.1 0.1 0.1 1.0";
colors[1] = "0.1 0.1 0.1 1.0";
colors[2] = "0.1 0.1 0.1 0";
sizes[0] = 0.15;
sizes[1] = 0.20;
sizes[2] = 0.25;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
Any ideas here very much appreciated!!
04/29/2006 (10:33 pm)
Nope. I'm using the Crossbow.cs as provided and I get no particles. The code that seems to be specifying the particle to use isexplosion = CrossbowExplosion;
waterExplosion = CrossbowWaterExplosion;
particleEmitter = CrossbowBoltEmitter;
particleWaterEmitter= CrossbowBoltBubbleEmitter;
As I've said before, I've used breakpoints to determine that the SceneState is indeed trying to render particles, so they do seem to be getting set up right. Frankly, I am pretty astounded that everyone seems to be having no problem with particles when their entire render method is commented out. I wish *someone* could explain how exactly particles are supposed to render without a valid render method, it seems like if I am using the main, current version of TSE (which I have every reason to believe I am) this should not be an uncommon problem???
If it helps, here are the particleEmitter and particle datablocks for the BoltEmitter that the projectile uses. They are just the default ones in Crossbow.cs, but maybe this helps somehow:
datablock ParticleEmitterData(CrossbowBoltEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.10;
thetaMin = 0.0;
thetaMax = 90.0;
particles = CrossbowBoltParticle;
};
datablock ParticleData(CrossbowBoltParticle)
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
gravityCoefficient = -0.1; // rises slowly
inheritedVelFactor = 0.0;
lifetimeMS = 150;
lifetimeVarianceMS = 10; // ...more or less
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.1 0.1 0.1 1.0";
colors[1] = "0.1 0.1 0.1 1.0";
colors[2] = "0.1 0.1 0.1 0";
sizes[0] = 0.15;
sizes[1] = 0.20;
sizes[2] = 0.25;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
Any ideas here very much appreciated!!
#7
This would at least help me debug whether I am grabbing the right version.
04/30/2006 (11:41 pm)
Here's an easy first step that I'd like to have someone else verify: true or false -- your ParticleEmitter::renderObject is a bunch of openGL commands that are commented out, and there is no uncommented code in the entire method?This would at least help me debug whether I am grabbing the right version.
#8
ParticleEmitter::renderObject in game/fx/particleEmitter.cpp does not contain opengl, but GFX-> calls
I'm looking at MS3 code
05/01/2006 (1:40 am)
FalseParticleEmitter::renderObject in game/fx/particleEmitter.cpp does not contain opengl, but GFX-> calls
I'm looking at MS3 code
#9
Thanks for the reply. Are those GFX calls uncommented (and thus compiling, which would imply you have GFX source code)?
05/01/2006 (9:29 am)
Thomas,Thanks for the reply. Are those GFX calls uncommented (and thus compiling, which would imply you have GFX source code)?
#10
Anybody who has TSE has the GFX Source code, so not sure what that question means :)
05/01/2006 (1:30 pm)
I will echo what Thomas said and say that the particleEmitter.cpp file is setup with the needed GFX calls.. based on MS3 - Although I think it was all working in MS2, as well..Anybody who has TSE has the GFX Source code, so not sure what that question means :)
#11
05/05/2006 (9:31 am)
Everything works fine, is not commented out or anything.
#12
05/05/2006 (9:44 pm)
Thanks guys. After getting this advice I regrabbed (for the fourth time) and finally got the same code that everyone else apparently has had all along. Although I could have sworn the TSE instructions stated that by specifying nothing for the version it would grab head version by default, this is clearly not the case. I now have 0_4_0 and particles are working A-OK (hopefully Atlas too, since I finally see code for it). Thanks for the help.
Torque Owner Jeremiah Fulbright
Particles do work fine in TSE without code modifications, but alot of the underlying core code will more than likely be changing.