New OBJ Commands

I have updated the OBJ8 specification with the new X-Plane 10.10 commands.  This blog post explains why we added some of these commands.

Pixel-Space Drag Manipulator

The pixel-space drag manipulator is a new axis manipulator whose drag length is measured in screen pixels instead of meters; its drag axes are always screen aligned, but it works both horizontally and vertically.

The goal of this manipulator is to make draggable knobs that:

  • Have a good response speed for both slow and fast drags via a non-linear curve and
  • Have the same drag sensitivity no matter what camera angle.

The axis manipulator has the problem that it works in 3-d; depending on how you look at the manipulation target (both position and rotation) the sensitivity of the drag can change radically.

Recommendation: use the regular drag-axis manipulator for levers and other physically moving items.  Use the pixel-space drag manipulator for drags where the underlying target does not move, like knobs.  Use button-type clicks for anything that just toggles – it’s easier on the user.

No Shadows

Three new attributes (GLOBAL_no_shadow, ATTR_no_shadow, and ATTR_shadow) allow you to exclude part or all of your object from shadow casting.  Shadows can make certain types of geometry, like grass billboards, look silly; excluding them from shadows fixes artifacts.

Note that ATTR_no_shadow is different from ATTR_shadow_blend..

  • ATTR_no_shadow: the geometry simply does not cast a shadow!  This is meant to exclude objects like vegetation.
  • ATTR_shadow_blend: the geometry does cast a shadow, but only if the alpha is greater than a certain ratio.  This is meant to make windows with tint cast shadows correctly.

Recommendation: fix shadowing bugs using ATTR_no_shadow for non-instanced objects, and GLOBAL_no_shadow for instanced objects.  Use the Plane-Maker check-box for parts on aircraft.

GLOBAL_cockpit_lit

This attribute lets you have your cake and eat it.  In X-Plane 9, ATTR_cockpit gives you alpha blending, but ATTR_cockpit_region gives you correct 3-d lighting.  You have to pick one or the other.

In X-Plane 10.10, GLOBAL_cockpit_lit gives you both.  It makes ATTR_cockpit use 3-d lighting (while maintaining translucency) and it makes ATTR_cockpit_region respect alpha translucency (while maintaining cockpit lighting).

You can add this attribute to any airplane.  This attribute should make it easier for authors to adopt correct 3-d lighting in their airplanes.

Recommendation: use GLOBAL_cockpit_lit on any airplane that uses ATTR_cockpit to change to 3-d lighting for your panel texture.  Also see here for more guidance.

  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • Google Buzz
  • LinkedIn

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.
This entry was posted in Cockpits, Development, File Formats, Modeling. Bookmark the permalink.

11 Responses to New OBJ Commands

  1. Ben says:

    This is awesome, thanks Ben!!

    BTW, are you any closer to publishing docs on the new named lights?

    • Ben Supnik says:

      Not really – every bit of docs help, but I am still pretty back-logged. 🙁

      • Brian Godwin says:

        Same for WED 1.2 docs?

        • Ben Supnik says:

          There are partial 1.2 docs up on the main website.

          • Ben Supnik says:

            First: NO_SHADOW is for everything else. ATTR_no_shadow and GLOBAL_no_shadow are for OBJs. So your facade is good. The OBJ file has its own syntax because it differentiates between GLOBAL things that affect the whole obj and ATTRibutes which temporarily affect drawing. I try to keep everything that isn’t an OBJ consistent with each other.

            Re: instancing, an object is only a candidate for instancing if (1) you don’t use ATTRibutes and selective LOD and (2) your GPU can use it and (3) you use it more than once!

            That point 3 is the key: if you use an object only once, the global attributes really do NOT help you, because there’s nothing to instance (no repeats).

            So my suggestion to authors is simple:
            – If you use an object MANY times, use GLOBAL_xxx.
            – If you use an object once, use ATTR_xxx.

            I have a tech note I am working on that explains this in more detail. Generally the 3-d editor should hide this. For example, in my mods to Jonathan’s Blender plugin, you set a property “instance” to 1 if you want instancing.

            When this property is on, GLOBAL_xxx is used, the export fails if you use any non-instance-friendly stuff, and your stuff will perform well if you use the OBJ many times.

            With the property off, ATTR_xxx is used, and you can use anything, but no instancing.

  2. Chris K says:

    Hi Ben,

    “ATTR_no_shadow for non-instanced objects, and GLOBAL_no_shadow for instanced objects”

    How do I know if my object is being instanced or not? I thought this decision was abstracted from me (the scenery designer) based on the GfxCard’s capabilities and what XP10 has decided is “instanceable” or not. (if thats a word).

    For example, I am doing the following in a .FACade (this is indeed a 2D Grass billboard BTW)

    I
    800
    FACADE
    TEXTURE ckgrass2.dds
    NO_BLEND 0.39
    RING 0
    TWO_SIDED 1
    NO_SHADOW

    Likewise, as per this post http://developer.x-plane.com/2012/03/no-shadows-for-you/ I thought the directive is “NO_SHADOW”?

    – chris k. (Scenery guy and Dorito-Eater, not to be confused with ‘chris the impatient’)

  3. vonhinx says:

    I learned something today. Looking forward to that tech note, a parse-able lights.txt (html, table form, rtf… something that keeps columns entries in line) and a useable definition of the light spill datarefs someday. 🙂

  4. Stuart says:

    This is only out of curiosity, not impatience and because I don’t usually read through all comments following posts here. After 10.10 becomes final, where on the priority list is an updated AC3D plugin for AC3d 7 (if any change is really needed) plus the new’ish types of lights available?

    • Ben Supnik says:

      It’s mid level priority with the tools – we want to get the tools updated soon and not keep everyone waiting, but 64 bit is higher priority.

Comments are closed.