64 bit version

Until now all of my tools were 32 bit, so even if you we’re running them on a 64 bit OS you could not access the additional memory. Especially for scenProc that was an annoying limitation, so today I took another look at making them 64 bit as well.

In the end it turned out that except from a few external libraries I am using, most of the code runs fine on 64 bit as well. And for those few libraries that gave trouble I found versions that do work on 64 bit as well.

So from the next development release the tool will run as 64 bit applications if you have a 64 bit OS and else they will run as 32 bit as before. Since I made some changes to DLL files I would advice you to completely remove the old version when upgrading to this new version.

When using scenProc with shapefiles be aware that a driver used to read the shapefiles needs to be available as a 64 bit version as well when running on a 64 bit OS. Check out the details on the wiki manual about installing this driver.

In my testing the tools ran fine, but please let me know if you have any issues with this new version.

Material editor and saving textures

Until now the material editor would save a new texture directly for every change you made. So for example renaming the texture or changing the size. When doing multiple operations in a row that resulted in many textures in the texture folder that were not used in the end. And for the user there was an annoying task to figure out which of the textures are actually used.

So I have made a change to the material editor now. From the next development release all the changes you make are first stored in memory only. Once you are done with all your changes you can press the save textures button to save the files to disk. This not only includes all operations on the textures tab, but also minimizing drawcalls. If you try to close the material editor without saving the textures to disk, you will get a reminder.

I hope this change makes it all a bit more user friendly. I plan to make a video tutorial soon to demonstrate all the cool optimizations that can be done now with the material editor.

Drawcall minimizer and repeating textures

Tomorrows development release will contain a couple of improvements to the drawcall minimizer functionality. The main improvement is that you can now also minimize textures that are repeating. ModelConverterX will repeat those textures for you, before inserting them into the combined texture sheet.

As you can see in the image below, there is a checkbox with which you can tell the minimizer if you want to include the repeating textures or not.

By including repeating textures you can possibly reduce the amount of materials in your object a lot more. But depending on how many times the texture is tiled, it might also result in a much larger texture sheet. So you need to find a balance between those two.

Match texture function fixed

I have just fixed the match texture function in the material editor. Since the new material editor was introduced this function was broken, but it is working again. With this function you can look for the same texture, with a different name in the specified texture folder.

I hope to finalize the new material editor in the next couple of days. So that means I want to finish the drawcall minimizer improvements and do some more robustness checks for the material editor in general.

Another nice feature I introduced today is a function that can replace a material with double sided property set by additional triangles. This means a separate triangle is made for both sides. Sometimes it can be more efficient to have a few more triangles if that means you can reduce the amount of drawcalls.

Merge objects

I have added a new function to ModelConverterX, you can now merge objects. After you bring up the form there are a couple of things you can do:

  • You can specify the LOD that should be used for the model you are importing. So this allows you to import another model as a lower level of detail. Or if you give the same LOD as your current object they will be combined.
  • You can specify an offset compared to the current model, so that you can put object besides each other.
  • With the load object button you can load another object from file to be inserted.
  • Alternatively you can also use the list of objects given. This list will show all other objects that are currently loaded into ModelConverterX. So for example if you have loaded a library, all the other models will be shown.

Once you have set all options the way you want, you can press merge to start the merging of the objects.

A new blogging home

For those of you who have been following me at my blog at msmvps.com, welcome to the new location of my blog. From now on you will find my posts about scenery design, tools and other things that interest me here.

As you can see all old posts have already been migrated. So I hope you will feel at home again here.

Specular and fresnel effects in preview

The next development release of ModelConverterX contains improvements to the rendering of the object in the preview. The two biggest changes are that the specular hotspot and the fresnel effects are now shown in the preview as well. I am not convinced that the fresnel effect is exactly like in FSX, but I think it is rather close at the moment. Besides those two changes there are other smaller improvements as well, for example reflections work more like FSX now and also some additional material settings now have an effect in the preview.

