• 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.

FSXA Maximum Draw Calls?

Paul Domingue

Resource contributor
Messages
1,532
Country
us-california
I ran into a problem where XtoMDL wouldn't compile and after quite a few hours of trying this, that and the other I found out it was the addition of two more texture maps, a specular and bump that was causing the problem. I must have exceeded the maximum draw calls FSX or rather XtoMDL would accept. My question, what is the maximum number of draw calls and is there anyway to check this prior to exporting to X?
 
Possibly exceeding 64K texture vertices on an object? There's a way of using MaxScript to return the Tvert count but for the life of me I can't remember right now.
 
Tom, 64K for a single object? I doubt there is a single object that exceeds that amount. I used the layer mgr. and export selected on each layer adding the next layer until I found the offending layers and they all used the same material map (the one with the new spec and bump added). But if I just selected the offending layers and exported them alone they exported without a problem. I feel I'm a bit over my head on this but with a little help from my friends I'll figure it out.

The XtoMDL report generates this on failure.

Code:
Found dictionary file: ..\..\bin\modeldef.xml
OutputFile: j2f5.MDL
Output file after modification: j2f5.MDL
Creating output MDL file: j2f5.MDL
CRASHTREE no granularity specified
CRASHTREE completed in 00:00:00.1152344
error : Vertex list has too many vertices (123263), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (123263), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (123263), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list failed allocating. Most likely exceeds the 65535 limit.
error : Failed to resolve vertex: Vert37810
Usage: XToMDL.exe /KEEP /NOGUI /BATCH /NOCRASH /BMP2DDS /XMLSAMPLE /XANIM /DICT:DictFileName /OUT:OutfileName Filename.X

Felix, you have lost me. Is that a command line switch? I would like to be able to check the number of vertex draw calls from within Max prior to export if that is possible. If not can the information be found in the X file?

Paul
 
Well, if you have an object with enough mapped vertices (around 20K or a little more) and add diffuse, specular and bump textures, then possibly a Fresnel ramp it's possible to exceed 64K texture vertices on a single object. The XToMDL report is flagging 123263 texture vertices from somewhere. With the difficult material, try a select by material and see how many other objects you get and how many vertices they comprise?
 
Sorry Paul, that is a maxscript command. Select your object and enter the command in the maxscript listener at the bottom left of the main window (or hit F11 to open the listener window). It should return the number of texture vertices of your object.

Tom, I didn't think adding textures would make tvert count rise. I thought tvert count was the number of UV coordinates in your mesh. The problem could indeed come from multiple objects using the same material. AFAIK, XToMdl merges several objects using the same material into a single draw call. Whether it is intelligent enough to sense when to merge (tvert count of multiple objects does not exceed limit) or not, I don't know.
 
Thank you very much, both of your arguments have really opened my eyes towards understanding this. I was in the process of taking a lot of small parts that did not need any special artwork and collapsing all the verts and welding them into one vert in the Edit UVWs dialog then placing them on an 8x8 pixel square of color on the texture sheet to reduce draw calls. Now I'm thinking I should just make a non-map material for these objects. If I apply a single color without a map and only use the basic parameters the object shouldn't make any draw calls, is that correct? If it is I wont have a need to collapse and weld all the verts.

The MAXScript command is exactly what I was looking for. I have never delved into scripting but I will now. Thanks again.

Paul
 
The route of using the small square of color is the way to go. Even if you use the color of the part minus a material it is still a draw call. Also, note that using "$.numtverts" only works on editable mesh.
 
Hello Rob, nice to hear from you.

So if I were to have a model with no texture .DDS files applied just the standard blinn and color from the material editor it would still make the same amount of draw calls? If that is the case then what is the benefit of welding all the verts of an object and placing them on a small square of color? It would seem like unneeded additional work.

On the $.numtverts command I have been adding a mesh select or edit mesh to the top of the stack of the object I want to check.
 
Paul, instead of chasing your tail trying to find Nirvana, identify which objects are assigned to the FSX Material that's being 'overloaded with tverts'.

