Horde3D

Next-Generation Graphics Engine
It is currently 02.05.2025, 14:06

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Particle effects
PostPosted: 22.04.2008, 14:43 
Offline

Joined: 20.12.2007, 00:18
Posts: 23
Hi guys,

Has anyone made much use of the particle system? I've been playing around with it and it's straightforward enough to author some simple effects, but I think I'm missing something along the way... Infinitely playing effects are easy enough, one-shots (such as a bullet impact or an explosion) are a bit less obvious but possible. However, in the case of one shots it's not easy to remove them from the scene once they've stopped playing. I can obviously trigger an effect and remove it's node at a later time, but the problem is knowing when it's actually finished. If I remove it too early all the particles will just vanish. Now, I could handle this by storing extra data application side regarding the lifetimes of the effects but that's a workaround. Ideally the node would either remove itself (which it doesn't appear to be, though I could simply be doing something wrong) when it was finished, or I'd have some means of finding out when it was finished so I could remove it (though this would mean polling all the active effects every frame, unless there were some callback mechanism).

In the case of looping effects there will be a similar issue when stopping the effect playing. If I were to simply remove it from the scene all of it's particles would disappear, whereas it should be possible for the app to tell the emitter to stop emitting so the particles die naturally. (The same applies for stopping a one-shot mid-way through).

Is there currently a method of handling such situations?

Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Particle effects
PostPosted: 22.04.2008, 16:46 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
You should be able to stop the emitter by setting the EmitterNodeParams::EmissionRate to zero.

The best way I am aware of to figure out when to remove the emitter is to stop emission, and then wait MaxLife seconds. The problem is that there doesn't seem to be a way to query MaxLife from the effect resource, despite it being defined.

Maybe we can add a hook for this in the future.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Particle effects
PostPosted: 23.04.2008, 09:32 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I just added a EffectResParams enum to the svn trunk version to query the MinLife and MaxLife parameters (although this isn't really a bug, I think it is not such a great change that we should wait for Horde 1.0+ to integrate it)


Top
 Profile  
Reply with quote  
 Post subject: Re: Particle effects
PostPosted: 24.04.2008, 16:50 
Offline

Joined: 20.12.2007, 00:18
Posts: 23
Cheers guys :) - I'll grab that and give it a go!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group