Possibility to free uploaded vertex buffers memory?

Software: Away3D 4.x

er453r, Newbie
Posted: 12 April 2012 10:46 AM   Total Posts: 5

Hi.

I’m creating multiple meshes dynamically (it’s a 3d reconstruction from user loaded images) and I noticed that after adding them to the scene the vertex buffers are not disposed… That is probably the way it should be, I’m not a 3d engine expert (far from it). But after uploading vertex and indices data from the CPU to the GPU the buffers still occupy precious memory…

I’m creating ~200k polygons in ~40 meshes and buffers take well over 100mb of ram. After the mesh creation I don’t need to do anything with it, just display it. Is there any way to free that memory?

What I don’t understand is that a demo from this forums thread 2003 (i can’t submit links - says its spam…) has over 180k polys and takes only 26mb of ram… How is this possible? I know it uses prepared prefabs. Can I achieve this with dynamically created meshes?

   

Avatar
Fabrice Closier, Administrator
Posted: 12 April 2012 11:34 AM   Total Posts: 1265   [ # 1 ]

How is this possible?—> Prefab’s magic smile

Prior to export, Prefab uses a set of classes that are into the engine as well,
One that gives you most efficient result is the Merge class.
It organizes the bufffers so they do use the minimum of resources.
In the worst case scenerio, your 40 meshes would become a single mesh with 40 subGeometries. You would save only on geometries and their related render loop methods. In best case, you end up with a massive single buffer. All depends how many materials are used, as you may have only one per submesh.

If applicable the Weld class can help you reduce the amount of data by sharing vertices, which of course affects uv’s, normals and tangent buffers lengthes as well. Only the indices buffer(s) remain unchanged. The class effectivity highly depends of the source mesh and the way you want the mesh surface react to the light. As it seams lighting is a bad idea on mobiles, you will have no surface property problems using these classes.

   

er453r, Newbie
Posted: 13 April 2012 08:29 AM   Total Posts: 5   [ # 2 ]

Ok, I’ve managed to get down by 75% size with buffers and a custom welding algorithm but I want more….

What is the purpose of keeping the buffers on the CPU? Shouldn’t the GPU do all the work after they get uploaded? (maybe I can achive this with pure stage3dAPI?)

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X