How would YOU do tracer fire?
by Glen "ThaBonadingus" Reece · in Torque 3D Professional · 06/28/2011 (5:47 pm) · 15 replies
My experience in tracer fire is that using particles can be a bit...off. The main reason is that it leaves spaces in between each particle and causes issues because of this, meaning that particles are split apart and are normally visible separately instead of as a whole "tracer bullet".
How would you recommend doing tracer fire?
How would you recommend doing tracer fire?
About the author
Christian, Star Wars fan, Expert Americanese Speaker, The Legendary Bonadingus boss monster, Frighteningly Sexy, Lover of Anime (especially Gundam), MangaPage and ItBGames Partner, and IndieOtaku Blogger.
#2
06/28/2011 (7:07 pm)
I've debated about doing a "billboard" style sprite, but I'm not sure how to do the calculations :P
#3
06/29/2011 (8:31 am)
What about using the built in light description on the projectile datablock?
#5
Guy, is that flashlight an actual mounted light or are you doing something funky? Also spam this youTube Torque dev thread
06/29/2011 (9:07 am)
offtopic but hey ...Guy, is that flashlight an actual mounted light or are you doing something funky? Also spam this youTube Torque dev thread
#6
06/29/2011 (11:03 am)
@Steve, yeah, it's just a spotlight mounted to a node out in front of the player.
#7
06/29/2011 (4:21 pm)
Which way should I modify the light Description? Adding a sprite?
#8
A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual "LightBase" objects.
This datablock stores the properties of that light as fields that can be initialized from script.
Example:
Basically it allows you to define a light that will move with the projectile. Not sure of the performance of this versus adding a glow to the material of the projectile. But try it both ways and see if one performs better than the other.
06/29/2011 (4:39 pm)
From the code comments:A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual "LightBase" objects.
This datablock stores the properties of that light as fields that can be initialized from script.
Example:
// Declare a light description to be used on a rocket launcher projectile
datablock LightDescription(RocketLauncherLightDesc)
{
range = 4.0;
color = "1 1 0";
brightness = 5.0;
animationType = PulseLightAnim;
animationPeriod = 0.25;
};
// Declare a ProjectileDatablock which uses the light description
datablock ProjectileData(RocketLauncherProjectile)
{
lightDesc = RocketLauncherLightDesc;
projectileShapeName = "art/shapes/weapons/SwarmGun/rocket.dts";
directDamage = 30;
radiusDamage = 30;
damageRadius = 5;
areaImpulse = 2500;
// ... remaining ProjectileData fields not listed for this example
};Basically it allows you to define a light that will move with the projectile. Not sure of the performance of this versus adding a glow to the material of the projectile. But try it both ways and see if one performs better than the other.
#9
Basically something similar to what Steve referenced attached to the projectile. I just want to know other ways of achieving it, or if someone knows how to code a "billboard" style sprite that would be aligned to the direction of the projectile.
06/29/2011 (4:58 pm)
I found the light description, but I meant to add a visible tracer to the projectile, which is why I referenced particles. I don't really want to use a light itself as a tracer, I want something that is similar to what Guy showed (which is a great idea btw), but something that will also work for people who can't run glow shaders. I might even use something like that added onto what I use for a tracer.Basically something similar to what Steve referenced attached to the projectile. I just want to know other ways of achieving it, or if someone knows how to code a "billboard" style sprite that would be aligned to the direction of the projectile.
#10
06/29/2011 (5:04 pm)
"emissive" - like glow but not fancy, just shows your sprite up as you coloured it, so colour it as a bright orange line and that's what you'll get.
#11
I really do appreciate the replies guys. :)
06/29/2011 (5:07 pm)
Thanks Steve. I just wanna know how I'd go about attaching said sprite with it also being a billboard.I really do appreciate the replies guys. :)
#12
For a long, thin, line of tracer you'd have to have the normal pointing to the camera - which would require source code changes (I believe this is how MaxGaming did their "ribbons" effects on missiles in some space sim game they made).
I cheated with the billboard idea and made the cross section bullet out of overlapping, doublesided polys.
06/29/2011 (5:12 pm)
A billboard would only work if it was circular (eg: it had not front and back). Billboards are just a mesh with a _BB at the end of the name.For a long, thin, line of tracer you'd have to have the normal pointing to the camera - which would require source code changes (I believe this is how MaxGaming did their "ribbons" effects on missiles in some space sim game they made).
I cheated with the billboard idea and made the cross section bullet out of overlapping, doublesided polys.
#13
Thank you all very much.
06/29/2011 (5:16 pm)
Ok. I see. Simply put I'll probably be doing it your style. If there are other ideas I'll still check those out in case anyone knows a better way.Thank you all very much.
#14
06/30/2011 (8:27 pm)
Why not just wrap a cylinder around the projectile (non-colliding) with a transparency and a glow/emissive effect? A 4-5 sided cylinder shouldn't be too taxing on resources.
#15
It is a nice idea Dustin. :)
07/01/2011 (6:49 pm)
That's a nice idea for a alternate for those who can run it. I'm looking at having less framerate intensive stuff as well, so I can use 2 types of tracers.It is a nice idea Dustin. :)
Associate Steve Acaster
[YorkshireRifles.com]
Check out the video on this blog of mine linky.