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

P3D v5 Memory leak with MCX converted buildings

Messages
135
Country
switzerland
Since many years I got buildings from 3DWarehouse and used the convert and place object wizard. Since some time, 3DWarehouse only offers skp files for different editions of Sketchup. I use Sketchup 2019 and export a building into .kmz files, which I can load into MCX in the above mentioned method. I then check textures, resize them to the power of 2, prefix with modelname and then export them using minimize amount of textures.

Never had any problems with these so created .bgl files. But now, with a new collection of buildings for the city of Alexandria in Egypt, I encounter every second scenery loading, that my RAM of 32 GB is completely filled up. If I free it up, with a tool from iobit, it goes down to 50% but increases again to 100% within 10 seconds. Prepar3D v5.3HF2 stucks at 5% loading, cause the memory is completely filled. Prepar3D.exe is running at 30% CPU but nothing happens anymore.

If I have this scenery deselected, there is no problem. I can rework an airport and reload the scenery and it works without problem. I ran into problems with some models from 3DWarehouse, when they were too complex but then mostly already MCX couldn't read it or export it.

What can cause this? Is it the model or the textures? How could I identify the "bad" file. Maybe if I could read my RAM content like a drive, I could tell what's loaded.

Any suggestions?

If one would like to try the files and give me some feedback how it performs on your system, here is the link: https://drive.google.com/file/d/19hHKDenLGXa0mSGuIvG3CuIBLbVZx9qj/view?usp=sharing

To see the buildings, go to HEAX airport. The buildings are all close by. Try what happens if you change time and the sim reloads. Try to add another scenery and reload.

Looking forward to some enlightenment.

Dan

P.S. The buildings were compiled with MCX before todays development update and the SDK 5.3.17.28160.
 
I have one building under suspicion. The MISRTrainstation. It's the largest file and it creates some error messages but compiles in the end. I added the eventlog. I tried to remove all unseen parts from the design, the errors remain. I wonder if this can be fixed.

...after removing covered parts, small parts not to be seen from air I was able to reduce the .bgl from 2033 KB to 624 KB and now my RAM seems not to be filled extensively.
 

Attachments

  • MCXEventlog.txt
    4.5 KB · Views: 68
Last edited:
In many cases, Sketchup photo textured buildings have many small textures. Multiply that by a few buildings and it can be quite a load. If that is the case and you see a lot of sliver textures in MCX, you'll want to fix that. Sometimes you can identify in MCX the textures you wish to delete or replace with color in Sketchup. In a recent photo textured model I did, a small drive unit on a sternwheeler shattered into about 40 textures. In MCX I found 2, of the 40, that showed tubing and detail, the rest were essentially the color if the housing, red. Back into Sketchup, I deleted all but the two textures, picked a red color and then used the screen widget to match it to the red texture and painted anything else showing.

Another great way to go is to load the model in Sketchup with all it's funky textures, open a renderer like Lumion or, Twilight Render is a free one I use, set the model in a perfect oblique pose and create a render. Then take the screenshot of that render and use it for the single texture you project onto the model. It will provide great "baked" AO's and reflections. Want to go further?

So maybe you project the texture onto your model and you notice some columns are not lined up with their geometry, no problem. Set your image editing software as the Sketchup external editor and just send the texture to it. I use Photoshop and start creating layers, fades and all sorts of junk. When it's ready, I don't close the image and send it back to Sketchup, like we're supposed to, I go to File>Export>Quick Export as .PNG and that instantly saves the snapshot of whatever I've created. Then I go back to Sketchup and load the .png I created, as the replacement of the original in Sketchup. Now, I can get right up close, go back to my layered Photoshop, adjust it slightly, quick export to png, replace in Sketchup and the changes show instantly.

When you get it down, it is like creating 3d and textures simultaneously. Next, you can hook a AI image editor into your pipeline, that will remove backgrounds, sharpen blurs and create text generated images. Now you're really killing it.
 
It was like you described. Some very small parts, pots on the roof, had sliver textures. I only saw it, getting up close. As I wrote, i just deleted these details, since I fly over it, don't walk around it. The rest of your explanation, I fear too difficult for me. I can hardly follow your procedure.

I actually use the one month trial of Sketchup 2019. But what can I do after this? Most models are now only Sketchup 2019 and newer. How can I convert these .skp into a format MCX can read? Could MCX read .skp one day?
 
Thanks for the link. They hide the free version pretty good. I tried and converted a model and then placed it with MCX Convertwizard. Got a better result in regards of disk size but it was way more cumbersome than with the trial software version installed on the system. But yes, trial is only one month and after that, it's too expensive for my needs, just to use their library. I used to design with this Abacus software 20 years ago but I never got into Sketchup.
 
Access is free even for modellers that do not have Sketchup.
 
