Two more pictures from the test package Tom sent me.  These illustrate both some cool things that happen in X-Plane 10 with global lighting and the process of adopting the new features.  Our strategy for the new rendering features in X-Plane 10 is 3-fold:

  • When the new features (shadows and global lighting) are off, scenery that works in version 9 should just work.  So users always have the option to turn off the new features, use existing scenery, and get some fps back.
  • We try to minimize the artifacts between new features and old scenery.
  • We try to minimize the amount of rework necessary to be fully compatible with new features.  For example, switching from ATTR_poly_os to ATTR_draped is a simple search-and-replace job.

The hangar during the day, with shadows with visible skylights, required some bug fixing in the engine, and a new attribute.  Normally an object is either blended or not blended.  The problem is that a blended object doesn’t let light through for the purpose of shadows.  (Even with the “bug”, the hangar with shadows still looked pretty good!)

X-Plane 10 introduces a new OBJ attribute, ATTR_shadow_blend, that will make an object translucent for rendering (note the grime and dust on the windows) but fully transparent for shadows (hence the skylights let light through).  The attribute works the same as ATTR_no_blend syntax wise, making the update quick.

(You don’t have to use this attribute, but without it, the sim may not be able to produce quite as nice shadows.  Note that this attribute is not necessary for objects marked “glass” on an airplane – they are already handled by a separate process.)

There’s a second bug, visible in both pictures, but more visible in this second picture; the static airplane, which is from version 9, contains a ‘fake’ shadow, consisting of a single quad on the ground via ATTR_poly_os.  During the day, we have a double-shadow (both the one generated by the sim and the fake one) and at night the fake shadow does not go away.

With X-Plane 10, this kind of problem (a technique that is useful in X-Plane 9 clashes with new rendering settings) can be addressed via the conditional OBJ commands.  The conditional commands let you specify that certain parts of the OBJ are only to be used if the user has shadowing off (or global lighting off), for example.  Thus the old shadow works for users who turn off shadows, but goes away when the sim takes care of it.  The same technique can be used to have two versions of LIT textures (or even remove LIT textures) when global lighting is turned on and off.

About Ben Supnik

Ben is a software engineer who works on X-Plane; he spends most of his days drinking coffee and swearing at the computer -- sometimes at the same time.

16 comments on “Coping With New Features

  1. The lighting is amazingly good, the interesting thing is the two shadows in this case work together in the main heavy shadow of the fuselage and the lighter shadow of the higher T-Tail,
    Is Ben becoming a bit god like in things like “well I’ll have a little more light here and and darkness here, I’ll make the world in my eyes, then have a beer on Sunday”
    So does that mean that God (the real one), uses ATTR_shadow_blend to adjust our real lives…omg that means that God is a computer programmer……and we are…

    1. bit-god? No way. The more you work on this stuff the more you realize how feeble the computer-graphics version is compared to the real thing. I’m beginning to think that God created translucent substances just to taunt computer programmers…

  2. very nice, lighting solution is a success, but please!!!, add tessellation feature to models, hangar looks terrible low def model 🙁

  3. That looks awesome!!

    Speaking of new features…. will XP 10 feature Tropical Waters ???

    🙂

    thank you

  4. Please make the night dark and lights more intense like real life. I hate the look of the night in FSX – too bright and unreal.

  5. This just dawned on me after seeing the screencaps: Are we going to have dynamic shadows from canopy frames, glare hoods etc. in 3-d cockpit view in v.10?!

    1. Sort of. You _do_ get dynamic shadows in the cockpit. But the dynamic shadow system can’t shadow translucent things – so glass is simply excluded. So you’ll get a nice shadow from the metal frame of a glass canopy, but you won’t get a tinted shadow from, for example, a translucent visor.

      This is why it is very important that the ‘glass’ elements of your plane be marked “glass” in Plane-Maker — so that the glass doesn’t cast fully opaque shadows.

      1. So will the glass parts use a cutoff alpha to determine what’s shadowed, or does the entire geometry get left out of the shadow casting? Say for example I have an opaque sticker affixed to the window in the cockpit. If that’s just textured onto the glass object, will it cast a shadow, or would I need to make it a separate piece of geometry to make it cast shadows in the cockpit?

        1. As of now, the whole thing is cut out. We have a few different ways to deal with this in the code, and I don’t know what the final authoring interface will look like, so it’s too soon to alter your airplane.

  6. Excellent work, Ben. The default shadow almost looks appropriate for scattered general light (i.e. starlight, moonlight, city light pollution), perhaps if it were more diffuse.

    Another commenter noted the non-believable lighting in FSX. To me, FSX looks like an overdone HDR photo – more painterly and less real. Our eyes work more like dynamic-range-limited film (digital or otherwise). I could see a future X-Plane camera supporting automatic exposure, so a brightly lit day renders the dark shadows of a hangar interior as nearly black when viewed from outside… or when viewed from inside, the outside world looks overexposed and blindingly bright. Just like we see in real life. Extra credit for night-vision adjustment over time that can be wiped out with an accidental bright white light. 😉

    Was nice meeting you an AOPA in San Jose a few years ago. Hope all is well!

    Geoff
    Everett, WA

Comments are closed.