Blender mesh instancing & a touch of physics

My question is: In blender if I create an object then create multiple Instances of it using alt-D, will that same mesh when imported via the assetManager, also be instanced such that the original mesh is shared.

In addition does shared meshes (spacials) also ‘improve’ performance in regards to pyhsics?

i.e. right now I have a scene with 150k vetrices, and I’m actually getting great fps (~500fps) on this hardware (geforce 570…and naturally I’m hoping for it perform good on lesser hardware)…but…the physics feels a bit off. Currently I have quite few objects that are complete duplicates vs shared instances…could making them shared instances help?

any tips/pointers/etc…greatly appreciated.

ps. secondary question (blender topic): I noticed when instancing object via alt-d, that If I alter the original mesh…the instances are not changing…is there a way to actually have it so that it does?

hi man!

about instances in JME:

You can share meshes, but JME does not have GPU instancing at present. Coredevs said it will be in JME 3.1. But you can use BatchNode(if you have 100 objects in the same place with the same mesh, so it will be faster).

To share a mesh for many geometries you can use Clone():

[java]Geometry geo2 = geo1.clone(false);[/java]

If you have 100 instanced objects in one blend file, so they will not be shared. As @Momoko_Fan said: “JME cannot get which mesh is shared in the blender scene”.

I did some tricks with blender in this project:

I use blender scene file and separate blender models. Then I convert them to j3o by j3oconvertor.

About physics, as far as I understand there is no optimization of shared meshes for Physics primitives and physics custom meshes. As Momoko said me.

… just combine the objects in blender to one mesh and make sure they one texture, then they are also one geometry in jme.

hmm, not sure conflicting responses…

Norman what exactly do you mean by combine the objects, wouldn’t that result in the object simply consisting of multlple meshes? (spread out in the scene)

I figure that yeah.I could load only 1 instance of the object in question (A Column, I have about a dozen plus columns in the scene), and then clone that out internally in code (sounds like that’s what Mifth is suggesting), Obviously I would prefer to avoid having to place the objects in the scene programatically…so not the desired option. (as of right now, the objects do all share the same material).

ps. I assume a Shared Geometry (if say shared 2 times) will still show up as multiple counts with respects to the stats in the vertex counts?..i.e. I will see the vertex count of the original object counted 2 times…so I had 1 cube (say 8 vertices), and share (clone) it out once I would see 16 vertices…not 8…or would it only be listed once?

I’m looking forward to 3.1…but I think we have ways to go yet :slight_smile:

Read the jme and blender manuals, an object in blender is about the same as a geometry in jme, only that jme has to split objects on import into multiple geometry if they use multiple textures as one geometry can only have one texture. Keywords: baking, texture atlas, game compatible models

JME has no GPU instancing yet. The same mesh will be sent to GPU as many times as many shared meshes you have. BatchNode will save you in some cases.

In one place I had 700 asteroids. I had 150 fps.

After using the BatchNode i had 350-400 fps.

@mifth, why you keep confusing people with things they didn’t ask for :? He asked how he can improve the rendering performance, not what he can not do… also he was talking about the physics… and what you say is wrong, the mesh is only sent once, batch or not… its the separate rendering of geometries (due to shaders and their values) that cause bus overhead.

Momoko said a shared mesh sends every time… no GPU instancing…

Sorry for confusing…

@mifth said:
Momoko said a shared mesh sends every time.. no GPU instancing...

You mix up several things there.

If you use OgreXML .scene export then the meshes are shared as intended.

All bets are off with the Blender import though, it is pretty much alpha at this point