Start of spring

Today was supposed to be the start of spring, but looking at the weather outside (snow, rain, cold) it seems not really to be the case yet. There is even some chance that we get a white Easter this year, maybe that can compensate for the lack of white Christmases lately.

But this might also have a positive effect, I might have some more time to program a bit during the Easter days now. Then I can catch up with the time I lost when the flu kept me in my bed two days this week. Tonight I already continued a bit on the ModelConverterX tool and basically added the support for the binary SCASM commands that FSDS uses a lot. It is working now, but the code needs some cleanup later this weekend. With this basic I can also continue on the FS2004 MDL reader and a BGL object reader. So there is more to come.

SCASM and binary commands

The next feature I will be working on for ModelConverterX is the support of the SCASM commands that enter the binary BGL/MDL code directly. With these commands you can enter certain hexadecimal values directly in the created file.

You might expect that this is a feature that would only be used by the real expert who wants to create some very special functionality, as you can easily screw things up if you are not sure what you are doing. But that is not the case, these commands are used quite often in API objects.

Especially FSDS makes a lot of use of them. If I remember correctly, this is because by the time FSDS was released a newer SCASM version was needed to be able to use the LoadBitmap and RGBSColor commands. But Abacus was also selling their ASD tool which come with an older version of SCASM. So to make sure that ASD could work with the macros generated by FSDS, FSDS had to write the LoadBitmap and RGBSColor commands with those direct binary commands.

The code I have started to write now will be able to analyze those binary commands, so that ModelConverterX can process them correctly. And with the same code I will also be able to read objects directly from the BGL file later on. So that might be another useful new function. 

Real-time rendering

Recently I bought an interesting book, Real-time rendering. I have not completely finished reading this book, but it contains a lot of useful information. For example I have found there solutions for some problems I had while working on my ModelConverterX tool. But the explanation of how the rendering process works also give a better insight on what has an influence on the performance when rendering. This is not only interesting to understand better how FSX works, but that is also something I can use at work when dealing with our image generators there.

Multiple objects

Yesterday I continued working on a new feature for ModelConverterX that was high on the wishlist for a while. The ability to read in SCASM files with more than one object defined inside. So for example this would allow you to read in a SCASM object library definitation or just a SCAMS file that contains multiple objects (multiple Area/EndA commands that means).

I have made good progress on this feature, although there are still a few things to improve before it is ready for release. But I think this could be a useful feature for a lot of people. 

Transparent textures

Today I have been doing some work again on one of the main features still missing from ModelConverterX, transparent textures. In the FSX MDL format it is no longer enough to add an alpha channel to your texture file. You also have to specify in the material that is used on the object that you want to use that alpha channel. So that is something the user will have to specify when he converts an object with ModelConverterX. To do that I have added a form to edit the material properties. This will also allow people to easily add night textures to objects that did not have them before for example.

At the moment I am still fixing some minor bugs in the X file that give some drawing order problems, but hopefully I can get a new version of ModelConverterX with this functionality added online this weekend. With the support for transparency added I think most SCASM macros that don’t use special code should be convertable.

 

(Almost) time for a manual

I have just released an updated version of ModelConverterX, check out the thread on the forum to see all changes. This time mainy improvements in the reading functionality and some small new features. The bigger new features that are planned have not been implemented yet. Hopefully I can add some in the next release.

Another thing that is really needed now is a manual for this tool, as I start to get requests for features that have already been implemented (but not yet found apparently). So I started with the manual on the Wiki, although it is still quite empty at the moment. 

Here are your normals

I have added a new feature to ModelConverterX yesterday, the ability to show the normals of your object. The prime reason to do this now was that it gave me a good debugging feature to see if the SCASM code was read in correctly. But also for end users this can be useful, as it shows you if the normals of your model have been defined correctly. This has an influence on how your model is lighted in the scenery.

 

Another nice feature I have added is that you can save the preview image to your disk. So that allows you to use it as a thumbnail in your placement program for example. At the moment you have to save the image manually, but I plan to make it an automatic option as well (and include it in the batch convert functions).

Triangulation

Today I did some more work on the ModelConverterX tool again. There were some complex polygons that were not converted into triangles correctly, so I had to improve the triangulation algorithm. I did make such an algorithm a while ago for another tool, but that one was for 2D polygons only. So I had to convert it into 3D to work correctly with 3D objects.

This turned out to be a lot of fun in the end. With some nice vector and matrix manipulations  it seems you don’t even need that much code to triangulate a polygon. And it was a good reason to refresh some of my math skills again.

So that is another problem less, there are still some problems left with the normals and the sides of the polygons being drawn. Once these are solved I hope to release a new alpha version, as there have been quite some improvements by now. 

ModelConverterX – night textures

Two weeks ago I was able to produce a lot of updates for ModelConverterX quickly, since then it has been a little more silent. But that does not mean no progress is being made fortunately. Today I have been able to add some new features again.

The most important new feature is that night textures are now read in correctly from the SCASM macros and also applied correctly to the FSX MDL file. So your objects will no longer be dark at night. Another improvement deals with the default scale that might be set in the macro. That scale value is now read and applied by default. So most objects should appear fine when applied with a scale of 1 in your XML placement file.

Before I release a new test version there are some other bugs I want to solve though. Currently I am working on a transoformation bug, basically not all rotations and translation are applied correctly now (most simple objects are not affected by this bug). Another feature I would really like to add is the ability to specify which textures are transparant, so that they appear correctly in FSX. Hopefully I can finish these items somewhere during the week, so that I release a new version.