entity number max?

Software: Away3D 4.x

alpoman, Jr. Member
Posted: 05 March 2016 03:00 AM   Total Posts: 40

hello, i am working on a 3d level editor for a game.  my grid is a 15x15x10 grid of cubes.  with no lights, effects, and plain color material i can only get a hundred cubes cloned before my ipad 2 chokes down to 4 fps.  i know mobile sucks, especially old devices for 3d, but i have minecraft pe for ipad 2 which seems like 50 or 60 fps easy.  and my question…  i kmow minecraft pe renders its chunks in 16x16x16. cubes with such smooth speed, why cant i do this with away3d?  i know how to merge, etc to get speed, but thats not great for level editing where im constantly adding removing blocks, like minecraft.  sm i missing something, or can you just not have lots of things on display list in away3d/flash before lag kicks in,  any help appreciated,

thanks, and i love this engine, just trying to optimize speed.

btw, i get 60 fps on old pc, and 30 fps on iphone6. with around 500 cubes cloned with thei same materials. but ipad 2…. 4 fps, ouch.

andy

   

Avatar
Fabrice Closier, Administrator
Posted: 05 March 2016 01:19 PM   Total Posts: 1265   [ # 1 ]

why cant i do this with away3d…

Of course you can, its just you assume/compair with a game that displays many cubes that each one of them is an instance similar to a Mesh object in away.

In order to manipulate a large amount of cubes, or any objects you need work at buffer level and probably shader level if you really have a lot. where your scene(or a bunch of cubes) is the equivalent of a single mesh.

just to give you a hint, a cube has 8 vertices. the very same for each one of them, the difference lays into the translation. potentially in scaling if your cubes have different sizes. So basically one of your cubes is just a point on your axis aligned grid (its center), and its display is the 8 vertices around this point.

so memory wise, each cube == position, 3 floats (12 bytes) * cube, plus a single and shared description of vertices.  8x3x3 floats (72 bytes). Explains why you can have a bunch of cubes on screen at low cost if you have a dedicated management and rendering system for this. It has nothing to do with a game like Minecraft being magic or away not being able to handle.

Now, if you forget about smart shaders/highly optimised/dedicated solutions and assume you want to use away without mods.
If you push in a single vertices buffer a series of cubes vertices, like the result of a merge. You also know that the first cube is 0 to 8x3 in vertices. so your “customCubeObject” is just a range into the buffer. if you engine/editor simply add/removes and handle the offsets. You can then handle up to max length buffer cubes for a single upload in away3d. Which will render smoothly on any device.

have fun smile

 

   

therealloft, Member
Posted: 07 March 2016 01:09 AM   Total Posts: 65   [ # 2 ]

you trying to achieve something like this?

 

   

alpoman, Jr. Member
Posted: 07 March 2016 02:25 AM   Total Posts: 40   [ # 3 ]

yes that is awesome!! thanks everyone for responses!
andy

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X