gPoly status update #8

I have now chosen the airport that I will use as a test field for developing the gPoly tool. It is Marshfield Municipal Airport (KGHG) in Massachusetts. So I have drawn some of the aprons and taxiways and am testing now if I can export them correctly to FS.

At first I was exporting with the FS2002 style code used for ground polygons most of the time. As long as I export everything with one reference point things looked fine, but when I divided the polygons over different reference points, to have better control over the performance, I noticed that there are gaps visible between the polygons. In FS2004 the same approach worked fine, so it seems the gaps are caused by the curved earth in FSX. At the moment there is a very useful discussion going on at the FSDeveloper forum about this issue. I still hope that once I understand how FSX corrects the polygons for the curve of the earth, that I can export them again with a compensation so that they line up correctly.

To learn more about this curved earth, I decided to start with exporting the ground polygons as FSX MDL files as well. In these MDL files I am bending the ground polygons so that they follow the curve of the earth. This approach seems to work quite good, although I still have some issues with gPoly not always triangulating the polygons correctly. Between the different MDL files I still see a small gap sometimes, but it is much smaller than in the FS2002 style approach. I hope that by improving my math a bit I can get things aligned correctly again.

The fact that the FSX MDL files seems to work quite well is quite exciting, that would open a lot of possibilities to make better ground polygons. For example with reflection when it is raining or with bump maps. I am looking forward to continue the experimenting.

Which airport?

Now that I can export some basic polygons from the gPoly tool, I am looking to go one little step further. I am looking for an airport that I can use as a test case to develop the tool further, since there is no better way to find bugs than while actually working with the tool on a project. In the end I will be using the tool for the EHAM Schiphol scenery of NL2000, but that airport is a bit too complex for a test airport.

See this thread on FSDeveloper for a little more background on “my requirements” for the airport. But basically I am looking for an airport that is not too complex and not too simple. And since having imagery available is a must, I am likely to end up in the US with the free USGS data available.

So let me know if you have any suggestions for a nice airport. As a side effect of using it to develop gPoly further I might even finish a scenery of it.

Abcoude church in FSX

And here is a screenshot of the church made with SketchUp in FSX. It has been converted with ModelConverterX and is showing on the NL2000 v4 scenery. I am not completely satisfied with the textures yet, they seem a bit too light when viewed in FSX, so I think I will change them a bit.

Oh, and don’t expect to find this object in the coming NL2000 v4 release, since I am too late now to still add it. We are already further in the testing and release process.

SketchUp texturing and FSX conversion

Let’s start with the good news, I finished my model of the church in Abcoude. All the textures have been applied as you can see in the screenshot below. But I learned some interesting things while trying to get that far.


Let me start with explaining my approach to texturing the building. I had decided to make separate texture files for each of the different walls. Mainly because I have not yet found a way in SketchUp to define the UV coordinates very accurately. So trying to map a sheet with many different texture elements would become hard that way. If each wall has its own texture though that becomes a lot easier already. And of course I will use the drawcall minimizer of ModelConverterX later on to still make one combined texture sheet for FSX.

One of the things that I encountered is that I needed to position the texture very accurately, because even a small error would result in the textures repeating over the surface and then I can not combine them into one texture sheet in ModelConverterX anymore. So especially for the textures that do not simply fill the entire face that took some trial and error.

One performance related lesson I learnt is that you need to export as COLLADA DAE and not as Google Earth KMZ from SketchUp. When exporting as KMZ (almost) all of the faces are exported double sided, which increases the polygon count a lot. And in the KMZ exporter I could not find an option to disable this, when exporting as DAE there is such an option (and by default they are not double sided anyway). So although it might sound easy that a KMZ has the textures in the same file, it seems better not to use it.

Another performance related issue is that while drawing geometry in SketchUp some additional polygons might be created without you really noticing it. So in the end I spend some time to remove polygons that could not be seen from the outside anyway. I guess this is the price to pay for the easy way to draw the geometry, but it is for sure worth the effort to check and remove such polygons in the end.

So if I look back to this SketchUp experimentation until now I think I have to say that the modelling itself is easier in SketchUp than in GMax (and it seems also more fun). It is very easy to just draw some more geometry. The texturing part I am not so sure about yet, it seems you do not have as much control over that as I am used to. Which can make it hard to make a model with optimal performance for FSX. But it might also be that I still have to learn some more options, so I will continue exploring. For sure it is a lot of fun.

At the moment I am installing the latest test version of the NL2000 scenery, once that is done I will post a screenshot of the church in its proper environment.

SketchUp texturing

After finishing the geometry of the church I am modelling in SketchUp, it was time to move on to the texturing of the object. So also for this part I tried the different options that SketchUp offers.

First I tried to use the project texture function when using the match photo feature. This allows you to align your model to a photo and will then project this photo as a texture onto your model. I guess this might work well if you have an object that is not so complex in shape, but for my church it did not work that well. Since the shape I modelled did not match the real church 100% and because some photos had some distortion as well, the texture never fit properly on the model. I think later I will try this function again with a more simple (rectangular) object, but for now it does not allow me to make textures with the quality I want.

So after that I just tried to import my photos directly as textures (without letting SketchUp projecting them). You can then map them in SketchUp quite easily by putting the pins at the corners of your faces in the photo and then aligning them with the face. This gave slightly better results than the projecting, because you have more control over where the texture goes. But still it is quite hard to align different photos correctly and let the textures continue smoothly over different faces.

