How normal maps work

For those of you that are trying to understand more about the normal mapping (or bump mapping as it is called in the gamepack) that can be used in FsX, have a look at this nice tutorial. It helped me a lot in understand more of the principles behind it.

At the moment I am still figuring out the last bits of how it works in FsX, but after that I hope I can write a little article about it.

 

Cool idea to create normal maps

As you might have seen in the forums, I have been playing with bump mapping for scenery objects lately. While I was searching the web for a little more information, that might solve my shading problem as mentioned in the forum, I can across a nice tutorial that shows how you could create a bump (or normal) map for an object. I find it a pretty cool idea, I only think it will not be very practical to light a building from multiple sides just to make your normal map.

 

Working with FwTools

I have added a new article to the Wiki that explains how you can use [FwTools] to create GeoTIFF files, which you can use for your photo scenery. There might be other tools to do such tricks, but I am familiar with FwTools as I use it at work. And besides that it is a open source project, which means it is free to use. So therefore I decided to make a little article about it.

The article describes how you can add positional information to an image and how you can reproject it to WGS84 if needed. Hopefully the article is useful to some of you and I will try to expand it with other useful information when I find some more.

 

Still alive

I know I have not posted that much lately on my blog, but I am still alive. Unfortunately I did not have that much time the last weeks to explore the nice things I want to post about, but that seems to be changing again now.

Last weekend I finished a new build of Library Creator XML 2.0, you can find it in the forums. This version still does not have all the features of version 1.0, but the features it is missing are less important for FsX anyway. You should think about feature like API macro export. I will try to add them back as soon as possible, so that version 2.0 can become the new stable version.

Besides that I have also found some more time to explore the new options of the GMax gamepack. I have been playing with using bump maps, details textures, reflections, etc. Once I have got a clear picture on how to use them, I will probably make a new article on the Wiki to tell you about my findings.

Now that I am talking about the Wiki, I do have another Wiki article in mind, it will be about creating GeoTIFF images for resample. I often see questions about this on forums and I think it would be useful to have a tutorial about this, as having a GeoTIFF images, makes creating your scenery so much easier.

So keep an eye on this blog, as I will post here once I have more interesting findings or once I have added one of those articles.

 

MSN

For those of you which whom I sometimes talk on MSN as well, you might have noticed (or will notice) that I am moving my contacts to another account. I have a few reasons to do this:

  • The first reason is that I have two accounts since the time I was studying. I then created one account I used when I was on the university and another one for all the flightsim contacts, so that they would not disturb me while I was writing my thesis. Now that I am working there is no need for two accounts anymore (I am not online during the day anymore), so I am going to merge those two.
  • Besides that my MSN address still used the scenerydesign.org domain, so I thought it would be nicer if I made a new MSN account with fsdeveloper.com in the address as well.

So that is why I am moving all my contacts around. You have been warned now. And to prevent loads of spam on that email address, I’ll not write it down here, but you can find it in my profile at the FsDeveloper.com forums of course.

 

Having fun with projections

Using GIS data to create your scenery has become a lot more common in FsX. Vector data can for example converted from shapefiles and for new version of resample can process GeoTIFF images as well. If you have access to this kind of GIS data or can create it yourself, this makes creating the scenery a lot easier (and more fun as well).

But there are also aspects of working with GIS data that are hard to get for people not used to this. One of these is the use of projections. All FsX scenery design tools expect the data in the WGS84 projection. This means that you can usually not use any scanned map.

Today at work we came across a similar problem with the use of projections and I want to talk about it here as well, because it illustrates very nicely what a big influence a wrong projection can have.

For the flight simulator we have a visual database that contains the airport of Paris CDG and Sion, plus some terrain between these two airports. So the projection used for this database has been optimized for the area it covers, we are using a Lambert Conformal Conic (LCC) projection for this database. A few days ago they asked us if we can add an airport in Africa (Mali to be more specific) as well, because they wanted to fly from there to Paris for an experiment.

