Hello all,
First time poster here, and this looks like a great forum to be a member of! Anyhow, I am currently working on a side project for the PocketPC. I am trying to build a 3D Library that is a subset of OpenGL. I love the architecture because its like being back on the old machines with fixed point math and old school coding tricks
. So on with the problem.
I've got a flat/gourad version of my 3d-engine displaying 3DStudio mesh files. I've tried loading in a teapot from 3DS which is about 1000 polygons. To my amazement (well, not really, hadn't even optimized!) the thing was running at like 6fps on my Audiovox Maestro.
After a few weeks of depression, I finally began trying to find out why this could be so slow. My first inclination was the math. Its fixed point 24.8, and is not in assembly. So I decided to skip this until I'm ready for a refresher course in ARM assembly. My next inclination was to check out the preprocessing of my polygons (before the actual fills).
To make a long story short, I noticed that dynamic memory allocation was my culprit. Each frame, I would render all of the object's vertices and then create some new POLY* structs to be filled with the transformed verts (3 per poly here) which would get thrown into an array of POLY pointers "scene".
Through the powers of commenting and FPS counters, I noticed that if I were to allocate a bunch of POLY structs ONCE at the beginning, and constantly change their members, my FPS would jump up by 25FPS (before rendering). This annoyed me because I would have to have a set number of POLY objects allocated, leading to limits of the number of polygons.
So my question is, is PocketPC dynamic allocation (news, deletes) really this slow!? I've tried some HeapCreate/Alloc stuff hoping that fragmentation was the problem, but didn't notice much of a change. It seems like "new" and "delete" of many objects per frame is quite tedious to this little toy. Of course, I may be doing something COMPLETELY wrong. I'd love to hear if any of you have any similar issues, or any tricks I can use? Thanks!
Chris
First time poster here, and this looks like a great forum to be a member of! Anyhow, I am currently working on a side project for the PocketPC. I am trying to build a 3D Library that is a subset of OpenGL. I love the architecture because its like being back on the old machines with fixed point math and old school coding tricks
I've got a flat/gourad version of my 3d-engine displaying 3DStudio mesh files. I've tried loading in a teapot from 3DS which is about 1000 polygons. To my amazement (well, not really, hadn't even optimized!) the thing was running at like 6fps on my Audiovox Maestro.
After a few weeks of depression, I finally began trying to find out why this could be so slow. My first inclination was the math. Its fixed point 24.8, and is not in assembly. So I decided to skip this until I'm ready for a refresher course in ARM assembly. My next inclination was to check out the preprocessing of my polygons (before the actual fills).
To make a long story short, I noticed that dynamic memory allocation was my culprit. Each frame, I would render all of the object's vertices and then create some new POLY* structs to be filled with the transformed verts (3 per poly here) which would get thrown into an array of POLY pointers "scene".
Through the powers of commenting and FPS counters, I noticed that if I were to allocate a bunch of POLY structs ONCE at the beginning, and constantly change their members, my FPS would jump up by 25FPS (before rendering). This annoyed me because I would have to have a set number of POLY objects allocated, leading to limits of the number of polygons.
So my question is, is PocketPC dynamic allocation (news, deletes) really this slow!? I've tried some HeapCreate/Alloc stuff hoping that fragmentation was the problem, but didn't notice much of a change. It seems like "new" and "delete" of many objects per frame is quite tedious to this little toy. Of course, I may be doing something COMPLETELY wrong. I'd love to hear if any of you have any similar issues, or any tricks I can use? Thanks!
Chris