Same objects in scene

Hi! I have a mesh - a column, and want about 20 copies of it in my scene, but these columns are not going to be in a row so I cant use blender’s array - they are making square shape. So now I have placed them in my code (a method initColumns which uses one mesh) because I thought it would be faster than duplicating them in blender. But its not convinient for me because now I want to make a lightmap of floor and I dont have these columns in blender.
So my question is: what can I do to be able to have everything in blender without serious impact on performance (when I want multiple copies of the same object)? My column have 300 faces, but similar situation will probably appear in the future with next objects. I’m making lightmaps because it’s much more faster than rendering these shadows.

You can do everything in blender. place them, join them (ctrl+j), bake the light map and so on.

But I mean performance aspect. Making 20 copies (but in blender these are different objects) of column in blender is 20*300 faces = 6000. If I do the same in code, it should be faster because it’s the same mesh. Right?

You’re right it will be faster to have one mesh as a general rule of thumb.
If you properly join the objects in blender it will be the same mesh too in JME.
If you don’t want to bother, You can have separate objects in blender and batch them in JME with the GeometryBatchFactory or the BatchNode.

1 Like

Ok so if my objects are just the same but separate in Blender, I can just call
and it will detect that they’re the same and use one cloned mesh?

@ubuntuser said: Ok so if my objects are just the same but separate in Blender, I can just call [java]GeometryBatchFactory.optimize(objects);[/java] and it will detect that they're the same and use one cloned mesh?

No. It was not really a great suggestion as an alternative.

If you have 10 columns with 6000 vertexes each batching them will make them one 60,000 vertex object which is not really what you want.

-create columns in code and do something funky to get light mapping
-create columns in blender in such a way that they import shared
-create columns in blender and then replace them with instances after loading (and then save it again as a j3o for later)

Edit: now that being said, counter-intuitively, for the number of vertexes you are talking about the one 60,000 vertex object may still be faster than 10 shared objects.

1 Like

Hmmm the last one is an interesting idea - havent thought about it, thanks.