Interesting thread. I was about to start a new one, as MCX is having huge difficulty with a SketchUp hangar model I've recently made. And this is the simple version! I do use CleanUp, by the way.

Even with no textures or colours at all, I'm currently 20 minutes into MCX LDV (today's download) trying to predict the drawcalls, and it hasn't completed yet. A previous attempt with a - more complex - textured version (mostly colours) required over 12,000 drawcalls in an earlier version of MCX, which is crazy. I've made far more complex models than this which need drawcalls in low double, or even single, digits. I'm using a pretty high-powered computer (AMD 3900X with 32Gb of RAM) in which MCX is using 98% of the CPU and 36% of the available memory.

Is it a problem with the model, or a problem with MCX? If anyone wants to have a play, I've attached the skp file.

As an aside, and an addendum to Rick's post, this is the complex version of the hangar rendered in Twilight Hobby. I hadn't thought of using the render as a texture, but I shall have a play with that!

XaO8SXC.jpg


And this is the simplified version. There's no bracing inside, no double skins, no window depth. The transparency in the image is applied by Twilight and doesn't exist in the model.

rrzU2cP.jpg


Now 45 minutes and still no prediction!

Edit: 2.5 hours in; still chuntering away!
 

Attachments

  • C-Type Hangar FSX Test.zip
    826 KB · Views: 95
Last edited:
Beautiful model, but I can say that 681 thousand polygons for a single building seems awfully ambitious! In FSX it would be DOA. While MSFS will digest it perfectly fine, of that fact I am confident, you'll really want to assess priorities.
If this is for a static in sim render, go for it, take your time, so to speak. If it were mine, I would put it on a massive diet and doing do, I'd lose little detail.

For you, we are going to recommend a variation of my Render2Screenshot technology and suggest "Geometry2Screenshot." The concept is quite simple. Take the example of this caged ladder, with all those ergonomically rounded rungs.

1934.png


I'd not even have to model calluses onto my characters, to convincingly use that ladder! Here it is in detail.

34 detail.png

Every rectangular area, is at least two polygons. Contrast that to the relative scarcity of blue edges in the caging and we see how expensive curves can be.

Now, imagine a "D" shaped extrusion, where the ladder is, onto which you have projected an image of this caged ladder, which you constructed specifically in order to capture a screenshot of complex geometry, that you can then project onto simple geometry! If that idea is to radical, at the very minimum, do consider creating all surfaces with flat, albeit curved, strips of polygons, such that the outside of the caged ladder are white, and the inside ones are blue. Somewhat in the manner of this model.

caged ladder.png


Ok, moving on, there is another area of focus I think could be particularly valuable and it involves open framing and hangar doors.

framework.png


I think you can see how easily you could build a structure that encompasses the open framing and project detail onto that, so I won't water a lot of time, except to advise caution with stacked transparencies. You might be inclined to make a square tube and project an image of an I beam onto it, which will of course work. You might then decide to build the framework this way, creating the same detail with 1/4 the polygons. It may work well, or you might have trouble with z flashing issues, so proceed carefully.

Finally hangar doors. They need 6 polygons closed, 10 open if you give them a backside. So how could we get the voluptuous beauties closer to that skeleton weight? Well, the windows and all their glazing can be a single surface. I do recommend insetting them some, using sills, because the shadow line is cheap, in terms of poly's and fairly dramatic, it changes with the sun. You can get a lot of depth by taking your oblique screen capture into Photoshop, churning out a normal texture and using that, which is where I'd like to close.

Those little blue dots that we can hardly see as our airplane barely misses the hangar, occupy 169 polygons, each. They even have a little hole down the middle! 10,000 little tubes screaming for humans to see their rendered perfection, but sadly it will never happen. Rivets work really well, as blips on a normal texture and those holes will not be visible in sim, anyway.

Lastly, do not fear backside faces in MSFS. Managed properly, as these are, they are indistinguishable from fronts. Transparencies should be single layer and either outer side texture, or double side texture, depending on exposure.
 
Hi Rick. That's all great advice, for which many thanks. I'll definitely look at these techniques.

The original (far more complex - the first illustration) model is really for historical interest, and may form the basis of specific archviz replicas for museums and preservation groups, so it's not really a flight sim thing. Indeed, it'll get a lot more complex before it's finished. However, I did get a fully textured version of that into MCX and out as a P3Dv4.4 bgl, so the why the simplified (though obviously not enough!) version wouldn't work at all confuses me. While I haven't yet tried to compile either version for MSFS, that is in the back of my mind for the future.

While I totally accept that even the simplified model uses techniques that aren't appropriate for FSX, it is odd that MCX couldn't even calculate the drawcall total. That's where I'm struggling to understand the issue. I can of course start again and use the techniques you've so helpfully suggested to make a very acceptable model that'll work in FSX, let alone P3D or MSFS, but it would be useful to learn what I've done wrong (or what has changed in MCX) that caused this model to trip it up when previous, more complex ones have worked. If it's something I've done, obviously it would be good to know what specifically I need to do differently in future - you've given me several clues that will help, but I'd love to know if there's one specific bad input!

