I have to write once more here in the forums in hope to maybe find some tips about why my FPS is so bad.
here the geometry I am rendering.
I procedurally generate this geometry. My FPS is a poor 16-20 fps on a decent Laptop computer.
The plane you see is made of 4 geoms with 128 triangles(32 each) added to 4 primitives (1 each) (as GeomTriangles).
I know I could reduce this to 1 geom with 1 primitive but in this example there is a reason why there are 4 geoms (I believe it shouldn’t really matter right now as of “why” there are 4 geoms).
I definitly don’t generate the geometry more than once at that stage. What you see is generated once and then set as a node in the scenegraph.
I could show some code (although I would probably have to reformat it to make it easier to understand).
I could also show some pstats if that would help.
I have to admit I am getting a bit frustrated with the the performance
Certainly 4 geoms with 32 triangles each shouldn’t be a performance problem, so something more subtle must be going on. PStats would be the first place to look–is most of the time spent in App, Cull, Draw, or somewhere else? What is the total number of Geoms and vertices that PStats is reporting being drawn?
Also, don’t overlook render.analyze() as a useful tool to see what you’ve actually got in the scene graph. And you can use AsyncTaskManager::write() to see if you’ve got any runaway tasks that are eating up your frame time (look for a large avg time value).
Also, when we get into obscure issues, I should point out that some older integrated graphics cards had a hard time rendering wireframe or other special rendering effects.
there is actually some other very simple geometry in the scene which renders at 140 fps easily if I don’t draw the grid (loaded via egg files).
The reported vertices are fo my “grid” is made of 4356 vertices (33x33x4) but that is intended as the grid that you see is LODed to “Low” (hence only 128 triangles in the primitive).
This is actually something that right now I can’t do because I am running my app from within an editor I am writing and I haven’t yet figured out how I can re-direct the ostream from panda (this was one of the next “TODOs” on my list).
My Laptop is quite new and features a DX11 Ati Mobility graphics card - the laptop should easily run my application.
While it’s true that’s a lot of time in Draw, it’s also an unexpected amount of time in the “*” (overhead) and “Cull” categories. This might mean something in your geometry is causing Panda to have to Munge it (prepare it for rendering) every frame for some reason. You can drill further into these categories to perhaps gain some insight (is it actually spending significant time in Munge, for instance?).
Well, I actually see 0.86K vertices, or 860 vertices, reported on the PStats graph. This means 860 vertices are actually being rendered each frame. Of course this shouldn’t be a problem either, but it is more than 128. I assume the remaining vertices are from this other geometry in your scene?
Put “notify-output log.txt” in your Config.prc file, and Panda will dump all its output to log.txt. But I gave you bad advice with render.analyze(); it doesn’t exist at the C++ level, you have to create a SceneGraphAnalyzer instead. But no need, just put “show-scene-graph-analyzer-meter 1” in your Config.prc file, and it will be onscreen.
Still, that’s probably not necessary; it seems from the PStats output that you don’t have runaway vertices or Geoms or anything.
Have you applied any unusual attributes to your geometry like a RenderModeAttrib or something? You’re not rendering perspective points? It’s not animated?
I have changed something in my code and the performance has significantly improved to roughly 80-90 fps. I am not entirely sure why my change has improved the fps at all to be honest but it has.
For the sake of it I show you the new pstats though
and here some of the “*” components
There are a couple of textures applied to the parent node and used in a shader - they don’t work though and the whole mesh is pure black. Dont know why that is , the shader stopped working when I moved the textures and shader to be part of the parent node rather than the single “terrain-patches” . I was expecting it to work. I might open a separate thread for that particular problem.