Tuesday, December 11, 2012

geometry instancing optimization

Been making progress, just haven't updated blog in a bit.
I spent a lot of time trying to optimize the kxCube->Fracture function.  Instead of spawning new kxCubes for each sub-cube I was adding new cube meshes to the existing mesh's meshbuffers. It took me a while to get all the matrix manipulations right, to be able to update the position and rotation of each meshbuffer.  But what I soon came to find was that because all the meshbuffers were children to the original mesh and node, all those extra matrix calculations to normalize the vertex positions before updating rotation and offsetting position from stored original positions, etc.  was not optimizing.  It was more work and obfuscation of code to achieve the same.
   If I wanted real optimization I'd have to look into geometry instancing on the gpu.  I looked into that briefly, and it seems doable, but complicated.  And seeing how I have little experience with shaders and working on the gpu I decided to postpone that effort.  Kyuplex development needs to continue.  I can't spend too much time on such a side project.  Much as I'd like to, that will have to wait for kyuplex 2.0.

No comments:

Post a Comment