omni360 / kuda

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

cannot translate the position of a GPU accelerated particle system #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please look at unit tests 9.  It should show 2 particle systems in different 
locations, but it does not.  They are in the same location.  The attempt to set 
a parent object for the blue particle system, then change the location of the 
particle system by translating the parent fails.

This same process works with a non-GPU accelerated particle system.

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:14

GoogleCodeExporter commented 9 years ago
Thanks Raj, it is now assigned.

Original comment by jpywt...@gmail.com on 17 Jun 2011 at 4:59

GoogleCodeExporter commented 9 years ago
GpuParticleSystem does not use the parent transform to position its bounding 
boxes. I can provide a convenience function to translate all the bounding boxes 
at once. To keep the APIs similar, I'll write a convenience function for 
non-GPU ParticleSystem that just moves its transform.

Original comment by erik.kit...@gmail.com on 17 Jun 2011 at 8:46

GoogleCodeExporter commented 9 years ago
Added convenience function translate(). Updated unit test 9 to use new function.

Original comment by erik.kit...@gmail.com on 17 Jun 2011 at 10:47

GoogleCodeExporter commented 9 years ago
Thanks for adding this. This solution results in some difficulties for me. 
Translating a parent preserves the particle systems local coordinates, and only 
alters the parents position in the world.  This is how the slow particle 
systems work. See unit test 8:

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

The solution that you implemented leaves us with a particle system with no 
local coordinates. This inconsistency adds significant complexity using the 
particle system.   I see you have chosen not to use a parent transform when you 
wrote the GpuParticleSystem Class.  Maybe there is an way just to give the 
particle system a parent that can be translated ? So that Unit 9 test 5 will 
pass:

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

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

GoogleCodeExporter commented 9 years ago
Unfortunately, the fast particle system can not currently use the transform 
hierarchy to change its position in the world. The shader code that calculates 
vertex positions along the curve calculates the world matrix and inverse 
transpose matrix from scratch. If the world matrix was already precomposed with 
unknown translations, rotations, and/or scales from a transform, it would much 
more difficult to reliably calculate the proper matrices.

The bounding boxes are intended to be in world space (to give the curve system 
a more natural WSYIWYG feel). Could the unit test check the coordinates for 
accuracy in world space rather than local space?

Original comment by erik.kit...@gmail.com on 20 Jun 2011 at 3:55

GoogleCodeExporter commented 9 years ago
yeah I can change the unit test. Thanks for the quick response.

Original comment by raj...@gmail.com on 20 Jun 2011 at 9:39

GoogleCodeExporter commented 9 years ago

Original comment by erik.kit...@gmail.com on 23 Jun 2011 at 7:36

GoogleCodeExporter commented 9 years ago
This has been verified and made it into release 1.4.0.

Original comment by jpywt...@gmail.com on 3 Aug 2011 at 3:51