CSG and Resource limit for this resource type exceeded

Software: Away3D 4.x

bitmapdata, Newbie
Posted: 17 August 2012 11:52 AM   Total Posts: 24

Hi, with your help I got CSG completely working and it’s super cool.  It works dynamically where the user puts a 2d shape on the screen and it ‘cuts’ it out of a 3d block.  I lowered the segmentsH+W down to 10 for cylinders. I’m reusing the mesh, geometry, and everything I possibly can. There is nothing I am duplicating as far as I can tell. When a users draws a shape I ‘dispose()’ the view3d and everything goes smoothly. This works till about 24 cylinders then I get this message:
error: Error: Error #3691: Resource limit for this resource type exceeded.
Can this come from the foreach loop that is calculating the CSG? Or does that message come only number of polygons in the view?  24 cylinders seems low. And the mesh it creates is far less complicated than some of the stuff I see you guys make. My top of the line mac runs at 108% the whole time I have the enterframe going.  I turn off the enterframe if the user isn’t using the 3d.
Thanks,
Jacob

   

Richard Olsson, Administrator
Posted: 17 August 2012 01:16 PM   Total Posts: 1192   [ # 1 ]

Please provide the full call stack of where the error is thrown from.

   

bitmapdata, Newbie
Posted: 17 August 2012 02:01 PM   Total Posts: 24   [ # 2 ]

Main Thread (Suspended: Error: Error #3691: Resource limit for this resource type exceeded.)
  flash.display3D::Context3D/createVertexBuffer [no source]
  away3d.core.base::SubGeometry/getVertexNormalBuffer
  away3d.core.base::SubMesh/getVertexNormalBuffer
  away3d.materials.passes::DefaultScreenPass/render
  away3d.materials::MaterialBase/renderPass
  away3d.core.render::DefaultRenderer/drawRenderables
  away3d.core.render::DefaultRenderer/draw
  away3d.core.render::RendererBase/executeRender
  away3d.core.render::DefaultRenderer/executeRender
  away3d.core.render::RendererBase/render
  away3d.containers::View3D/render
  com.jacob.ccp.threed::ThreeDMediator/_onEnterFrame
  org.robotlegs.base::EventMap/routeEventToListener
  Function/<anonymous>

   

Richard Olsson, Administrator
Posted: 17 August 2012 02:03 PM   Total Posts: 1192   [ # 3 ]

Ok, so it’s obviously failing when it’s trying to create a vertex buffer. In that case it sounds like you are not properly disposing your Geometry instances. Could that be the case?

   

bitmapdata, Newbie
Posted: 17 August 2012 02:10 PM   Total Posts: 24   [ # 4 ]

Possible.
I will check for sure.
What is it that I am running out of? Or what do I have too many of? Vertices,polygons, or something else?
Assuming for a second that I am disposing of everything correctly, how many polygons or geometry or whatever it is, should flash be able to handle?
Thanks,
Jacob

   

Richard Olsson, Administrator
Posted: 17 August 2012 02:14 PM   Total Posts: 1192   [ # 5 ]

You have too many vertex buffers. You can have 4096 vertex buffers if I’m not mistaken. Vertex buffers are used to store all the vertex attributes in a geometry. Typically you’ll have vertex positions, normals, tangents and UV coordinates, so four vertex buffers per sub-geometry.

You need to dispose unused instances of Geometry, so that the vertex buffers are freed and can be used by the next Geometry that you instantiate.

   

bitmapdata, Newbie
Posted: 17 August 2012 02:27 PM   Total Posts: 24   [ # 6 ]

Thank you so much I will certainly check this out.

   

Josh Strike, Newbie
Posted: 22 March 2013 07:13 PM   Total Posts: 11   [ # 7 ]

Sorry to resurrect if this is a zombie thread; but how do you trace this buffer? Certain things don’t animate properly by altering their parameters once they’re drawn—an example is trying to change LatheExtrude.offsetRadius. In this case you have to remove the lathe, dispose the geometry and draw a new one. It can be tricky to debug whether the geom’s really disposed or not…

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X