Let’s Get Physical At Night

X-Plane 11.0 shipped with all new Physically Based Rendering – the lighting and material model is based on the real physics of light interacting with dielectrics and metals (kind of) to make rendering look more realistic with less art tuning.

But…X-Plane’s night lighting in X-Plane 11.00 is not physically correct – the night lights ignore the materials and do what X-Plane 10 did.

X-Plane 11.01 betas fix this. In the pictures below you can see side-by-side comparisons of the same scene with the 11.00 lighting and the new physical night lighting for 11.01.  The array of balls floating around the Cessna is a test project I use with a 2-d grid of materials (metal on the bottom, rough on the right).

One of the effects of this is increased accuracy of light location – that is, you can really tell where the lights are by the reflections they cast on specific materials.

Here are some material comparisons with the day seen included so you can see what the original materials were. Observe the rim of the engine cowlings on the 737 and 747, and of coarse the entire fuselage on the MD-82.

There’s no authoring change needed or work to do for third parties – if you were modeling your aircraft to look correct during the day, 11.01 makes the night lighting look better.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 27 Comments

X-Plane 11.01b1: Fixing Cockpit Light Levels

A number of blog comments have been (cough, cough) rather vocal about the cockpit lighting being too bright in the cockpit at dusk. As it turns out, this was a shader bug! Here’s some before and after:

To get a sense of the bug and the fix, look at the panel of the Baron and the wall of the building behind it. These surfaces are both bright-albedo rough reflectors facing in the same direction. You’d expect roughly similar direct lighting levels* for the same surface, and yet in the 11.00 pictures, the cockpit panel is way brighter.

X-Plane uses atmospheric scattering equations to calculate the sun’s direct sun color – the sun light becomes “reddish” at low angles because the blue light has been scattered out more, by going through more air than at higher sun angles.

But we can’t always use this formula! When you view a weapon in the weapon preview screen, where in the world is it? What time is it? The answer is: no one knows, so we just render with proxy lights and not the full atmospheric model.

The bug was: we were using proxy lighting colors and not the actual scattering-based lights to calculate the interior of the airplane, causing huge direct-lighting mismatches between the interior and exterior of the aircraft. If you had a part-interior, part-exterior model (e.g the air-stairs of the plane folded up inside the cabin) you might see a huge lighting difference.

11.01 correctly uses scattered sunlight in the airplane too, resulting in much less “electric” sunsets.

 

* Assuming no cockpit shadows – if you really want to put back cockpit shadows after this fix, um, go ahead, but I continue to think that the shadows look too awful due to the very low sun angle, and the direct light isn’t a problem now that it’s fixed.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development | 36 Comments

X-Plane 11.01 Beta 1 and the SDKs

X-Plane 11.01 beta 1 is out now – to get it you have to check “get betas”. Since we now have a stable release version, my suggestion is: don’t check the box unless you are an add-on developer or are willing to deal with some beta-crazy. We try to make sure that every beta works, and things are less crazy here now that 11.00 is out, but you can read the release note history and see that dead betas still happen regularly.

Linux Users: if you use the Aerosoft DVD and have been using the special posted build of the sim to unlock the DVD, please use 11.01 beta 1 – the Linux fix is incorporated.

I’ll post some pics of some of the graphics changes in 11.01 in another post.

A note on the various SDKs: we made a real push to get the various authoring SDKs stabilized for 11.00, but there were things we missed. Most of the authoring SDK changes in 11.01 are:

  • Bug fixes.
  • Removal of old datarefs and features that didn’t work anyway and hadn’t been “cleaned out”.

One exception where an authoring rule is actually changed: during the betas and in 11.00r1, the prop disc is blended using incorrect gamma, matching X-Plane 10 behavior. Not changing this was an accident; all other alpha blending in 3-d is gamma-correct in X-Plane 11.

For 11.01 I chose to change the prop disc now to make everything completely consistent across all interfaces for the rest of the X-Plane 11 run. This isn’t ideal, but running the prop discs with incorrect blending would be a performance penalty for the entire rest of the version run (we’d have to change rendering passes in Metal/Vulkan to support this) so I figured best to rip the bandaid off quick.

As with all gamma-correct blending, the most likely problem with this that the mid-alpha parts of your texture appear too bright in 11.01b1. Incorrect blending loses energy, so the natural authoring work-around is to make things too bright to compensate; now that you are seeing too much light energ you may have to back things off. Looking at our Cessna, the white paint on the prop disc is a little bit too bright with the change.