Select about 1/2 of them, then make a "Copy" of your FSX Material and give it a different name for identification. Change one small parameter in the FSX Material's properties (e.g., lower the Reflection Scale and/or the Specular Map Power Scale) and Apply it to your selected objects.

Problem solved.
 
Paul, instead of chasing your tail trying to find Nirvana,
That's a neat little trick and it worked for most of the errant objects but has not totally solved my problem. It has given me some incites though.
I have found Nirvana in the embrace of my fifteen month old granddaughter.
 
I've tried spreading out the objects that all use the same texture map over as many as five slightly changed copies of the same material and still have the same problem. I have noticed that I get two different error reports, one for Export and another for Export Selected.

If I Export I get this,
Code:
Found dictionary file: ..\..\bin\modeldef.xml
OutputFile: j2f5.MDL
Output file after modification: j2f5.MDL
Creating output MDL file: j2f5.MDL
warning : Degenerate poly detected in file (D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\3DSM7\Plugins\j2f5.X) mesh (Body_poser)
warning : Face vertex 0 x=0.137565  y=-0.216023  z=0.047645
warning : Face vertex 1 x=0.137565  y=-0.216023  z=0.047645
warning : Face vertex 2 x=0.135894  y=-0.230039  z=0.045161
warning : Degenerate poly detected in file (D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\3DSM7\Plugins\j2f5.X) mesh (Body_poser01)
warning : Face vertex 0 x=0.137565  y=-0.216023  z=0.047645
warning : Face vertex 1 x=0.137565  y=-0.216023  z=0.047645
warning : Face vertex 2 x=0.135894  y=-0.230039  z=0.045161
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
warning : Pruning animating scene graph nodes with no descendant ()
CRASHTREE no granularity specified
CRASHTREE completed in 00:00:00.8925781
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list has too many vertices (148343), max allowed: 65535
error : Attempting to add an invalid vertex buffer!
error : Vertex list failed allocating. Most likely exceeds the 65535 limit.
error : Failed to resolve vertex: Vert65534
Usage: XToMDL.exe /KEEP /NOGUI /BATCH /NOCRASH /BMP2DDS /XMLSAMPLE /XANIM /DICT:DictFileName /OUT:OutfileName Filename.X
If I use the selection tool and select the entire model and Export Selected I get this,
Code:
Found dictionary file: ..\..\bin\modeldef.xml
OutputFile: j2f5.MDL
Output file after modification: j2f5.MDL
Creating output MDL file: j2f5.MDL
error : Error loading .X file: (D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\3DSM7\Plugins\j2f5.X).
Is it a valid FLIGHT SIMULATOR '.X' file?
(0): error : XToMdl.exe Unhandled Application Exception
(0): error : Error in the application.
(0): error : -2005531760 (Unknown)
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
(0): error :
(0): error : Error in the application.
(0): error :
(0): error : Stack Trace:
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XFileLoader.LoadFromModelFile(ModelFile FileInfo)
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.ModelFile.LoadFromXFile()
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.LoadAllFileData()
(0): error :  at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error :  at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)
 
I concede defeat and have reverted back to a previous version of the model. I'll work it again in the same way and see if I encounter the same problem. Arno, delete this thread and spare me any further embarrassment. :(
 
Have you checked if anything is hidden and/or frozen? That might explain the difference between export and export selected.
 
Yes Tom, since I work with the layer manager it is easy to check for frozen or hidden objects, never cared for named selections except in sub objects.

The problem started when I was trying to organize all the files that have accumulated in the development of my Duck. With three variations -4, -5 and -6 as well as eight different liveries and all the other miscellaneous files involved it was getting confusing. So I decided to separate each version into their own folder systems. I began working on the -5 (my base model) specifically on the R1820 radial, which is way overly detailed, to reduce the draw calls. Somewhere in this process the problem showed up and after spending many hours trying to figure it out I just gave up and went back to square one.

I have put it aside for now and have jumped back into my Aero 145 since I got some good news yesterday that a premier texture artist wants to slap some paint on it.

Thanks to all of you for your input.

Paul
 
Back
Top