Ah - a thought... I hadn't checked the stats panel you show so I've just run a few tests.

I've loaded the complex model and selectively deleted components to see what the hit on polygons and edges was. The whole model is 699,000 faces or polys, so really not that much more than what you show for the 'simple' one. The ladders are relatively 'cheap' at 2000 faces and 5000 edges. The whole hangar side, including all the fully-3D window frames is 6000 faces. The fully 3D hangar doors (with full interior detail), with all the rivets, are 50,000 polys and 115,000 edges. Each! So, yes, the rivets are an issue! That still doesn't explain why the simpler model won't convert but the complex one will, and I'd love to know the answer to that, but at least I know where I'll start the next stage of simplification!

Complex model

dWZk2AK.jpg


Same, with one door deleted

xd9mdjA.jpg
 
One thing that bears mentioning, is that Sketchup counts quads, or even more complex "flat" shapes, as polygons, MCX counts only triangles. There is no common ratio, but it is usually more than double what Sketchup reports. As to draw calls, Sketchup tends to shatter textures that are not carefully managed. Every time you change your projection, scaling, move the yellow pin, Sketchup creates a skewed version of the original texture, that does not show up in the Sketchup material browser, all we see is the original.
A recent gearbox transmission I had modelled for a sternwheeler had over 40 textures, derived from on photo image, when I brought it into MCX. I went through each texture and deleted all but 3, the rest were invisible. These repeat textures are the biggest impediment to draw call optimization, in my experience.
 
Absolutely - that's why I tested the model in MCX with no texture or colours other than the default. In fact, I've noticed that importing the model as a kmz allows pretty much every variation of colour or texture that have ever been used on the model to show in the MCX material list! I'm very careful to delete any duplicates or unused textures, and I always use CleanUp to try and catch as much of that before the export as possible.

In this case, I also tried importing the skp to Blender (using SketchUp Importer) to give that program a chance to clean it up, but the result when exported to MCX from Blender as a dae was the same.
 
Can't say without knowing your procedures. You could break the model into quarters, run each through MCX and use the Merge Tool to recombine them. You can use the Level of Detail Creator to create algorithmically derived lower complexity models and then delete your high polygon original. I do this often when I am converting CAD models, because they have such lovely curves made with molecule sized poly's. With a big square building, there is not much to subtly reduce, of course it will go after the ladders and rivets like mad. The secret of using the LOD tool is in the grid size setting, which defaults at 1. The filter acts like throwing a net over your model, 1 being approximately the size of the viewport square and any polygons that fall inside that dimension are subject to the filter. For immense models, I start at .02, which eliminates poly's that aren't even visible, unless they form a large mass, of course. For your model, you would not see any change on the bigger faces, until you'd set grid size to about 20 or 50, which of course would obliterate all the cool stuff, but minute settings might serve you well.

Back in the Sketchup interface, I always run every single model through Cleanup3, so something else to consider.

 
I'm not sure whether you missed it, but I have mentioned it - I use CleanUp 3.4.3 every time I save a model. It's a great little tool.

I'll look at your suggestions, but you've a level of expertise in MCX that I haven't yet reached - I have tried without success to use the LOD creator, for instance, but it defeats me every time! But I have a couple of hours to spare this afternoon, so I'll give it another go. However, I think I still have to get past the issue of drawcall estimation and optimisation. Given the results I've had, I do think there is an issue in MCX. It maybe that this particular model has revealed it, but given that the complex model was resolved by MCX yet the simpler one - with no texture or colour - wasn't, I need to find out how to solve that before I can progress this particular model for any sim.

I think the most interesting suggestion for this case is your trick of using Twilight as a texture generator for a very much simplified model. I could then probably get away with a simpler ladder component and a little 3D detail elsewhere. However, I'm also going to try creating the model anew in Blender, as I really need to get my head around that program (not least for its texturing prowess) and cut the apron strings from SketchUp Make before Trimble does it for me - I can't afford to pay for Pro unless the archviz projects I'm doing start paying out!
 
I used ThomThom's plugin QuadFaceTools to export from Sketchup2017 as OBJ. It can then be imported to MCX or Blender easily.
 
Thanks Dick. I have no problem getting models into Blender - SketchUp Importer does that easily and quickly from the skp file directly within Blender 3.4, and loses none of the components, groups or detail which I've found can be a problem with other methods. However, I'll have a look at QuadFaceTools as I think it may have other useful qualities.
 
The Asobo exporter for MSFS should be used with Blender 3.3. V3.4 isn't supported yet. The Sketchup importer is pretty fast.
 
Back
Top