In other SDK notes: I’m part way through writing draft FMOD notes – one that’s done, Jennifer can turn that into something human-readable. We will probably do an 11.02 to collect gateway airports; WED 1.6b2 is out now but it’s not approved for gateway use yet; we’re waiting to get some test time on it. If 11.01 goes final before gateway airports can be pushed, we’ll do a separate patch to get those airports released.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 57 Comments

WED 1.6b2 available now

The latest WED 1.6 beta is now available to test.

This version includes multiple bug fixes, such as Ted’s fix to crashes caused by long tool tip text, and fixes when using orthophotos. See the included README file for the full change log, and, as always, let us know about bugs and problems on the Scenery Tools bug reporter.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Scenery, Tools | 13 Comments

Experiencing unexpected crashes to desktop on WED on Windows 10? Here’s why…

We have received at least 5 bugs for WorldEditor that seem to have similar characteristics

  • Inexplicable crash to desktop with no error message
  • Happening on Windows 10, not reproduceable on Windows 7, Linux, or WINE
  • Happens shortly after using the Truck Destination tool

In short, until we get a new beta out that officially fixes the issue, try downloading this nightly build of WED. Also, see all the bugs that are marked as duplicate and related to WED-780.

What happened?

Windows Tool Tips and You

Tool tips are those little pop ups that appear when you hover your mouse over UI elements. Sometimes their text includes helpful tips, sometimes they include data; it is whatever we program them to have.

Hovering the mouse over a cell in the WED hierarchy pane makes a tool tip appear with its content as its text.

The code to do that is located in xptools\src\GUI\GUI_Window.cpp:1252-1272. Windows passes a message to WED saying the user has hovered over some UI element, we hand over some text to a data structure (NMTTDISPINFO), Windows uses the data to display the tool tip.

Look at line 1272. This is the line that does the copying our tip string into the szText for Windows to display.

//wcs = wide-char-string = Unicode string, cpy means copy, _s means "more secure" version of the function
wcscpy_s(
di->szText, //The data in here will show up in
80, //Our stupid magical number
convert_str_to_utf16(tip).c_str() //convert our UTF-8 string to UTF-16 to please Bill Gates
);

This line was the source of the crashes.

What’s so special about the number 80 and “_s”?

Window’s gives you a free “no-work” string, szText, for your tool tip text that is 80 characters long. If you want a longer tool tip, you’ll have to do a bunch of (not well documented) work.

What makes this a “secure” string function is it immediately ends the program if you attempt to copy more than the specified 80 characters into the new string. This information is overwhelmingly under-documented. In addition, the crash doesn’t included any information about the cause, even in debug mode!

How did this go on for so long without getting caught?

Amazingly, we’ve never really had this be a problem, or previous versions of Windows have had this function not crash. One reason why this is now getting reported is due to the Truck Destination tool’s Truck Types property. When you add up enough of those strings and hover your mouse over them, it quickly ends up being much longer than 80 characters.

"Baggage Loader" + "Baggage Train" + "Fuel Truck (Jets)" + ""Fuel Truck (Liners)" + "Fuel Truck (Props)" = 81 characters in total.

With enough selected types, this easily reaches beyond 80 characters.

  • It is also possible we’ve just been getting lucky with our memory, always having strings getting corrupted exactly just right.
  • It is also possible that all our data is short, with abbreviations being so common in aviation, its normally hard to reach more than 80 characters.
  • Maybe no one reported a bug (please report your problems so we can fix them!)

Please comment if you have some ideas of why this doesn’t seem to happen on Windows 7, but does on Windows 10. Maybe this “secure” function isn’t as secure as we all think it is.

The solution: truncation!

Our easy fix for this is to chop a string off at 77 characters and append a “…” at the end. Hopefully no-one will mind this.

This new fix will soon make it into a beta and a release. Until then we have this nightly build available.

Final Thoughts

Thanks to a video sent in by a user, this was a pretty easy WED bug to find and solve. The hard part was weeding through all the bug reports that seemed shrouded in unrelated but related mystery. No one was realizing their most trusted friend, the mouse and common tool-tip, were causing the problem.

If you reported a bug, and this helps, please comment and contact us so we can clean out all the mysterious non-mysteries and get back to triaging bugs that have not been fixed!

Thank you for your patience as always as we try our best to make WED the best we can, and thank you to the people who report their problems instead of suffering through it, making a work around, or assuming their simply doing it wrong: You make the product better for everyone, including the developers!

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, Scenery, Tools | 22 Comments

11.01 and Immediate Work

With X-Plane 11.00 out the door, we have a few immediate things we are working on:

