• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MDL vertex and/or triangle limit

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi all,

Since there are often questions how big and complex can my object be, I have done some research to try to find which limits there are. In this post I will try to give an overview of my findings. Please let me know if you have other information or experiences. I plan to turn this into a article on the wiki once we really know what is going on.

At first I have looked at the FSX MDL format only, I will do the FS2004 MDL format later.

The only hard limit I have found is when XtoMDL gives this error message:

ERROR: Vertex list has too many vertices (79208), max allowed: 65535
ERROR: Attempting to add an invalid vertex buffer!
ERROR: Vertex list failed allocating. Most likely exceeds the 65535 limit.

So this means that there can be a maximum of 65535 texture vertices within one model part. If you have different parts (and thus different materials) you can have more texture vertices.

I did also try to alter a X file to have different parts, but with the same material. But XtoMDL does combine them to one model part and you still get this error. So the only way to work around this error seems to be to have a different material. Of course it can be a very small difference, so that you hardly see it.

Is there a hard limit to the amount of triangles/vertices in one object? I could not find the exact number yet. The GMax gamepack quite quickly throws out of memory errors when you have a lot of triangles/vertices. But I am not sure if this is a gamepack limit or a XtoMDL limit. Some more research to be done on that.

Then to another common warning with XtoMDL:

WARNING: Index buffer exceeds maximum size.

This warning appears as soon as you have a model part that has more than 21845 triangles (21845 * 3 = 65535 indices). But since it is not an error, it seems you can ignore this warning. Objects with more than 21845 triangles still show fine in FSX (until you hit the vertex limit as discussed above it seems).

I found one catch though. When the object is prepared for drawcall batching there is another limit. In that case any object with more than 43690 triangles does not show anymore. The same applies to multiple instances of an object that are one drawcall. If the sum of all triangles in the drawcall gets above 43690 none of the objects show anymore. If the object is compiled with an empty xanim (as GMax does) more triangles can be shown.

This interesting find might lead to the conclusion that drawcall batching is not always interesting. If you place really a lot of instances or if the objects are relatively complex, it might be better to not use the drawcall batching. As your objects can disappear.
 
Messages
10,088
Country
us-arizona
Hey Arno,

We aircraft makers found that if we expanded our textures (duplicates of materials), we could make models with up to 500,000 polygons, but some where over that, memory crashes.

Through the programmer Sean's findings, it was due to Windows saving itself far memory crash. It was learned that the compiler is a 32 bit system, single core and that making a new compiler in 64bit format that the models could then be made far over the 500,000 polygon limit.

Concerning the materials limits, we just duplicate a material, make at least one change to something somewhere on the settings (or it will not dupe right) and then we side step that limitation (65,000+ on one material limit). I had to do this either 3 or 4 times in 'one' model with a single Material to get the mass model to export.

Amazingly, the models with so many polygons work fine on my antiquated computer.


I wonder how large (poly count) of a model that Sean has been able to produce now with the new Max P3D 64 bit compiler? It would be interesting to know. I wonder if it can do a million Polygons? My thoughts are that it can. We are presently at 1/2 Million with 32bit compiler.

Seans compiler uses Max, not Gmax, by the way...

Bill
LHC
 

tylerpilot

Resource contributor
Messages
254
Country
unitedstates
Hi,

Do you know what this means? The program was starting to get slow and exporting took five minuets after I attached an effect.


Error.PNG

EDIT: It does not show up in FSX.

Thanks,
Tyler
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Do you know what this means? The program was starting to get slow and exporting took five minuets after I attached an effect.

No, I haven't seen that error before. Seems to indicate some list is too big. How complex is your model?
 

hcornea

Resource contributor
Messages
2,388
Country
australia
I wonder how large (poly count) of a model that Sean has been able to produce now with the new Max P3D 64 bit compiler?

Bill,

Are you referring to THIS tool?

http://www.fsdeveloper.com/forum/showthread.php?t=126704&highlight=sean

If so, this is a 64bit version of XtoMdl.exe ... not a 64bit Max plugin. It still requires an X-file, which is where things start to come unstuck with the current Prepar3D tools.

Therefore, you still requre 32bit Max, and the export (from Max) issues are still there.
 

tylerpilot

Resource contributor
Messages
254
Country
unitedstates
Hi,

No, I haven't seen that error before. Seems to indicate some list is too big. How complex is your model?

I get this error a lot. Here is my model information.

attachment.php


I added the number of triangles with the texture vertices and it got me 29,994....nowhere near the XtoMDL 65,535 limit so I don't know why it's not exporting.

drawcall batching

Is that what Minimize Drawcalls?
 

Attachments

  • My proberties.PNG
    My proberties.PNG
    35.2 KB · Views: 2,267
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I get this error a lot. Here is my model information.

attachment.php


I added the number of triangles with the texture vertices and it got me 29,994....nowhere near the XtoMDL 65,535 limit so I don't know why it's not exporting.



Is that what Minimize Drawcalls?

The amount of vertices or triangles should be ok. Be aware it is a 65535 texture vertices limit, not 65535 triangles.

I am not sure if the texture list also has a maximum length, given you have so many different textures. I'll see if I can do some testing with that.

Drawcall minimizer is a function in modelconverterx that tries to reduce the amount of materials by combining textures on a bigger sheet and replacing colors by a piece of texture.

Drawcall batching is a FSX SP2 function that at runtime combines drawcalls from different objects with the same materials. By drawing them all at once the performance will get better.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

Did some more research, this time for FS2004 MDL files. As expected the limit there is 21835 triangles per model part. If there are more triangles FS2004 will have parts of the model missing.

The good news is that for FS2004 you can just make more parts in the X file with the same material. MakeMDL does not merge these as XtoMDL does. So that is an easy work around to get by this limit (it seems the FS2004 gamepack exporter does not do this, but if you write your own X file, like I do in ModelConverterX that works).

I think there might also be a limit to the maximum amount of texture vertices over all parts in the model and that seems to be 65535, although I still have to do some more testing with that.
 
Top