So our first thought was let’s try to add the additional airport to the same database (which also means using the same projection). So we downloaded some Landsat images of Mali and started adding them to the database. But to our suprise (or maybe not really), the results were not very good. Below you can see a screenshot of the airport in the LCC projection of our Paris database (left) and a screenshot of the same airport when we use a UTM projection chosen for Mali (right). 

As you can see, the heading of the runway differs something like 60 degrees. Which is of course much to much (how to explain the pilot that runway 06-24 is actually facing North). To be honest we already expect some trouble with the projection system, but we just want to try and see how worse it was. And it was much worse than we ever expected.

But I think this nicely shows that you can not ignore the projection you are using when working with GIS data. To prevent problems like the one we had, MS has chosen to use WGS84 for all scenery elements. So to get the correct placement, all you have to do as a scenery design is to make sure your data is in WGS84 or else convert it.
 

Slooooooooow compilation

In my last blog post I mentioned that the new [FwTools] version had solved most of the problems I had with my markings compiler. That is true, but it also turned out that the speed of the compiler had not improved.

Let me take the center lines of Schiphol airport as an example. I finally figure out how to compile them without errors into a good looking scenery. But I should mention that there are about 13000 line segments that make up the marking on the entire airport. The tool I wrote combines these segments into LOD grids and also gives the lines a width. So in the end that gives me one complex polygon for all the markings in a certain LOD grid.

This technique has a few advantages. For example I can draw all lines in that grid in a single reference point. This is important for the performance, because if I would draw them all with their own reference point it would bring down the frame rate too much. On the other hand if I draw all markings of the entire airport in one single reference point, the performance also suffers as markings are drawn on the other end of the airport (miles away) that you can’t even see. So dividing it into tiles gives me the advantage of limiting the display of segments, but still with a good performance. Another advantage of combining the lines is that it allows me to make smoother connections between the different lines. This look much more realistic.

So, did I mention the word slow in the title of this post? I found out that when I performed all operations in the correct order, it takes something like 24 hours to compile the center lines of Schiphol. And of course there are a lot more lines to draw, like roadmarkings, parking lots, safety lines, etc. So you can figure out how much work my PC has to do.

But as the pictures below show, the end result looks very nice. So I guess it is worth the effort. And the good news is that I have a Core2Duo CPU, so that means I can run the compilation tool twice at the same time.

New FwTools version solves some of my trouble

In the past I have already written about the markings I was working on for the Schiphol scenery and at the moment I am finalizing them. The tool I made to convert the lines of these markings into polygons uses [OGR] as I wrote about in that earlier post as well.

This week I updated to the latest version of [FwTools] and to my pleasant surprise it has become a lot more stable. In that past my tool sometimes choked on the amount of line segments I was feeding it, but now they are processed fine (although it still takes some time to work through them all).

The OGR library provides some nice functionalty to for example combine, subtract or clip elements in shapefiles. These are the kind of operations I do on my line segments as well, to give them a width and chop them into LOD grids. But now that shapefiles are also used for the terrain tools, this library might also become useful for people working on tools for the mesh scenery. So check it out.

Of course there are always some trouble left. Now that my markings tool can process them correctly, the triangulate algorithm I use when writing the SCASM source files crashes on me. I guess I have to look a bit more into triangulation now… 

Europa Universalis

As a little exception, this blog post has nothing to do with Flight Simulator. Sometimes, when I am not designing scenery or developing new tools, I like to play a computer game as well. Ever since I picked up a copy of the game Europa Universalis II from a bargain bin, I have been a great fan of the strategy games made by the Swedish company Paradox Interactive.

In these games you start with a country in a historical setting and then you can try all sort of what-if scenarios to see if you can alter history a little bit. You could for example try to prevent Germany from taking the Netherlands in World War II (I never really succeeded in that) or try to battle with France and the UK in the colonization of the world during the 19th century.

And this week there was a little surprise in my mailbox, my copy of the new game Europa Universalis III had arrived. I haven’t had that much time yet to play it, but it looks like great fun again. The only problem with these games is that they are quite addictive, so that will probably mean a little bit lack of sleep again…