So I guess in the end it sounds too good to be true that you can very easily make textures using only photos. My next attempt will be to make the texture in the normal way, by composing it manually from the photos using GIMP. I am sure that will result in the quality I am looking for, just a little more work. I will post the results again once this phase is done.

Today’s SketchUp adventures

After all the work I did on the COLLADA and KMZ importers for ModelConverterX, I thought it would be a good moment to try to model a bit more in SketchUp myself. So about a week ago I cycled to the nearby town of Abcoude and made a bunch of pictures of their local church. With those as my reference and some maps I found on the internet, I started modelling the church today. In this blog posts and those that follow until I have finished the object, I will try to give an overview of my adventures while learning more about SketchUp.

Being a bit of a number-head, one of the things that worried me about SketchUp was if I could easily enter numbers for sizes of objects and offsets. I know many people do not worry so much about this, they are mainly concerned with how the object looks, but my style of modelling involves using paper and pencil to calculate distances and things like that. And although it works different from GMax, I must say that I am very happy with the way SketchUp allows you to enter distance when drawing lines or when moving objects.

Below you see a picture of the church and drawing the roof was quite a nice learning experience. With all the SketchUp functionality to draw lines parallel or perpendicular to other lines or the axis, it was in the end quite easy to make this roof. Even though the walls supporting it have different heights.

While modelling the church I also experimented with the match photo function of SketchUp. This function allows you to align your view so that it matches with the position from which you shot your photo. Afterwards you can then model in that view and make the object match the dimensions as show on the photo. At first I had some troubling setting this up correctly, but I think that was many due to make lack of good overview photos. Due to all the trees planted around the church, I mainly made detail photos, while not having many good overviews. My impression is that the match photo function works best with pictures that show a big part of the object.

But in the end I got it setup for some shots I made and it turned out to be a really easy way to determine the height of the roof and the tower. Below you see an picture of the object being aligned with the photo (I made the object transparent so you can see the picture better).

So as you can see in the pictures, the basic shape is done now. I will probably have to add some minor details to gables and that kind of stuff. But I am quite satisfied with the result until now. The next step will be texturing the object. I have already done a little experimenting with projecting pictures on the object (after I used the match photo function), but as you can see in the picture below the results are not good enough yet. I am planning to see how far I can go with projecting the pictures and then using the Drawcall Minimizer of ModelConverterX to make a nice texture sheet. If that does not work, I will go back to the traditional way of making the texture sheet myself.

Another thing I hope to learn from these experiments is how to model most efficiently in SketchUp (from the point of view of FSX). So how do you keep the polygon count and the drawcalls within limits. Using ModelConverterX I can get nice statistics about all those performance related numbers. So more on that and the texturing in a next blog post.

gPoly status update #7

It feels like it is a long time ago I wrote a status update about the gPoly tool. And now that I think about it, it is actually a long time ago. But this weekend I have done some work on the tool again. I have mainly focussed on two functionalities:

  • Being able to save your gPoly project file to disk and afterwards loading it back again. This might be some functionality that sounds very basic, but until now I had not coded it. For my tests I just every time drew some polygons manually. I can now save this effort, since I can load back the projects I made before.
  • Being able to export the project to FS in the form of a BGL file. I have got a basic export working now. But the output is not optimized for performance yet and also the slicing up of the polygons as required by FSX for the curvation of the earth is not yet done. At least I have a basis no to work from, when I start adding those features.

I plan to first improve the exporter further, so it writes the kind of code that works in FSX, before I return to the GUI part of gPoly and start polishing the features there. Now most of them have some rough edges left. But that is for another status update.

Drawcall minimzer with night textures

A few weeks ago I introduced the Drawcall minimizer functionality of ModelConverterX. This function can pack the different textures used on your model into bigger texture sheets to reduce the amount of drawcalls. This will result in a better performance in FSX.

One of the main drawbacks of the initial implementation was that only the diffuse textures of the model were packed. I have now finished the code that also packs subtextures, like night textures or bump textures. So that should make it easier to reduce the amount of drawcalls on models that have such textures.

This updated functionality is not yet available in the development release though. It seems to be working on the models I tested until now, but since I made quite some changes to the code to work more efficiently with these subtextures I want to do some more thorough testing to be sure I do not introduce new bugs. So I hope that tomorrow I have finished those tests and this new function will be available.

With this functionality finished, I have implemented all of the features that I planned for the ModelConverterX 1.2 release. There are some minor bugs that I want to fix, but I plan to release another stable version soon. I’ll keep you updated about that as well.

Emails working again

The problems we had at FSDeveloper, which resulted in no emails being sent out by the forum software have been solved. So from now on the forum notifications and the confirmations for users that are registering are working again. Thanks for your patience while we were solving this problem and a big thanks to fellow administrator Lefteris for finding what the problem exactly was.

Read The Fine Manual

I guess everybody knows the abbreviation RTFM and of course we all read the fine manual when we are using a tool. But for ModelConverterX I usually only update the manual with every stable release and the recent survey showed that most of you are actually using the development release. So as a result of that I have started a discussion on the forum to find out how you use the manual now and how useful it is to you. I am looking forward to hearing your feedback!