Performance

guest, or should I say cep21, everything in that scene is XML for Md2. I dunno, i sorta like it bloated, that way, when I burn it to CD, it takes up some room, not just 14Mb! :smiley:



Na, just messing, the compression would be fantastic. It would also mean that I dont need to write my own encryptor. I just encrypt all .xml files into, say .DP files! and decrypt accordingly.



Looking forward to XmlToBinaryConvertor.

I don’t know how you are getting your framerate so high. I’m just messing with a very simple scene showing 1 TriMesh with about 5400 triangles and only get about 80 fps.



If I up it to 19200 triangles I only get about 60 fps.

If I up it to 30000 triangles I only get about 55 fps.



This is all without lighting or textures.

As a side note… Almost all my time is being spent in com.jme.sceneSpatial.onDraw according to the profiler. :slight_smile: Of which, the actual renderer.draw is not even half the time. So just figuring out the culling is taking more time than drawing itself.

Yeah, this is going to be very dependant on your CPU. What are you running on? (cpu/mem and vid card)

Cool, I misread you before… that’s 30k TRIANGLES, right? That’s a decent amount. Only one trimesh though? The culling really shouldn’t take that long… As an experiment, try turning on forceView (setForceView(true)) on your trimesh. If culling is really expensive, this should give you a huge boost in fps.

Yeah, I was looking at the code for onDraw and tried that myself. Didn’t make any difference… so I don’t know what’s up.



I just added a texture… 43200 triangles… 30 fps. Ah!

If you turn off lighting and texture does that help a lot? In my own profiling I’ve noticed that textures and lighting hog a lot of time. (try using the new combine mode OFF for textures and lighting on your trimesh)

Just a quick shot of what I’m doing. The big green thing is actually 1 mesh made up of a whole lot of hexes ;).



Can you run TestTerrain? That should have around 32,000 triangles. I get 320 FPS, simply because VBO is being used. Before VBO was used, I’d run at around 30 FPS. If you have a huge speed boost in TestTerrain, maybe you should add VBO for your mesh.

And of course this means, only cards that support VBO will get the improvement… so that’s a drawback.

Does anyone have some reliable information on how many triangles per frame are in a mid range game these days? Say Half Life (the original one)?

btw, if the green hex field is your game field, you really should break it up into many smaller trimeshes so when you are closer it can render just what is fitting on screen… software culling works at the object level so if you only have one object, no culling can be accomplished :slight_smile:

I can’t run the terrain test right now since the latest cvs update seems not to build. Errors in LWJGLRenderer, Node, and ImposterNode…?



Anyhow… what’s VBO? :slight_smile: Maybe just a thread link?

"renanse" wrote:
btw, if the green hex field is your game field, you really should break it up into many smaller trimeshes so when you are closer it can render just what is fitting on screen... software culling works at the object level so if you only have one object, no culling can be accomplished :)

That's how I was doing it at first, but the performance hit was even bigger! Then I couldn't get but maybe a few hundered hexes on the screen at a time without getting down to < 20 fps.

That's why I switched to the one big mesh and one texture.

Of course I run into other problems, like selecting individual hexes...

Just pulled CVS down cleanly, and built fine. Try again, getting the clean copy.



You can also try running the TestTerrain off of webstart. (demos page)



Something very odd is going on if you have worse performance with a split game world.

"guurk" wrote:
I can't run the terrain test right now since the latest cvs update seems not to build. Errors in LWJGLRenderer, Node, and ImposterNode...?

Can you be more specific?

The type LWJGLWireframeState is ambiguous LWJGLRenderer.java Line 133

The type LWJGLTextureState is ambiguous LWJGLRenderer.java Line 132

The method getCenter() is undefined for the type Quad ImposterNode.java Line 222

The type BoundingBox is ambiguous TestSphere.java line 171





Just to give you an idea… When I use individual hexes my map creation time takes exponentially longer. Plus it’s slower. This map is just 40x40 hexes. So

9600 triangles. It’s getting about 27 fps. And I’m not even showing them all, so some are culled.



"guurk" wrote:
The type LWJGLWireframeState is ambiguous LWJGLRenderer.java Line 133
The type LWJGLTextureState is ambiguous LWJGLRenderer.java Line 132
The method getCenter() is undefined for the type Quad ImposterNode.java Line 222
The type BoundingBox is ambiguous TestSphere.java line 171

bizarre... sounds like you have two copies of the source code or something for those kinds of errors. Are you building with eclipse, ant, or what? Also, please dbl check your hd for extra copies of the source or extra jars. Maybe wipe out your existing jme source and recheck out from cvs.

Finally, is it possible for you to send me what you are working on in a zip or something? I'd love to give it a once over here. (see my profile for email)

Sorry, added the jme.jar file to the eclipse libs. ://



Anyone have examples of using VBO? I tried to set them on the mesh, but fps didn’t make any different. Got the terrain test running, 32K + triangles, almost exactly the same fps 25 - 32 for me. So I guess that’s just the limit.

VBO is graphics card dependant, and you need a good graphics card to support them. I have a radeon 9200 and it isn’t supported. I think you need at least a 9500, but thats a guess, so dont quote me.



DP