Why do objects slow my application down to 5fps?

Stupid Question Time: I am new to JMonkeyEngine and I am trying to create a world. I use a scene I created in the editor and I am trying to import some objects into it. Unfortunately, once I put them in my world, it slows down computers running it considerably (Normally to 5fps or less). The fact that just a single object (Even low poly objects) can slow a computer down that much makes me think that I haven’t programmed something important (I am just using what I found from tutorials. I don’t even know how to put an LOD control into a scene instead of just a terrain). My computer is slowish but other computers have found it hard to cope with too. Thank for all your help!

Have you looked at https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:statsview

it may give some clues?

Also you could run the NetBeans profiler to check that the issue is with the lwjgl rendering and not with your own code in the update loop or somewhere else.

I looked at the page you suggested and everything seems to be fine. Is there any sort of LOD control for models themselves so I can at least attempt to increase fps?

One object should not descrease the framerate unless you are misunderstanding frame rate or are misunderstanding how big the object is.

Note: if you had decent frame rate with nothing in the scene and then 15 FPS adding one small object then that means your graphics card is likely bottom-of-the-barrel.

Post your stats when loading the object in a simple test case. Make sure you have vsync turned off. Disable AA (in case you have it cranked up to 16x or something).

Yup, I turned them all off. I have a bad computer but I can still play many 3D games with at least 40 fps. I am just going to go ahead and assume that the comps I tested it on had bad graphics cards. I am going to try it on a few different computers this week and see if it changed. The stats all remain the same (Triangles increase slightly, some others too) and it is only the FPS that really changes. Thanks for help mates

@IdreesInc said: Yup, I turned them all off. I have a bad computer but I can still play many 3D games with at least 40 fps. I am just going to go ahead and assume that the comps I tested it on had bad graphics cards. I am going to try it on a few different computers this week and see if it changed. The stats all remain the same (Triangles increase slightly, some others too) and it is only the FPS that really changes. Thanks for help mates

But what ARE the stats? Post a screen shot or something.

From our perspective this could be a case of “Oh, there’s only 100,000 triangles, so not that big.” or “Oh, there’s only 10,000 triangles in 10,000 objects… so not that many.” Or it could be that you have a bad graphics card.

We can’t possibly help without more info.

Ok, here are some screenshots of the application. Unfortunately, the fps always drops to zero when you release focus but the other stats remained the same:

http://imageshack.us/photo/my-images/194/74yc.jpg/
http://imageshack.us/photo/my-images/546/lj7e.jpg/

Can’t view. Too many noisy popups.

Maybe try imgur next time. (Still have trouble believing people don’t just use imgur all the time.)

Dang, I knew there was another image service I used to use, I just couldn’t remember it! I have to remember that next time.

@IdreesInc said: Dang, I knew there was another image service I used to use, I just couldn't remember it! I have to remember that next time.

What I did see before closing was something like 600,000 triangles. That’s a lot of triangles for a “small” object.

Do you have grafic drrivers installed? or use the stock windows ones?

just because you can run other games with good framerates doesnt mean you’ll be able ot easily make similiar games and run them with the same performance.

Most games undergo large amounts of optimization to bring a smooth experience. A game isn’t a simulation, it’s an illusion. You dont need to actually model a real tree, you need to come up with a model that looks like a real tree. You could probably create a similiar tree with 1/10th the number of polygons.

You should reduce your triangle count. 100,000 or less should give you 60 fps. A game like Grand Theft Auto uses 100,000 or less. How do I know? I’ve been testing these things.

The trees and the terrain you are using I’m pretty giving you these many triangles. To test this theory just load many simple textured cubes from blender. That should show you how fast your computer can go. Also, this should help you debug any future bottle necks.

Lack of graphics card memory maybe? How big are the textures used in that tree? Seems like a monster of a tree. You also have 68k triangles in a blank scene. Try reducing the size of the terrain.

FYI any mid-range to card in this day and age should be able to cope with around 100 million polygons per second. That’s 1 million polygons at 100fps. If you’re aiming for gaming rigs (as opposed to 2-4 year old laptops work laptops), you probably don’t want to exceed 5 or 6 hundred thousand - though take that with a pinch of salt. Post effects are usually card-specific on performance, for example, Anistropic Filtering usually has less of a hit on ATI cards than it does on nVidia - again - i’m sure we could argue until the cows come home. Lastly, CPU performance is critical as we all know, don’t forget that. At the end of the day the advice can be summarized in one sentence: If you can lessen the load through optimization, LOD, smaller textures, smoke and daggers, then absolutely do it.

I have noticed that the tree uses a considerable amount of triangles. Over 100000 actually. I am using the plugin from here: http://hub.jmonkeyengine.org/forum/topic/tree-generator/ and nobody else has reported these problems. Is there an LOD control for models?

There is a LOD control, however the model itself needs to contain those levels of detail in order for it to work. I have never used that plugin, but you can get far prettier tree’s than that model - using far less triangles than that - take a look at blendswap.com - they usually have some good stuff, but remember to take note that jmonkey currently only supports blender v2.63 at the time of writing. Tree’s are pretty trivial, and - in games anyway - most of the detail comes from normal maps rather than actual modelling.

@IdreesInc said: I have noticed that the tree uses a considerable amount of triangles. Over 100000 actually. I am using the plugin from here: http://hub.jmonkeyengine.org/forum/topic/tree-generator/ and nobody else has reported these problems. Is there an LOD control for models?
Not sure LOD will help you here, the tree seems to be made of a LOT of leaves that are probably quads themselves, so the LOD generator will just return "mehhh". Still if you want to try it you have a LodGenerator class that allows to generate lod then you have a LodControl that allow to swich lod levels according to the distance from the camera.

As a better option, I guess there is probably a way to tweak the trees in the generator so that it has a correct amount of polygons. 100000 triangles is way too much for a single tree. It’s the polygon budget you should aim at max for your entire scene considering the low hardware.
I use tree[d] from frecle to generate trees. It’s a free software and you can generate decent looking trees with around 500 triangles.It can export to obj.

@jayfella said: but remember to take note that jmonkey currently only supports blender v2.63 at the time of writing.
I use blender 2.68 with no issue. Tree models should import fine from that version.