Page 1 of 1

Object optimization

Posted: Mon Jan 07, 2019 7:50 pm
by maymar
I would to know how to best optimizing object for sceneries.
Firs of all i made short movie to presenting how in my creating scenery change FPS during flying over Wrocław (biggest city in scenery) with lot of 3d objects.


You can see that on blue sky FPS hit 200FPS but when i point view to the object it decrase to 30-40 FPS. All object is very simple - like single box.
So, for example lets stay with that box.
1* What is count to rate FPS: vertices, edge or surface?
2* if i remove bottom surface (that is not visible when box is placed on ground) is it help to increase FPS?


Second topic that i hit during recording was strange behaviour of the glider during entry and leaving thermal - you can see it from 7:00 on the movie. Is it correct? I set wind to 0km/h, wave also all on 0, thermals as below
thermalsetting.jpg

Re: Object optimization

Posted: Mon Jan 14, 2019 3:44 pm
by KipperUK
How many objects is a lot of objects?

Re: Object optimization

Posted: Mon Jan 14, 2019 8:29 pm
by maymar
On 4 tiles i have about 3000 objects - but it depends how you count object. Between right tiles you have Wrocław city
4tile.jpg
For me one object for example of village is a 36 boxes that represent buldings.
Budynki_wies001.c3d.png

Re: Object optimization

Posted: Mon Jan 14, 2019 9:24 pm
by EDB
maymar wrote:
Mon Jan 07, 2019 7:50 pm
You can see that on blue sky FPS hit 200FPS but when i point view to the object it decrase to 30-40 FPS. All object is very simple - like single box.
So, for example lets stay with that box.
1* What is count to rate FPS: vertices, edge or surface?
2* if i remove bottom surface (that is not visible when box is placed on ground) is it help to increase FPS?


Second topic that i hit during recording was strange behavior of the glider during entry and leaving thermal - you can see it from 7:00 on the movie. Is it correct? I set wind to 0km/h, wave also all on 0, thermals as below
thermalsetting.jpg

FPS get a hit with many faces.
The stuttering in the thermal is the loading of one or multiple very large files that get into (visual) range I think.

Do you remember the Hahnweide SW Germany scenery in Condor V1..? If you came within 10km of the Hahnweide airport you had a very big hickup. Then the whole airport with all the details had to be loaded (unnecessary detailed for that distance). This is the same, but then with many different building blocks that are loaded when in visual range. It's better to have only some small blocks that are used everywhere and stay in memory then many different ones. And then when the FPS drop too many then stop adding objects. Even remove some not so important ones.

When flying on flat terrain you usually are very high during the flight. Then houses hardly have any height. It's better to only make objects that are higher then 15m up to 30m.

Re: Object optimization

Posted: Tue Jan 15, 2019 8:13 am
by Uros
The most critical performance factor is the number of draw calls. A draw call is invoked for each object within a C3D file. So if you have 3000 C3D files and each has 30 objects inside, that's 90000 draw calls (texture swaps) per frame!

So the golden rule is group, group, group. It's better to use one big texture and group all objects within the C3D into one object. Try to even group small C3D files into bigger ones.

The number of vertices/faces is by far less critical on todays hardware.

Re: Object optimization

Posted: Tue Jan 15, 2019 7:54 pm
by maymar
Uros, thank you for your explanation.
Now I know what to do :-)

The last question:
how big can be texture if i should merge it? Is optimal will be 2048x2048px?

Re: Object optimization

Posted: Tue Jan 15, 2019 11:27 pm
by OXO
maymar wrote:
Tue Jan 15, 2019 7:54 pm
Uros, thank you for your explanation.
Now I know what to do :-)

The last question:
how big can be texture if i should merge it? Is optimal will be 2048x2048px?

texture size is not a performance issue so much, only a memory consumption.

The texture must be dds and saved as DXT1 with no alpha.

Re: Object optimization

Posted: Wed Jan 16, 2019 5:09 pm
by KipperUK
Uros wrote:
Tue Jan 15, 2019 8:13 am
So the golden rule is group, group, group. It's better to use one big texture and group all objects within the C3D into one object. Try to even group small C3D files into bigger ones.
Just to be entirely clear for my understanding ...

Making say, a town, using 300 houses that all have different C3D files (and possibly textures) would be terrible / the worst for performance.
Would it be better to make the same town of 300 identical, but separately placed houses that all use the same C3D file and texture?
Would it be better still to make the same town of 300 identical houses and place them all into the same C3D file, so that they're placed in Landscape editor as one single object?
Is there something even better than that?

Re: Object optimization

Posted: Wed Jan 16, 2019 5:39 pm
by JBr
Even better -- put all 300 houses into the same scene, but before exporting them to OBJ, merge all of them to one scene object. Then your final C3D file would contain one big scene object of 300 houses (one "row" in the Object Editor). Given how Uroš explained things in his post, it would mean just a single draw call.

Re: Object optimization

Posted: Wed Jan 16, 2019 10:32 pm
by KipperUK
Interesting but could make creating large cities awkward, unless you throw away the idea of trying to match building locations with real ones - which is cool because nobody is going to pay *that* much attention.... however,that might lead to problems with roads that come into and out of the city.

How on earth does one UV map a whole neighbourhood? Will blender allow texturing one object and apply that to all of them?

Re: Object optimization

Posted: Thu Jan 17, 2019 8:49 am
by OXO
KipperUK wrote:
Wed Jan 16, 2019 10:32 pm
Interesting but could make creating large cities awkward, unless you throw away the idea of trying to match building locations with real ones - which is cool because nobody is going to pay *that* much attention.... however,that might lead to problems with roads that come into and out of the city.

How on earth does one UV map a whole neighbourhood? Will blender allow texturing one object and apply that to all of them?

Make the individual objects.
UV map them onto the same texture file. file may be large-ish :)
Combine objects into one object.

Re: Object optimization

Posted: Thu Jan 17, 2019 8:57 am
by JBr
KipperUK wrote:
Wed Jan 16, 2019 10:32 pm
Interesting but could make creating large cities awkward, unless you throw away the idea of trying to match building locations with real ones - which is cool because nobody is going to pay *that* much attention....
Actually, if you have a look at the default Slovenia scenery, you will notice that town and cities are done exactly like that, built from "building blocks" consisting of multiple houses/buildings.

Re: Object optimization

Posted: Thu Jan 17, 2019 10:45 am
by KipperUK
I did look at that, and figured it was probably for performance reasons but I had not been sure.

Now I am.

:)

Re: Object optimization

Posted: Thu Feb 11, 2021 3:22 pm
by KipperUK
Uros wrote:
Tue Jan 15, 2019 8:13 am
The most critical performance factor is the number of draw calls. A draw call is invoked for each object within a C3D file. So if you have 3000 C3D files and each has 30 objects inside, that's 90000 draw calls (texture swaps) per frame!

So the golden rule is group, group, group. It's better to use one big texture and group all objects within the C3D into one object. Try to even group small C3D files into bigger ones.

The number of vertices/faces is by far less critical on todays hardware.
And is Condor only making draw calls for the objects that you can currently see, or for the whole tile or whole landscape?

That is to say, if you have a landscape with lots of well optimised c3D files scattered around, are they all always affecting performance?

Re: Object optimization

Posted: Fri Feb 12, 2021 11:00 pm
by Stonks
So.... after reading all the above and summarising, Is it safe to say...

As long as the vertices/face count isn't crazy, we can model different buildings rather than just clone lots of the same "box" as long as they are all merged into one object and uv's all mapped onto one large texture file?

I dont plan on modelling towns, but different buildings local to airfields.