X-Plane 11.01: I’m hoping to have it beta early this coming week. We’ll roll the Linux DVD bug fixes into it, as well as rendering bug fixes that didn’t make 11.00, and a little bit of cleanup of the aircraft SDK.

Almost everything for the aircraft SDK is harmless cleanup, but there is one change in 11.01 that really should have made 11.00: the gamma curve on prop discs is still not correct in X-Plane 11.00. I am going to fix that ASAP for 11.01 so that third party developers can have stability.

Like most gamma corrections, your old prop disc might be too bright (because the old alpha blending tended to lose energy). With energy conserved, you might want to tone it down a little bit. I think this is the only gamma change that “got away” but I’m still investigating various cracks and crevices.

(The 2-d panel and panel texture will continue to have its traditional gamma-incorrect blending, matching X-Plane 10, 9, 8, etc.)

Documentation: we have a lot to update; I’ll try to get on FMOD docs as soon as possible. The X-Plane plugin SDK website needs a serious overhaul and may be in “temporary” mode for a week or two.

Developer Support: Philipp and I have been flooded with emails and requests from third parties involving their add-ons. I can’t speak for Philipp, but I’m probably back logged an entire month. If you’ve emailed us with some kind of issue, please be patient – there are a lot of you and not a lot of us.

I’ll post more details on 11.01 when we get closer to a beta.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 122 Comments

Linux and Aerosoft DVDs (and Fixed Apps)

Yesterday we received multiple reports that the Aerosoft X-Plane 11 DVD set does not work with Linux. It turns out that there’s something strange about how the DVDs are authored that makes the file names on Linux go all lower-case, which causes both the simulator and the installer to not be able to use the DVDs.

We have fixes for these problems that will be rolled into a new installer and the next update of X-Plane; in the meantime you can get them here for Linux now:

To install from the DVD, download this installer, run it, and insert your DVD, this installer from the net will install the contents of the DVDs normally.

Once you have installed X-Plane, replace your normal X-Plane-x86_64 app with the one attached here (placing the new app in your “X-Plane” folder) to run using the DVD to get out of demo mode.

You can use these two apps until we issue replacements; 11.01 should go beta early next week and contain “official” versions of these fixes, at which point you can just use the official version.

(Thanks to Daniel for his patience and helpfulness in trouble-shooting this remotely!)

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Development, News | 12 Comments

That’s BettARRRRRRR!

Austin said the previous render was too DARRRRRRRRRRRK (probably because the only image was behind his eye patch) but this one is better.

(I’ll be over this pirate thing tomORRRRRRow.  Maybe.)

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Blooper Reel, Development | 34 Comments

April Fools: the Captain Is Not Amused

As you can see from yesterday’s post and this picture…I blacked out the wrong eye.

It’s the plank for me for sure.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Blooper Reel, Development | 2 Comments

Sneak Preview: Pirate Mode!

Normally we try not to pre-announce new features before they are complete, but it’s been kind of an open secret around the company that we are working on native VR capabilities for X-Plane. Austin mentioned it on a Facebook Live stream, and Chris posted pictures of un-boxing his OcRift and Vive.

So today I’m going to show you a sneak preview of something that I’m just too excited not to post: X-Plane 11’s new Pirate-VR™ mode*.

There are two major challenges to integrating VR with a general purpose flight simulator:

  • Performance. X-Plane typically runs at 30-40 fps on a high-end system on a single monitor. How do we render a stereo image to two eyes without cutting frame-rate in half?
  • Usability. How do users interact with the complex cockpit buttons and switches using 3-d “wand”-type controllers that ship with today’s VR head-mounted displays?

Pirate-VR™ mode solves both of these problems.

When rendering to the head-mounted display, we simulate an eye-patch over the left eye.

By blacking out the left eye, we are able to recover quite a bit of framerate and run a stereo render at over 40 fps; minor optimization should get us to something fluid for the HMD.

In Pirate-VR™ mode, both of your hands are replaced by large metal hooks. Since it is pretty much impossibly to safely operate the over-head panel of an MD-82 with hooks for hands, we can skip 3-d interaction testing on most of the cockpit, simplifying VR interaction quite a bit.

I can’t announce when Pirate-VR™ will ship, but for scallywags who will be joining us at FlightsimCon in Hartford** this year, I think we’ll have something you’ll really want to get your hooks into.

 

* Yes, it is, of coarse, pronounced “Vee-ARRRRRRRRRR!”

** Update: my wife points out that the correct pronunciation is HARRRRRRRRtford.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn
Posted in Blooper Reel, Development, News | 30 Comments