Yes I am using render.setShaderAuto(), I am using 1.9.4. so I think I will some improvement the next release version.
I am also using PStats and I think I have to many Geoms. I’m making an airline manager game and it’s in a view where the scene consists out of an airport with aircraft on it. With 35 aircraft I have about 900 - 1000 Geoms, this seems too many and unnecessary as well. + I would like to have 100 aircraft on my scene which would even be too much for a high-end gfx card.
I am having a specific problem now I could use help with.
Those aircraft are composed out different models to get variation between aircraft types:
- The fuse and tail are loaded out of one main model file
- If the aircraft type has variations, the wings and engines are loaded out of a different model file
- A couple of other nodes like the nose wheels and lights which are animated
With the first two things, loading the basic model (fuse/tail/wings/engines) I have this issue:
I compose objects like this:
aircraft_model = aircraft.attachNewNode('aircraft_model')
ac_mainfile = loader.loadModel("models/aircraft/" + model_filename)
if variation_in_types:
wing_engine_mainfile = loader.loadModel("models/aircraft/" + wing_engine_filename")
else:
wing_engine_mainfile = ac_mainfile
ac_mainfile.find('**/fuse').reparentTo(aircraft_model)
ac_mainfile.find('**/tail').reparentTo(aircraft_model)
wing_engine_mainfile.find('**/wing').reparentTo(aircraft_model)
wing_engine_mainfile.find('**/engines').reparentTo(aircraft_model)
aircraft_model.flattenStrong()
aircraft_model.analyze()
This is the result of the .analyze():
D328
2 total nodes (including 0 instances); 0 LODNodes.
0 transforms; 0% of nodes have some render attribute.
1 Geoms, with 1 GeomVertexDatas and 1 GeomVertexFormats, appear on 1 GeomNodes.
1631 vertices, 1631 normals, 0 colors, 1631 texture coordinates.
GeomVertexData arrays occupy 90K memory.
GeomPrimitive arrays occupy 11K memory.
1779 triangles:
0 of these are on 0 tristrips.
1779 of these are independent triangles.
0 textures, estimated minimum 0K texture memory required.
B77ER
2 total nodes (including 0 instances); 0 LODNodes.
0 transforms; 0% of nodes have some render attribute.
3 Geoms, with 1 GeomVertexDatas and 1 GeomVertexFormats, appear on 1 GeomNodes.
2979 vertices, 2979 normals, 0 colors, 14895 texture coordinates.
GeomVertexData arrays occupy 536K memory.
GeomPrimitive arrays occupy 19K memory.
3213 triangles:
0 of these are on 0 tristrips.
3213 of these are independent triangles.
0 textures, estimated minimum 0K texture memory required.
The thing is, that both aircraft have 1 GeomNode but both have a different number of Geoms? The first aircraft shown in this example, is loaded out of 1 file, the second out of two. Some aircraft even go up to 5 Geoms…
Does anybody know how to solve this?
I also have a question about the 3rd part, the animated objects. I think I could add them to a separate rigid body combiner node because they all are low poly objects. If I, just to test, put my aircraft entirely in a rigid body combiner, my animation time in PStats takes over the fps. I figured this could be because the entire aircraft is animated and Panda has to recalculate animation for the entire aircraft model (4000 polys instead of 50) every frame. If I draw the right conclusion, is it possible to make the rigid body combiner calculate animations relative to the aircraft instead of render?
If not I could keep the aircraft model and the rigid body combiner separate, but I would like to know how it works.