Podracer / kuda

Automatically exported from code.google.com/p/kuda
GNU General Public License v2.0
0 stars 0 forks source link

particleSystem.frames property no longer exists #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With the latest updates to Kuda, unit test 9 now logs 2 failures.  There used 
to be a property for particle systems called 'frames'.  This held an integer 
value that was the number of animated frames that the particle system displayed 
when played from beginning to end.  This is now missing.  Can you look into 
this?

http://labs.rajdye.com/kuda/unit_tests/unit9.html

Original issue reported on code.google.com by raj...@gmail.com on 17 Jun 2011 at 2:09

GoogleCodeExporter commented 8 years ago
Raj can you give an example of how you used that property?

Original comment by jpywt...@gmail.com on 17 Jun 2011 at 5:02

GoogleCodeExporter commented 8 years ago
The frames property only exists in the old ParticleSystem class (the one 
running purely in Javascript). That property is still present. The system in 
unit test 9 is a GpuParticleSystem (due to the "fast" property being set to 
true in the system config), which has never had a frames property.

To get good performance in JS, the old ParticleSystem calculates how many 
frames it needs to render (system_lifetime_in_seconds * 
rendered_frames_per_second) for each particle. It then precalculates each 
particle's position along the curve for each frame. So when the ParticleSystem 
is running, each particle just moves to its cached positions along the curve.

The new GpuParticleSystem performs these positional calculations in the shader, 
which is fast enough to be done in real time. So there's no need to know how 
many frames the system might need to render each particle at ahead of time; it 
just does it. One advantage of this approach is that things like the curve's 
bounding boxes, system life time, etc. can be changed while the 
GpuParticleSystem is running. The old ParticleSystem has to recalculate all of 
the frame positions for every particle if you were to try to change these 
properties while it was running.

Original comment by erik.kit...@gmail.com on 17 Jun 2011 at 5:36

GoogleCodeExporter commented 8 years ago
Ok, I can listen for the onRender event and increment a counter each time to 
track the number of frames rendered.

Original comment by raj...@gmail.com on 19 Jun 2011 at 7:47

GoogleCodeExporter commented 8 years ago
BTW I updated Unit Test 9 to calculate the performance statistics without the 
'frames' property.

Original comment by raj...@gmail.com on 19 Jun 2011 at 7:48

GoogleCodeExporter commented 8 years ago

Original comment by raj...@gmail.com on 19 Jun 2011 at 7:49