Classify building footprints

I have been adding more built-in attributes to scenProc recently, to allow you to classify buidling footprints in different types. Then for each type you can make different kind of autogen. This work is not yet finished, but in this blog post I want to show what you can do already now.

Please read the scenProc manual to see which attributes are available and what they mean. Below is a scenProc configuration file I used to create autogen around the city of Amsterdam:

# Amsterdam autogen test
IMPORTSHP|buildings_adam.shp|NOREPROJ
#
ADDATTRIBUTE|*|BUILDCAT|5|1
ADDATTRIBUTE|FCONVEX=1|BUILDCAT|4|1
ADDATTRIBUTE|FNUMPERPANG>3;FNUMNOTPAR<2;FNUMVERT<10|BUILDCAT|3|1
ADDATTRIBUTE|FAREARAT>0.85|BUILDCAT|2|1
ADDATTRIBUTE|FNUMVERT=4;FNUMPERPANG=4|BUILDCAT|1|1
#
EXPORTSHP|*|bla
#
SPLITGRID|AGN
#
SETAGNBUILDINGHEIGHT|1.0;0.4;0.2;0.0
CREATEAGNGENBUILD|BUILDCAT<2;FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CREATEAGNGENBUILD|BUILDCAT<2;FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
WRITEAGNFILES|c:flightsimnl2000nl2k_v4_resample_NHtexture

Let me explain what is done here. First I import the shapefiles that I want to use. Next I use the (new) ADDATTRIBUTE step to calculate some new custom attribute. This is where most of the work to classify the buildings happens. I have defined the following categories for my buildings:
  1. Rectangular
  2. Nearly rectangular
  3. Can be represented by a number of rectangles
  4. Convex polygons
  5. Concave polygons

So first I set all features to category 5. Then with the second ADDATTRIBUTE step is make sure all convex buildings are category 4. The FCONVEX attribute is used for this. All buildings that have at least 4 perpendicular corners and no more than 2 edges that don’t have another parallel edge and have less than 10 vertices are step to category 3. All buildings where the difference between the footprint area and the bounding box area less than 15% are set to category 2. And finally all footprints with 4 perpendicular corners are defined as rectangle (category 1).

Now I use can this new attribute BUILDCAT to create the autogen buidlings. I use category 1 and 2 for the rectangular autogen. The other three categories are not used in this example. But my plan is to add another step that can split the footprints of category 3 into a couple of rectangles to represent the shape. For category 4 and 5 maybe the polygonal autogen can be used or else I think it would be a good idea to create MDL objects from those footprints.

Of course the classification I show now is not how it should be done, you are free to define your own rules in the ADDATTRIBUTE steps. Let me know if more attributes are needed for that.

Below is a screenshot that shows which footprints are classified in which category for part of the city. As you can see it is not perfect yet, so I will continue to do some more testing to refine my rules. Once I found a set that works well, I’ll post an update of course. Especially for category 3 the results as not as good as I hoped, so I will try to find a better algorithm there.

 

Built-in help

In the last two days I have made scenProc a little more robust. Before any mistake in the configuration file would usually result in a crash of the entire tool. That has been changed now. The tool will now check if you provided the right amount of parameters and give a warning when that is not the case. Sometimes it will also check if the parameters provided are of the right type, but that is not yet supported for all available processing steps.

Another change I have made is that the tool now has built-in help. If you enter scenproc –help in your command prompt you will get a list of available processing steps. If you type scenproc –help stepname you will get additional information about the processing step with the given name. This includes information about the expected parameters and what the step does.

I hope these two changes make the tool a little bit easier to use for you. Oh, and one more thing. You might see there are more processing steps available than documented on the wiki. Those other steps are used to make ground polygons from dxf or shp files. But they are still under development and might be a bit buggy, so I would not advice you to use them on a serious project at this moment.