space particles - preformance issues
space particles - preformance issues
hello,
i was going to simulate a ship flying through space and in order to see a movement i created sphere around the ship with lots of particles. the general idea is to use a fixed amount of particles. does a particle leave a given radius, it will be placed in front of the ship again (it actually depends on the moving direction).
i use an arraylist of IBillboardSceneNode's that are children of a ISceneNode. every frame i check distances between ship and particles (and so on...) and update the arraylist. the postition of the particle sphere i actually set using the ISceneNode (parent node).
is this an efficient way to render those particles? i think the idea is good, but my implementation looks somehow unprofessional. does anyone have any suggestions?
if not: is a parent scenenode necessary actually, since the particles arent really moving? is an array sufficent?
thanks
i was going to simulate a ship flying through space and in order to see a movement i created sphere around the ship with lots of particles. the general idea is to use a fixed amount of particles. does a particle leave a given radius, it will be placed in front of the ship again (it actually depends on the moving direction).
i use an arraylist of IBillboardSceneNode's that are children of a ISceneNode. every frame i check distances between ship and particles (and so on...) and update the arraylist. the postition of the particle sphere i actually set using the ISceneNode (parent node).
is this an efficient way to render those particles? i think the idea is good, but my implementation looks somehow unprofessional. does anyone have any suggestions?
if not: is a parent scenenode necessary actually, since the particles arent really moving? is an array sufficent?
thanks
checkout the tutorials you should see sample usage of billboardr5ive wrote:does anyone have any suggestions how to realize that?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
In Star Sonata I used a buffer of vertices rendered as a point cloud. I think it's a much better way than using a particle system.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Yeah I did something like that.
You can use SMeshBuffer and then access the "Vertices" and "Indices" array to remove/add vertices. For a point cloud your indices can just be "0,1,2,3,4,etc".
You can use the EHM_STATIC mapping, just make sure to do "setDirty" on the mesh buffer after you modify it so that it gets updated.
Then you can draw it via "IVideoDriver::drawMeshBuffer" and remember to use the "PointCloud" setting in SMaterial. Set the material first using "IVideoDriver::setMaterial".
You can use SMeshBuffer and then access the "Vertices" and "Indices" array to remove/add vertices. For a point cloud your indices can just be "0,1,2,3,4,etc".
You can use the EHM_STATIC mapping, just make sure to do "setDirty" on the mesh buffer after you modify it so that it gets updated.
Then you can draw it via "IVideoDriver::drawMeshBuffer" and remember to use the "PointCloud" setting in SMaterial. Set the material first using "IVideoDriver::setMaterial".
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net