Huge batch of objects

Hey,



For a project we are working on we have to create a harbor/port simulation. But we are facing some real performance issues.



We have to draw over 50.000 containers, 100 automatic guided vehicles (agvs), 40 cranes, ships, trains, lorries and the entire harbor platform.



We didn’t even draw the containers yet and we already are facing an average FPS of 10.



So my question is how we can improve performance, we are using medium detailed textures.



And some other things we didn’t manage to figure out are:


  1. Is it possible to disable shadows and light effects, if yes, how can this be done?



    Any help is appreciated!



    Thanks in advance,



    Matthijs Koopman

regarding shadows:



[java]setShadowMode(ShadowMode.Off);[/java]



To disable lighting entirely, you should switch to a material like; SimpleTextured

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_material



It sounds like you could really use hardware instancing of objects. It’s currently not available though, and in the meantime, “batching” is probably what you would want to use:

http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/geometry-instancing-1/



It requires the objects to be static and use the same material though. It won’t work if you need to move the containers.

1 Like

Most containers don’t move, just the ones being picked up or delivered. You also don’t need to draw the ones that are buried, which are most of them in the stack.

Very interesting. Is this for the Rotterdam Delta terminals? Ive worked there on the controls sytems (PAS/PCS(+),TMS,dynacore,TSS,manned and unmanned equipment) in various IT capacities and always wanted to incorporate game graphics there because what they have is so limited. Care to expand?

You’re right.

Might be worth looking into how Minecraft handles the huge amount of objects it has (if that info is public). The containers would behave similarly to the terrain cubes there (and it’s java).

@rickard Thanks for your reply, i’ll certainly give the batching a try.



@durandal It is indeed something like the Rotterdam Delta Terminals, only this is a school project. The assignment is to create two applications. The first one is the controller, this one should manage all the work. And the second application is a 3D simulator. The simulator gets it information over TCP/IP connection from the controller.



I would like to give you more information, and maybe you can give me and my team some hints on how to take care of stuff. You are free to contact me by E-mail, at matthijs-koopman@home.nl

Also worth thinking of: LODs.



I don’t know what your object poly count is, or what your requirements are regarding detail, but it might be an idea to really scale down on the complexity of the objects you draw in the beginning, especially if the purpose of the app is usability.

Well, I’m assuming the poly count of a container (most common object) will be the same as a Box, just rectangulair (12 trimeshes).

I wonder, can you color different faces differently, still using the same texture, when geometry batching? That way you could batch different colored containers.

Alternatively you’ll have to make a texture atlas for that.



@matthijs: I might send you an email indeed. As for the hints, start out by researching geometry batching (or geometry instancing). There should be a number of topics about it in the last month or so.

can you color different faces differently, still using the same texture, when geometry batching


Haven't tried it myself, but if you create a material that uses vertex colors and multiply it with the texture color, it could be possible.

combine 4 textures to a large one

then use a shader that uses a int as multiplys tha basic texcoord in a way you have for the first

orginaluv*0,25

take a look at the particle material for that

EmpirePhoenix said:
combine 4 textures to a large one
then use a shader that uses a int as multiplys tha basic texcoord in a way you have for the first
orginaluv*0,25
take a look at the particle material for that

Particle, so that's using it as a texture animation too then?


the flame texture in the explosion under test in jme3



this answers your question I think