Matthieu LABAN
.NET, My Life, Flight Simulation and Real Flight...

 
About Me :
25 Years old developer and aviation
enthusiast living in Santa Clara, California.
View Matthieu Laban's profile on LinkedIn 
Contact me at :
mlaban at gmail dot com


Photo & Video Galleries:
- Gallery List
- Flight Videos
Resume :
e-mail me to get my latest résumé
G1000 in FSP 

Ever since I started flying on the G1000, I've wanted to find a way to add G1000 support in FSP, or at least something that looked like it.
I had tried simulating the Cirrus Glass cockpit in the past, but the heavy graphics made the whole thing render super slow...
 
The gauges are setup super simply inside 3DS max by entering the gauge C# class name to use for each 3D object desired to be "gaugified".
For example, the G1000 gauge is just a 2D plane in front of to the panel that has his user properties specifying that this plane should be treated as a gauge, and that the gauge class to use is "G1000Gauge".
When reading the aircraft model, FSP will detect that this geometry is supposed to be a gauge and will automatically apply a new texture made of the output coming from the G1000 class. This texture will be updated by the gauge class...
This goes the same for all gauges in FSP.
 
Now, the issue is how do I update the texture?
There are two approaches I see to this problem:

  • Render to System Memory using GDI+ and then copy the bitmap to the device texture.
    Pros: GDI+ makes it very easy to do awesome things, so no crazy framework to develop, built in support for text drawing, shapes, transformations, alpha...
    Cons: Can be extremely slow. The part that renders the GDI+ stuff is actually pretty fast and renders at several hundred frames per second depending on the level of optimization. The big downside is the copy from system memory to video memory... This is an extremely costly task and there are no ways around it, as far as I know...
  • Render directly to a Render Target used as a texture later applied to the 3D object in the scene.
    Pros: This is all done on the GPU, except the part that builds the vertices. So no copy from system to video memory.
    Cons: Making things look cool takes a significant amount of work. There is limited support for string drawing, no built in support for painting shapes, this all has to be done by hand. (I'm lazy, remember?).

I started with the first one, as it was definitely the easiest... then moved on to the GPU approach... realizing that coding avionics like the Garmin G1000 for a Technologically Advanced Aircraft (TAA) would be extremely difficult. I have coded support for rendering rectangular shapes, ellipses, textured quads... but to get to the same l
 
In the end, I think I'll have a mix of both.
Standard steam gagues will be rendered using the GPU path as they don't need GDI+ stuff and the support for rendered quads is already there.
TAA Gauges will be rendered via GDI+ and copied to the video memory, but that work will be done in a different thread.
 
The GDI+ Rendering and memory copy a task that I originally tried to perform in the main thread. This was fine until I added the second G1000 screen. Copying these two 1024x768 textures literally killed performance. I already have some sort of basic scheduling to only render gauges at a user defined frequency, but this is all done in the main thread, which is fine for fast rendered gauges that only have one background and a needle, but for the G1000 gauge, that work simply cannot be done in the main loop.
To fix this problem, I moved the G1000 rendering to its own thread. The gauges double buffer the textures so that when the engine is rendering a texture, the thread is preparing the next one. I can achieve reasonable frame rate (60fps) when the drawing thread has a low priority.
 
I used a similar technique for my terrain tile rendering, only this time, the thread does the computation of the tiles and prepares packets that the main thread will render to textures tile by tile after the scene is rendered. That way, even if the work is heavy, it's spread across many frames, so the overall frame rate drop is not noticeable. Doing all the work at once every two seconds for example will introduce a lag every two seconds, but doing a little bit of work every frame will produce less of a slow down.
 

Now, let's move on to some pics and videos :)

Click on the video titles to see the HD version...


Landing in FSP with Garmin G1000 Preview from Matt on Vimeo.
Take Off in FSP with Garmin G1000 Preview from Matt on Vimeo.

Garmin G1000: First Impressions from the left seat 

Two weeks ago, I flew in the evening with Cory, for my introductory flight in a 2006 Cessna 172S NavIII equipped with a Garmin G1000. The Garmin G1000 is the set of two LCD panels replacing traditional steam gauges.

Since I joined West Valley, I flew on PA-28's, Citabrias and Cessna 152's. I was fine flying the Archers/Warriors, but I wanted something new for a change. I flew on a G1000 aircraft with Ismael a while back, but never got around to try it from the left seat. So a G1000 transition was a perfect idea.

G1000 Cessnas are little more expensive to fly but much more fun.

We flew to Hayward in N1322K for a couple touch and goes and back to Palo Alto. Flight went without a hitch. The G1000 is a really impressive piece of equipment. All the information you need is there on these two screens. It can be a little overwhelming at times especially when you are busy with radios. 

One note I have though... I've been a little disturbed by the fact that the airspeed indicator is a vertical bar where the current airspeed is written text. The good thing is that you know exactly what your airspeed is... on the other hand, you have to read the values...
Steam gauges make it easier as I just remember where the needle should be, angle wise, so a quick glance can tell me if I'm above/below that angle that I set to myself...

I haven't flown since that time, all subsequent flights have been cancelled due to weather... Let's hope next week end will be better! I've been practicing on the simulator enough! And Max Trescott's G1000 CD-ROM gave me lots of tips I want to try for real!

Big rant about Air France... And how they stole money from me... 

This is going to be a big rant at what I consider one of the biggest rip offs I've ever faced...
Airline Companies are just thieves. I don't understand how they can get away with stealing money from people...

Here's the story...

Julie and I booked a flight with Air France, way ahead of time in November for this coming March. We thought we would get better fares since it's popular knowledge that early bookers get the best fares... Well, it seems that Airline companies are now taking advantage of this to rip people off and bump the prices up whenever it pleases them...

The fare we got via Air France at that time was a total of 2800+ dollars. 1400 per ticket... We didn't have a choice, we were under presure... what if we don't book now? It might get even more expensive or even worse, the flights could become unavailable if completely booked... So we booked... we wanted specific days, and the best fares were barely better, around a couple hundreds cheaper if we offset the trip by one or two days...

I kept monitoring the prices, and realized that one month and a half later, the fare had melted by a couple hundred dollars... which would have make us save around 400 dollars... not worth it, the cancellation fees would hit hard and we would barely make any money out of it...

So I continued monitoring... and finally figured out the trick to get the cheapest fare with Air France... The way they allow you to choose the fare you want is by first selecting the departing flight, and then the returning flight... The trick was to figure out that the departing price has a HUGE impact on the returning price...

Here's an example:

Departure March 21 March 22 March 23 March 24
Price  800 700 300 300

Select the March 21 Departing Flight, here are the available return flights...
Return March 30 March 31 April 1 April 2
Price 700 700 800 600

Now select the first cheapest date, March 23rd, here are the available return flights...

Return March 30 March 31 April 1 April 2
Price 3200 3200 300 300

This brings me to say: WTF!!!!

Needless to say we changed the flight... which I thought would be easy... well, the part about booking the new flight is easy... of course, money goes their way...

Then, I needed to cancel the other one, which I unfortunately booked with Expedia... for an Air France flight... I called Expedia to cancel the flight. This took a few minutes.

One week later, Air France was starting to take their sweet time refunding the money they took from me in a second...

So I called Expedia again. They said, "blabla, we sent the refund request blablabla". I called Air France, they told me "blabla, we haven't received anything... blablabla... call us back... even then, it'll take a month to give you the refund... blablabla".

WTF is wrong with the world!? Why aren't the consumer organizations doing anything about this absolute rip off? We are talking about $2400 here! I can do lots of stuff with that money!

By the way, yes, I said 2400 hundred dollars... because there is a $200 cancelling fee I mean THEFT fee for cancelling a ticket whose price they purposely inflated in advance to push you to cancel it at a later time!

And there is absolutely nothing that I can do... it's so unfair... life sucks!

I would file a complaint... but why bother... These damn phone operators are trained to be heartless... And I'm not wise or old enough to make make them cry and transfer me to their supervisor...

So to sum it up:

- They had my money for 4 months
- They took interest on MY money
- They lowered the fares making feeling like a complete dumbass for not cancelling the first tickets
- They STOLE $400 from me for NO REASON because I cancelled 2 months in advance on a flight that they will have NO PROBLEM filling anyway. Ass holes!
- They NEVER gave me the interest they made on MY money
- They took their sweet time to actually refund the money, taking advantage of every single second of interest they could get...
- And, they have a 90% chance of being on strike for same random lazy-ass reason... ( they are french after all... learning how to strike is a 2nd grade class there )

Can anybody remind my why I chose Air France? I don't remember... Oh yeah... a direct flight... from San Francisco to rip-off town! 

This story makes me remember something very insightful a friend of mine told me not so long ago:
"The world will never go right as long as the main purpose of every single human is to screw the other ones over"

Next time I hear an airline crying about some BS or even better, filing for chapter eleven, I won't feel sorry for them, they only got what they deserve, and it's called Karma!

</rant>

HD Videos of FSP 

I finally found a website where I can upload HD content. Youtube is becoming older and older with their video quality making me think I could almost reach the same quality with our family's old MDA screen back in the 80's.
I tried a bunch of things to upload high quality content up there, but nothing worked.

Two weeks ago, while watching Diggnation, Kevin Rose mentionned this website called Vimeo that supported HD videos.
I subscribed to give it a try. The subscription process was the simplest I've ever seen! (email, nick name, done!)

Uploading videos is easy, and it IS real HD content! I uploaded stuff last year on Stage6, another HD video website... but I would put quotes around "HD"... the compression factor was way too high with stage6. Vimeo is just perfect. Just send them a 1280 pixel wide h264 encoded video and they will take it as HD and enable high quality playback.

Here is one of the videos I uploaded:


Untitled from Matt on Vimeo.