Horde3D http://horde3d.org/forums/ |
|
Best approach to optimise pickNode http://horde3d.org/forums/viewtopic.php?f=2&t=1170 |
Page 1 of 1 |
Author: | craigomatic [ 01.06.2010, 21:16 ] |
Post subject: | Best approach to optimise pickNode |
I have a scene with approximately 1 million triangles which renders fine at ~60fps (artificially limited to this) when not calling pickNode each frame. If I do enable pickNode calls each frame, my framerate takes a significant dive with pickNode taking in excess of 160ms. I've searched the forum and see that the pickNode implementation was done for convenience, so I'm now wondering the best way to optimise it. Some brief searching has turned up ideas such as colour coding, but before writing code I was hoping for advice from others who may have experience in this area. I guess one alternative is to call pickNode in a separate thread so as to not affect framerate, but I'd like to try and avoid that if possible. |
Author: | AlexL [ 01.06.2010, 21:22 ] |
Post subject: | Re: Best approach to optimise pickNode |
I'd recommend to use a collision library like bulletphysics to do the raycasts, at least for static meshes. If you have skinned geometry things get a bit more tricky, to do proper raycasts you would have to do SW skinning. But all depends on the level of granularity you need (object id might be enough for your case, or do you need proper intersection points and normals?) |
Author: | DarkAngel [ 02.06.2010, 14:56 ] |
Post subject: | Re: Best approach to optimise pickNode |
Yeah, this isn't specific to horde: but in every game I've worked on there's been two representations for each (solid) model -- the graphical representation and the physical representation. We never cast rays against the graphical representation. The graphical representation might be tri-meshes with millions of triangles. The physical representation is either low-detail tri-meshes, and/or primitive shapes (boxes, spheres, capsules, convex-polyhedra etc). When doing ray-casts, you could load low-poly meshes into horde and only ray-cast against these (instead of the regular high-poly versions) but don't render them (still render the high-poly ones as usual), or as Alex suggests, it will be much faster to use something like Bullet, which supports many kinds of object representations. |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |