, Sr. Member
Yeah merging will merge all cubes sharing a material into a single mesh : you can still move/rotate that mesh of course, but can’t access the cubes individually anymore.
Ok so you’re sharing the geometry and sharing materials too, and you still get very poor performance. This suggest you must have quite a lot of cubes in there, I guess hundreds or more ?
My suggestion about using a texture with one color per pixel won’t help much here : it would reduce the amount of materials to 1, but you only have 2 (I didn’t know how many you had, I was expecting more) so not worth the trouble.
It’s not really rendering the cubes which eats your performance, it’s iterating through all of them : if it was a single mesh (or rather 2, one per color) performance would most probably fly at 60 FPS without any hit.
Maybe you could describe what you’re trying to achieve, as there might be other/better way(s) ?
From what I see here, unless you’re running on software mode, you’re pretty much “doomed” with this way of doing things
The only path I can think of right now would be to make it (again) a single mesh and manipulate the mesh’s geometry directly but I haven’t explored that path yet so can’t help much with how to do it. Maybe you could get some inspiration by looking a Liaocheng’s particle engine, as I think that’s how he does it (using a single mesh, each particle being 2 faces in that mesh) https://github.com/away3d/away3d-core-fp11/tree/particlesfeature
Make sure that your app is not running on software fo some reason first though