Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Particle System Processing

Author
Message
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 21st Mar 2012 17:07 Edited at: 28th Mar 2012 00:35
Have a few issues when processing my Particle System.

1. Source Emitter Delay

Now source emitters are emitters contained within a particle system. You can have any number of them and they all come with there own settings for example:

Kill Emitter On Deactivate
Kill Emitter On Completed
Duration Distribution Method >
- Constant Float
- Uniform Float (range: lower/upper)
- Key Frame Constant Float (curve)
- Key Frame Uniform Float
- bRecalc (if TRUE, get new float from range every loop)
Emitter Loops
Spawn Distribution Mehtod > (spawn rate)
- Constant Float
- Uniform Float (range: lower/upper)
- Key Frame Constant Float (curve)
- Key Frame Uniform Float
- Scaler (spawn rate multiplier)
Delay Distribution Method >
- Constant Float
- Uniform Float (range: lower/upper)
- Key Frame Constant Float (curve)
- Key Frame Uniform Float
- bRecalc (if TRUE, get new float from range every loop)
Delay First Loop Only
Burst List
Burst Method
Max Draw Count

You'll notice that the emitter has nothing to do with display. This is because in my system particles have no appearance when emitted. I'm using an event based particle system, so each event handles the appearance of the particle.

Now I'm having an issue implementing Delay. First lets look at how the emitter is processed.

Pseudo code cause there to much code to post so I just simplified it.


The question is how do I delay the source emitters based on the emitter elapsed, given the fact there could be loops, different spawn rates, burst lists and etc?
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Mar 2012 18:07 Edited at: 21st Mar 2012 18:09
This sort of code is for timing...

If t<= timer()
t = timer() + DelayTime... 1000 = 1 second
`Do whatever..
endif

And for multiple object you can use t1,t2,t3 etc, DelayTime1, DelayTime2..etc. In dims t(100) DelayTime(100)

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 21st Mar 2012 23:09 Edited at: 28th Mar 2012 00:35
Well it's seemed to be far more complex than you'd imagine, plus using that method you'd end up with huge arrays. I needed a way of not storing anything and having it purely down to calculation, given that you'd have to calculate with the stored values anyway. As I was writing this I figured something out and it worked. Here's the method I came up with. Might need some more tweaks but works as intended.



Cheers for the advice though Pincho Paxton
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 22nd Mar 2012 13:31
Well next issue.

2. Spawning

What is the best method for spawning, currently I'm using this:

// oldDelta = last frame tick
lastFrameCount = (elapsed-oldDelta) * (spawnRate*spawnScalar)
thisFrameCount = elapsed * (spawnRate*spawnScalar)

// this is so no particles are lost between frames
spawnCount = (thisFrameCount-lastFrameCount)

if spawnCount <> 0
// < spawn the count >
endif

Now this is pretty basic, I didn't think it needed to be incredibly accurate. But there might be a better method.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Mar 2012 00:47
3. Wind

Never been able to get this one down. Using a direction vector and some random velocity changes never seemed that good. If I want wind, I need to look into frequencies and 1d/2d perlin noise. So any idea's where I should start?
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 4th Apr 2012 15:28
Anyone have idea's for wind at all?


Join or Support!
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Apr 2012 18:17
What ideas? I did not get it. Just add wind power to particle position.
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 4th Apr 2012 21:13
Instead of just random velocity changes, perhaps try giving the wind on/off states that are switched between at random and whilst the wind is on its velocity builds up to a maximum value and whilst its off it dies back down. These smooth transitions may help make it look a little more natural.


Previously TEH_CODERER.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 15th Apr 2012 02:55
Went with 3D perlin noise to generate wind turbulence. That's more what I was looking for. Cheer's for the advice though.

Point Sprites

Still stuck on this. Not getting them to work but using them with a high functions set. For instance, how would you apply multiply textures/blending methods on them?


Join or Support!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2012 16:34 Edited at: 20th Jun 2012 16:34
Using a Seed for Calculations

How does this work?


Join or Support!

Login to post a reply

Server time is: 2026-07-08 03:49:06
Your offset time is: 2026-07-08 03:49:06