During my last days I've been working on implementing new class for my nodes. I took the conception to make each node not 1 by 1 quad, by n by n quads. This means that each my node will consist of n by n nodes (16x16 for example). After the node is being created, it's transformed into a single mesh and then attacked to the scene. The reason for this was bad frame-per-second rate with previous ways, because each frame each my quad was send to GPU for rendering. And because of huge amount of quads, each sending slowed down the performance. GPU can handle complex meshes very fast if sent to GPU as a single mesh.
So, by rewriting the Node class to this new approach, the fps increased more than 100 times! Now that's what I call HUGE :)
Also, the node's constructor allows now to set the desired amount of quads on each side. The example below shows the cube with 128x128 quads on each cube's face.
And with this one it's still over 150 frames per second.
No comments:
Post a Comment