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é
Flight Parameters, Shadows and Aerobatic airplane ! 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

Live from Orange County Airport Test Facilities, here’s an update on the Flight Simulator Project.
There are three things I’d like to write about tonight: Aircraft shadows, flight parameters, and a thought about optimizations.

First of all, Shadows. I’ve received several comments about the shadows in the sim. I know there were crappy. I didn’t spend a lot of time on this feature since I only needed it to get some kind of visual reference of the aircraft distance from the ground when landing. But time had come to make a little research on the subject.
Considering the fact that I had just completed my render to texture marathon, I figured I would use this approach to render shadows below the aircraft.
The process was simple, render the aircraft from above in a texture. Post process this rendering in a shader that would do some stuff to make the texture usable on a blended quad.
I tweaked and tweaked and it worked. I had my rendered shadow. One thing though, I completely forgot about the fps counter that dropped down 20 fps :-/ Well, since there was no way I would go back to the old shadow system, I decided to do this the quick and crappy way: a blended texture created off-line applied on a quad. I know, shame on me, or not, I was surprised with the results! So I’m going to stick with this technique for now :-)

Flight Parameters:
Up until a couple weeks earlier, there was no flight behavior difference between the Cessna 210 and the Piper PA-28 in the simulator. Their flight parameters were sort of hard coded. I had externalized a bunch of values already, like engine position, mass, and so on, but none of the actual flight parameters were modifiable.
I then decided to externalize more parameters, like engine power, controls inertia, lift & drag parameters … With these out of the .cs files, it’s now possible to tweak aircraft physics so that you have a more powerful aircraft or an aircraft that will stall at whatever speed you choose.
To test this, I couldn’t possibly think of doing anything besides creating an aerobatic airplane ;-)

Enters the PA-28 Aerobatic with special livery!
It’s an extended version of my PA-28 but with extra sensitive controls and a nitrogen powered engine ;-)
The flight feeling with this aircraft is different from the default PA-28, but you’re going to have to trust me on that one ;-) (When will I release a version anyways ?)

 
Touch down - Crazy aircraft

  
Final with flaps - Steep climb - Very short final !

 
Special livery - Take off

The lift and drag calculations have also been changed from a linear equation to pairs of angles/values within the aircraft configuration file. It’s now possible to have a precise control on when the aircraft is going to stall.

Optimizations:
I also worked on some optimizations, but though they should have, none of them changed *anything*, so I’m simply not going to talk about them … that’ll show them! :-P

That’s it for today.
Happy Landings !

Life.Glow() 

[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]

Don’t ask me why, but for the past couple of weeks, I’ve had this thing for blur, glow and all that sort of special effects …
I’ve read a bunch of articles on how to make glow in games, and I’ve taken a bit of every one to make my own glow technique…
Since I’m developing mainly on my laptop, that has ATI 9000 video card, I’m kind of limited performance and shader wise. Therefore, I wanted to avoid multiple full scene renderings and anything that would take too much time to render.

The technique I used to glow the scene is the following.
Step One :
I render a full scene to a texture that has the same size as the backbuffer. (We’ll call this texture _fullSceneTexture)

Step Two :
I render this texture applied on a fullscreen quad, in a smaller texture (say 128x128) that will be user later on. (Call it _SmallTexture)

Step Three :
I render _fullSceneTexture applied on a fullscreen quad directly to the backbuffer.

Step Four:
I render _smallTexture applied on another fullscreen blended quad directly to the backbuffer.

This last rendering has some special treatment done to it.
A Blur/Luminance shader is used for this rendering. It does two things:

  1. Blur the scene (based on the technique I’ve found on a nvidia shader sample)
  2. Transforms the pixels from their rgb to their luminance (some sort of grayscale image comes out of this)
  3. Decreases the impact of pixels whose luminance is below some threshold I’ve set.

The result is a black and white image with blurry bright zones where the original image is brighter.
Since this texture is blended on the screen, it gives a nice shiny-bright effect.
Check out the pictures:

 <- off, on ->


Flight at noon


Evening shot


Daylight


Sunset

More at :
http://matt-online.homeip.net/FlightSimulatorProjectGallery.aspx (Glow)

As always, there is plenty room for improvement, this is just a first draft and the next step will be to enable this effect on specific objects. The sky is really over brightened by this effect and it should be excluded from it. I like the whole feeling of blurriness brought by this technique. It makes the whole image less crispy and more realistic.

Ideas, comments ?

Happy Landings,
Matt