You were right, that solved the issue with the high Texture and Shader count. Thanks
Unfortunately the GPU Load is still pretty low and the fps aswell. Is there something I could do about the uniform count?
Or is there something at all I could do about that? (Despite reducing the poly/tri/vert count).
I cant use a BatchGeometry when I have multiple textures (like different NPCs) and especially when animating them, I guess?
You have over 1.3m vertices in that scene already. You said you have there 50 character. Thus, if i have to guess one is made of 20000 vertices or so. I would certainly reduce the vertex count for each character. (eg.: i’d use decimate modfier in blender)
I thought about reducing the vertice count but I want to keep that level of detail (i.e. don’t have it look PS2-ish).
I came up with the idea of deleting that part of the mesh that is covered by clothes but that way I cant switch clothing (having her wear a bikini)
My target platform would be PC’s with at least a ~ 4-5 years old GPU.
IIRC I had a cpu load of 1% and the RAM also had some ressources free. I did not change the Xmx or something however. It’s JMP default.
Try to reduce objects count, for example hide NPC’s that are not seen by the camera, don’t allow to show too many of them at one place. It just work this way, at every frame CPU need to do some work with all the objects. The more objects on scene, the more work to do. All that work should be done in 1/60 second, because you need at least 60fps for smooth gameplay.
If you think that you have problem with the bus, just try to remove textures. And if you have textures in png/jpg format, try to use something more ‘OpenGL friendly’, like dds. Probably, in the case that everything is ok, it would only reduce the initial loading time, but if you messed up something you should see the difference.
They are all in 4096x4096 resolution .jpg/png which I know is bad, but I wanted to have cool graphics
I don’t get why dds’ing should only reduce the loading time. I thought dds is some GPU memory friendly but compressed image whereas jpg’s get stored on a per-pixel-base?
Or rather: what could be wrong that dds makes it faster? (Maybe because the files are mip-mapped and save memory?)
But: my assets.jar has 180MiB. Even uncompressed that should be less than the GPUs 1.5GB Memory.
On the other hand I know that there are only several (10?) GL_TEXTURE0 … GL_TEXTUREN
Dds is readable by GPU in its compressed form, while jpg and png are not. Compressed jpg needs to be uncompressed and saved in memory as a raster, it needs 24bits per pixel. Same with png, but there you’ll have 32bits per pixel (8 extra bits are alpha channel).
Reduce the textures resolution to the absolute minimum. Don’t tell me that you need to have 4096x4096 for NPC.
Again, reduce the NPCs count. There is a bottleneck somewhere, try to find it.
I now checked it: The 4096x4096 are only the ones I use for walls (too high anyway).
The MakeHuman one’s are either 2048 or 1024.
I am now giving DDS a try and we will see what happens. Could I manually set a “Highest MipMap” to see which resolution I’d possibly go for? (Without the need to redo the texture everytime).
PS: If I reduce them to 10 NPCs I get reasonable 25 FPS.
Edit: I am ashamed. I only measured the CPU load whilst the Game didn’t have Focus.
I now used the profiler to change some bad designed Controls. Whilst programming them I didn’t see their impact, but it sums up.
I didn’t read all of the advices you’ve been given, but reducing the triangle count can definitely help.
But IMO here the bottleneck is animating the 50 characters on the CPU (would explain why your GPU idles.)
And that’s what you need to dig into. Sofware skinning will update the animations of your characters on the CPU by updating the mesh’s position buffer on every frame. It can strees the CPU pretty fast if you have a lot of characters.
Hardware skinning will send the transforms of each vertex to the GPU and the transformation will take place in the vertex shader.
Here it can help a lot in your scene so it worth the try.
to enable hardware skinning on a model :
as soon as you have a SkeletonControl it updates the mesh on each frame even if you are in the rest pose.
Either you didn’t do it as it should (I mean activating it), either your hardware doesn’t support it (but it should pop a warning in the console), either you have something else that is causing the strain on the CPU.
With Hardware skinning enabled you won’t have the reset called.
Try to write your own AnimControl, copy all the code and try to do some things in your way.
If it is impossible or too hard then you can make your own control, remove animcontrol and skeletoncontrol from spatial and keep them inside your control, call them only when you need.
I don’t know if these solutions are clean but in the nearest future I’ll do something similar for my own game.
My Hardware is openGL 4.x (GLSL 1.5) compatible and it Shows in console that is enabled (or atleast prefered).
I might be missing out some skeletons, I need to look into that.
Btw: multiple skeletons per char are senceless overhead aswell?
Edit: I double checked it, I have a SceneGraphVIsitor on the Spatial and for every SkeletonControl it finds, it uses .setHardwareSkinningPreferred(true); but still I get reset and updateWorldvectors calls
Edit: Mai 03, 2015 10:19:58 PM com.jme3.animation.SkeletonControl controlRender
Information: Hardware skinning engaged for Feter_Pramton:tongue01 (Node)