Particle Emitter Trail
by Tim Dix (Raverix) · in Torque Game Engine Advanced · 08/08/2006 (12:35 pm) · 1 replies
I'm trying to port an effect I did in TGE to TSE, and in the process, hopefully improve a bit upon it. . .
http://123pichosting.com/images/7504preview.jpg
http://123pichosting.com/images/659oldgui.jpg
The engine effects in those shots used a Spline Triangle Strip that faces the camera for the engine trails... in TSE, I'm trying to do the same thing by modifying the ParticleEmitter to allow this option... basically, I'd want it to switch from rendering individual particles, to rendering them as a continuous triangle strip, or to render both simultaneously.
So, a couple questions... since the particles are already using the vertex buffer, I figured there might be an easy way to change rendering modes really quickly and then render the the points again... Or not, any suggestions on the best way to implement this? Perhaps using a shader for the entire effect? Thanks in advance for any help.
http://123pichosting.com/images/7504preview.jpg
http://123pichosting.com/images/659oldgui.jpg
The engine effects in those shots used a Spline Triangle Strip that faces the camera for the engine trails... in TSE, I'm trying to do the same thing by modifying the ParticleEmitter to allow this option... basically, I'd want it to switch from rendering individual particles, to rendering them as a continuous triangle strip, or to render both simultaneously.
So, a couple questions... since the particles are already using the vertex buffer, I figured there might be an easy way to change rendering modes really quickly and then render the the points again... Or not, any suggestions on the best way to implement this? Perhaps using a shader for the entire effect? Thanks in advance for any help.
About the author
Torque Owner Max Robinson
You should be able to hack the TSE particle emitter into a line tracer sort of thing by changing a few things here and there.
allocPrimBuffer and copyToVB are probably the places where you will need to make the most changes. Don't forget to resize index/vertex buffers since I guess you'll only need 2 verts/particle. I'm not sure if you can dynamically switch back and forth though, since the index buffer is inside the datablock and is filled when that is loaded.
I'm not sure how you'd do the effect "using" a shader - but hats off to you if you can figure out a way to generate the mesh in a vertex shader. That'd be cool.