Author Topic: More htl D3D goodness: Particles  (Read 8884 times)

0 Members and 1 Guest are viewing this topic.

Offline RandomTiger

  • Senior Member
  • 211
More htl D3D goodness: Particles
I have added some code to process particles using D3D's point sprite system in order to try and speed things up a bit. The new system only has to send one point to the graphics card for every four the old system has to, it uses a smaller vertex structure and batches the particles as much as is possible. The new system only needs to transfer 20% of the amount of data to the graphics card.

-d3d_particle is the flag to activate this, when its fully tested and bug free I'll make it on by default. Some older cards may not support enough features to take full advantage of this which will cause the code to fall back to the old route when dealing with large particles.

I get a considerably higher frame rate for scenes with large number of particles, tell me how you get on.

http://mysite.freeserve.com/thomaswhittaker/c_code/freespace/fs2_open_r.rar

Dont forget to use the flag

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
Can't really say about performance but apparently it still mixes up a few things:



The size is way too small, and they don't seem to appear everytime (as if i set a double $Time value).
Modern man is the missing link between ape and human being.

 

Offline Deepblue

  • Corporate Shill
  • 210
More htl D3D goodness: Particles
Maybe the particles are now actually able to be adjusted with the radius function.

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
the radius function does something really different :)

The $scale function sorts out the size.

It's a bit tricky with the names and nobody seems to know this but:

$Radius:

The "thickness" of the trail where particles may appear - if you set this to 2+ you'll swarm the whole screen with particles -- this is what i used for randomizing my trails

$Scale:

THIS one manages the size of the particle. I don't know in what it measures but when i set it to 20, about half of my screen was filled with the particle.

So none of those should have changed, since they always worked, even if nobody knew how  ;)
Modern man is the missing link between ape and human being.

 

Offline RandomTiger

  • Senior Member
  • 211
More htl D3D goodness: Particles
Quote
Originally posted by Lightspeed
Can't really say about performance but apparently it still mixes up a few things:



The size is way too small, and they don't seem to appear everytime (as if i set a double $Time value).


Thats a non standard effect I take it.
You would have to supply me with a copy of what ever it takes to make that to balance it out.
« Last Edit: January 12, 2004, 01:44:37 pm by 848 »

 

Offline Liberator

  • Poe's Law In Action
  • 210
More htl D3D goodness: Particles
It looks like Lightspeeds's new Akheton effect from this thread.
So as through a glass, and darkly
The age long strife I see
Where I fought in many guises,
Many names, but always me.

There are only 10 types of people in the world , those that understand binary and those that don't.

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
it happens with any particle effect used.

i.e. where i noticed it: my morning star, my kayser, my maxim & my akheton. They're all messed up in similar ways (too small + wrong 'spawn rate)
Modern man is the missing link between ape and human being.

 

Offline RandomTiger

  • Senior Member
  • 211
More htl D3D goodness: Particles
OK, I'll look into that, I can account for the scale problem but I'm not sure about the spawn rate.

Either way its optional default off so no harm done.
Will post to thread thread when I have an update.

 

Offline aldo_14

  • Gunnery Control
  • 213
More htl D3D goodness: Particles
There's not a possibility that you had a different fov setting in the command line (for the old exe) and forgot to set it in the modified exe, is there?

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
There's not.

It's both the same exe, actually :p
(with 3d3particles enabled, and disabled)

i'm not sure if it's the spawn rate, but it looks like it is. Whatever it may be it needs to be fixed :)
Modern man is the missing link between ape and human being.

 

Offline aldo_14

  • Gunnery Control
  • 213
More htl D3D goodness: Particles
Quote
Originally posted by Lightspeed
There's not.

It's both the same exe, actually :p
(with 3d3particles enabled, and disabled)

i'm not sure if it's the spawn rate, but it looks like it is. Whatever it may be it needs to be fixed :)


ah :)

To be fair, I didn't think it would be that...but never hurts to check.

 

Offline RandomTiger

  • Senior Member
  • 211
More htl D3D goodness: Particles
Quote
Originally posted by Lightspeed

It's both the same exe, actually :p
(with 3d3particles enabled, and disabled)


Hold on there.
Could you check what happens with any other fs2_open exe?
Its possible I've introduced a bug into the general particle code in this exe.

I would like to rule that out before doing anything else.
« Last Edit: January 12, 2004, 08:11:52 pm by 848 »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
More htl D3D goodness: Particles
i accidently found out about the radius flag while tweaking my nova flak cannon. the radius sets the area in which the particles spawn. i wonder if i could make a beam out of it. can we also have a $pattern setting for differend particle spawn meathods, such as random or spiral.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
Quote
Originally posted by RandomTiger


Hold on there.
Could you check what happens with any other fs2_open exe?
Its possible I've introduced a bug into the general particle code in this exe.

I would like to rule that out before doing anything else.


no, it looks correct (like with the older build) with the flag turned off.
Modern man is the missing link between ape and human being.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
More htl D3D goodness: Particles
hmm sorry but i can't see anything that should be other with the particles
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
More htl D3D goodness: Particles
so does this replace draw_bitmap or are you running a big ole batch rndering?

is there any way to do something like draw_rotated_bitmap
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline RandomTiger

  • Senior Member
  • 211
More htl D3D goodness: Particles
Quote
Originally posted by Lightspeed

no, it looks correct (like with the older build) with the flag turned off.


So are you saying the spawn rate problem was caused by my new code?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
More htl D3D goodness: Particles
I think he's saying your build looks right whaen he doesn't enable pointsprites via the comand line
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Lightspeed

  • Light Years Ahead
  • 212
More htl D3D goodness: Particles
Quote
Originally posted by RandomTiger


So are you saying the spawn rate problem was caused by my new code?


exactly. I turn the flag off and it works fine. I turn it on and whee -- we got the effect you can see on the right: not enough particles and screwed up size. It could be either spawn rate or speed though.
Modern man is the missing link between ape and human being.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
More htl D3D goodness: Particles
I decided to give this build a try, but I got a CTD a split second into the mission.  I was using -htl and the custom flag if you're interested.  I'm thinking that this is either a hardware issue or a driver issue.  Since I'm running a GF2 MX 32MB, my card may not support this feature.  If it is supported, then it may be a driver issue, since I can't use the newest drivers for the GF2 MX.  I tried running the latest drivers for a few months, but it was a serious drain on my system, causing the screen to go black for a few seconds sometimes, occasionally resulting in a lockup.  It also created serious drags in some of my older games, so I reverted to the version I had been using since 2001... much more stable.

In any case, this older version may be resulting in the problem, if this feature IS supported by the GF2 MX.  What this boils down to, is me getting a Radeon 9600 Pro (or XT) 128MB card once my hours at work start to pick up sometime in March or April probably.

Later!
The Trivial Psychic Strikes Again!