The trick we are doing is to build a composite texture whcih consist of all
the small particle textures, generally in greyscale with alphas.  Then we
use a geometry updator against dynamic byref arrays of floats.  We vary the
texture size and orientation for every visible particle on every frame.
Another trick is to change the texture coordinates to cause the texture to
rotate, although you can do the same thing with the vertices.  Our particle
system manager actually manages all the visible particles in a single
geometry updator.  All the various emitters feed the manager, who then owns
the particles until they have decayed.  This has the added advantage of
allowing the manager to adjust particle densities and increase decay rates
if the system reaches critical saturations.  My suggestion would be to
manage the particles yourself and not use seperate shapes unless you need
to.

David Yazel
http://www.cosm-game.com




----- Original Message -----
From: Marc Palmer <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 31, 2001 12:54 PM
Subject: [JAVA3D] Best way to deal with many "duplicate" objects such as
particles?


Hi,

I've written some particle system code that I am rendering with Java3D.

What is the most efficient way (in terms of performance, not less memory)
to render thousands of identical shapes that are at different locations
in the scene, and change their position+rotation every frame?

Currently I am creating one Shape3d with the Geometry set by my code that
creates a double[] with all the vertices for all the particles that are
in the system. This means I don't need any transform nodes as all
particles are transformed and their vertices written to the geometry.

However I now come to add texture support for these particles, and
supplying the texture coordinates. These are likely going to be the same
for every particle and yet I will have to set them for every one, as the
single shape contains all of the vertices for the thousands of particles.

Is there any better way of doing this for high performance?

Is there some way of reusing a the geometry for a single particle without
creating one shape object for every particle and pointing it to the
shared geometry and transforming each one individually?

Is there are hardware that accelerates this kind of "replicate and
transform" functionality that Java3D could take advantage of?

Thanks in advance.


=========================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to