Making 3-d Modeling Less Weird

I mentioned in a previous post that we are working with Ondrej on a next-generation Blender 2.7 OBJ exporter. I am excited for this work because I believe it will greatly improve the artist interface to X-Plane. Let's use instancing as an example to explain the idea.

X-Plane 10 will sometimes draw scenery objects using hardware instancing. When an object is drawn with instancing, performance is a lot better than without it; the huge numbers of objects you can see in the autogen scenery are due to instancing. But the conditions for instancing are, to put it mildly, complicated.

  • The object has to be attached to a DSF. Well, that's not crazy.
  • There's a giant pile of things you're not allowed to do in an instanced object - animation, material attributes, smoke puffs, bla bla bla. (The object has to be simple so that the GPU can draw a big pile of objects without the CPU intervening to handle things like smoke generation on a per-object basis.)
  • Buuuuut...not every ATTRibute is a problem. You can use ATTR_hard in an instanced object, no problem! But don't use ATTR_shiny_rat - that'll kill instancing.
  • But wait, there are these weirdo new attributes like GLOBAL_specular that seem to replace ATTR_shiny_rat that do work with instancing.

If you model, and this seems confusing, it's because it is. You were never supposed to see this!

File Formats for Machines and Applications For Humans

My view is this: the file formats of X-Plane are meant to be seen by programmers, not artists. When was the last time you had to hand-edit an .acf? You just use Plane-Maker. You don't hand-edit a PNG file or worry about its internal compression - you use PhotoShop.

OBJ should be the same way - you should export from a 3-d tool and never have to look inside the OBJ itself. This means the OBJ8 format can serve two purposes:

  • Help X-Plane load models quickly and draw good looking content and
  • Maintain compatibility so older scenery continues to load.

Note that "be really easy to understand in Notepad" is not on the list!

Blender the Transformer

Now here's the trick: the rules for OBJ that a 3-d modeler can present can be different from the rules that the OBJ8 format itself has. And that is exactly what we are trying to do in the new Blender exporter.

Rather than expose global attributes and non-global attributes and all of the crazy complexity of OBJ8, our strategy with the new exporter is this:

  • When you export a scenery object, you specify if you want the object to be instanced or not.
  • If the object is not instanced, Blender creates the best OBJ it can for this case.
  • If the object is instanced, Blender tries to create the best OBJ it can for this case.
  • If the object is supposed to be instanced but you've done something that is not instancing-friendly, the exporter tells you, in terms you can understand.

So for example, if you make an animated radar dish that spins and attempt to export with instancing, the exporter can say "you cannot have animation in an instanced object." Now you, the scenery designer, can make a decision: is it more important to have the radar dish draw really really fast, or is it more important that it spins?

This is the strategy we used for our modifications of Marginal's 2.49 exporter* - the artist specifies instancing and gets a check that instancing requirements have met. This means instance-tagged objects will be fast. (It is possible to check instancing within the sim with DataRefEditor but it's not easy, especially for large projects.)

Don't Expose the Weird

This idea that Blender can transform your work, and thus hide weird X-Plane rules, is not specific to OBJ, not new to X-Plane, and not even specific to X-Plane. When you look at major 3-d game engines (e.g. for combat games and racing games) a ton of code goes into the "art asset pipeline", transforming the artist's original work into something already digested for the 3-d engine.

Another example of this is WED. DSFs have an annoying rule that polygons can't cross DSF boundaries. There are also some even weirder exceptions for a few special cases, introduced in X-Plane 10.20.

WED knows all of these rules; you draw polygons wherever you want and set the export target for the version of X-Plane you want to fly in, and WED figures out the best way to export your work, chopping up polygons as needed.

Shedding Light on Things

Our current work on the Blender exporter focuses on WYSIWYG animation and the material model (which includes instancing support). There is one more area that I think will make a huge difference to authors that we haven't started working on yet: lighting.

The lighting values for commands like LIGHT_PARAM are, to put it mildly, completely goofy. If you've ever tried to read this, you know that even when things are explained, they make no sense.

No author should ever have to write a LIGHT_PARAM. This is a classic case where the exporter should do the transformation for us. What I would like to get into Blender 2.7 is the ability to place a cone light in Blender and have the exporter write the spill light automatically, e.g. filling in the parameters from the position and shape of the light. You light your scene and you see the same thing in X-Plane.

For years we've been behind the curve on user experience when it comes to 3-d modeling. I think we're starting to fix some of those problems in a major way, which should help make the power of X-Plane 10's rendering engine quite a bit more accessible.

 

*As a side note, I have no idea what the current 2.49 script status is. We view the 2.7 scripts as the long term way forward, due to Blender 2.49's not being maintained, so our effort on a truly user-friendly tool is going into 2.7. But we also maintain updates to 2.49 to support our internal team. X-Plane 10.50 will feature a few new OBJ commands, so I will try to post our branch of the 2.49 scripts (which do have this new support) for anyone whose aircraft is in 2.49.

In the long term the 2.7 scripts will feature a migration tool, but I expect we will have a useful 2.7 release (for 2.7 authors) without migration first, and then migration will come later.


  • Facebook
  • Reddit
  • Twitter
  • 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 Development, Modeling, Tools. Bookmark the permalink.

30 Responses to Making 3-d Modeling Less Weird

  1. Andrzej says:

    Ben,
    This probably one the best news I have heard for a long time, I mean it.
    Great job Ondrej and Ben!
    It will be a totally new chapter in X-Plane developing for sure.

    Andrzej

  2. myb says:

    Looking forward a similar post for those artists who prefer to use for 3D modeling SketchUp with Marginal's plug-in. Thanks in advance.

    • Ben Supnik says:

      At this point we (LR) have no plans to upgrade the Sketchup exporter.

      • Steve says:

        I'll be plain, Ben. There is no good reason for this. It's well known that Blender is *not* user friendly. Other applications, such as AC3D and Sketchup, are much easier for beginning modelers to grasp, as well as for those of us used to something more sane than the open source and freeware Blender. The destination format is the same, and there's a ready made code foundation for Sketchup and especially for AC3D. Being myopic and discarding applications that have been useful in the past is counterproductive to the larger community that should not be forced to use just one modeler. If you guys are going to expend time on Blender, there's nothing wrong with a parallel track to give users at least one other, hopefully more user friendly option. The destination format is the same.

        • Ben Supnik says:

          Hi Steve,

          It's a zero sum game. We can have an exporter for lots of editors and have none of them be particularly complete or detailed, or we can have a small number of exporters and have them be complete and have high quality work-flows.

          As I've said in a previous comment, ac3d's feature set doesn't match what an artist needs to make modern models for X-Plane. I haven't looked at Sketchup in a while, but when I last looked, it was in a similar situation - not oriented toward modern game-engine-style model authoring. If Sketchup has had a radical change of purpose and now supports a UV editor with high quality unwrap tools, skeletal animation, render baking, and annotating custom properties, poke me and I'll go take another look.

          I love Sketchup as a program - it is my favorite 3-d editor. But it's really only appropriate for the early part of modeling - it's not going to be a final all-in-one environment like Blender, 3DS, Cinema4D, Maya, etc.

          Cheers
          Ben

        • GPB says:

          I find Blender to be very friendly, as much as any other powerful program. Just need to spend time with some tutorials and learn it first. And it's poly-count friendly. I could not sit down with it the first time and do anything without following a youtube tutorial "blender hangar modeling". Same thing applies to photoshop, sketchup, word, excel, etc.

          • Ben Supnik says:

            It's definitely worth clarifying that Blender 2.49 and Blender 2.7 are -not- the same UI. Blender 2.7 is still not as friendly as Sketchup, but it's not 2.49, which has what might be the most astonishing user interface, like, ever.

  3. Jim Zane says:

    Ben,
    I know, I have brought this up in the past, But I'm curious as to why the commitment only to blender? I have one of the most amazing A4 Skyhawks 4 years in development. https://www.facebook.com/profile.php?id=100003537910447&sk=photos&collection_token=100003537910447%3A2305272732%3A69&set=a.209028505891745.46322.100003537910447&type=3 I also have a host of other projects in the works. All of Which Are done in 3DSMax and imported through AC 3-D. I have no intention of ever using blender. The interface is just too Foreign and nonintuitive to me. Are you guys Supporting other editors Anymore besides Blender?

    • Ben Supnik says:

      Hi Jim,

      We think 3DS is important too, but I don't have anything to announce for 3DS yet. 3DS's windows only status and high price mean it cannot be the -only- 3-d editor we support.

      • Ilias Tselios says:

        As commercial developer for X-Plane the last couple years, I can assure that 3DS Max is not a financially viable option. Blender on the other hand is extremely powerful and free. So, the majority of developers, payware and freeware, and will rely on blender (this is not to wage war blender vs max, but to inform about the financial aspect).

        Ben, is it possible to consider about the re-introduction of the import feature too? I'm asking that because recently a new tool (MeshRemexe) have been available that allows to export part from X-Plane mesh to x-plane .obj, imported to a 3D app, edit it as you like, and re-inserted back to the dsf.

        The workflow now is to do it through blender2.49/xplane2blender3.10, which seems that produces rounding errors (32bit limitation?), and at the end you get few gaps along the perimeter of the edited part of the mesh, while doing the same in sketchup, you get a see less mesh.

  4. Bob Back says:

    Im with Andrzej. Awesome news!
    Thank you Ben and Ondrej!
    Im venturing in the world of 3D and trying to create a library. It will be awesome to have a more "complete" exporter for blender. It will be great to place something like a spotlight in Blender and see the results before exporting it to XP10. The commands are not that much of a problem i guess, but having to change the values, get in XP, back for adjustments, its boring and takes a long time. Creating my first Airport Hangar and using the LIGHT_PARAM took me at least 6 hours to figure out the effects on XP 10, mainly for the first coordinates x, y and z. And that's because i did my research, otherwise i'll probably still be trying to get the values i wanted.

    Im all in for Blender, been reading a lot about 3D softwares and wasn't expecting so much of it, awesome software.

    Thanks again, looking forward to see some new settings for xPlane objects inside Blender.

  5. Kirill says:

    Ben if, LR touched on a topic, then why in the airports with a cold climate in December, green grass on the lawns between the taxiway and trees loose, why do not you fix it and not to make the winter landscape lanshaft in X-Plane 10?

  6. Andrzej says:

    Ben,
    I know that it is pointless to ask about when but I can ask that.
    Are you going to release initial exporter with not fully developed features described above and make different releases/versions with more features rather than finishing all and then releasing it?

    Where the release will be announced?

    Thank you tons. Cheers, AJ

    • Ben Supnik says:

      I don't know what the precise release pattern will be.

      The whole thing is open source, so you don't have to wait for us to say "it's done." If we say "it's good enough for our artists but still unstable" and you say "well, I can use that, I'm an expert", then just download the very latest build.

      https://github.com/der-On/XPlane2Blender

      When we have an official release, I'll announce it here, and probably create some links. But everything is being done in the open - the GitHub code is the latest code.

      • Luke says:

        the last commit was in April... you guys just not pushing to the repo, or is it a different one?

        • Luke says:

          nevermind, it's all in a 3-3 branch, my bad!

          • Ben Supnik says:

            Right - it's on a topic branch while in development. The issues are also in public track tickets and the design docs are mostly in the wiki. (We have one in a google doc temporarily so we can edit it sanely but it'll go back to GIT shortly if Ondrej hasn't already synced it.)

  7. Omar says:

    Hi Ben,

    This is really great news. I understand how the new exporter will convert Blender cone lights to X-Plane spill lights, but what will be the case for light billboards?

    Also, I agree with Blender being the way forward because SketchUp and AC3D lack advanced features, whereas 3ds Max is too expensive (perhaps with many features being too advanced and beyond our use).

    P.S. A while ago, I filed an X-Plane bug report about light billboards appearing weird when drawn infront of clouds with HDR turned on; have you verified that this is an actual bug or is it something else?

    Best,

    Omar

    • Ben Supnik says:

      For billboards, we can hope to put some light parameters into the billboard (e.g. the cone of the lamp defines the angle at which you see the billboard) but it's going to be fundamentally more artificial because billboards are, in the end, a cheat. 🙂

      Re: billboards through clouds, I think it's a design limitation - e.g. you have to make a decision about the Z order of clouds and lights and you get an artifact no matter what. It's in our bug base.

  8. Andrzej says:

    Understood, thanks Ben!

  9. joomie says:

    Hi,

    very interesting article.
    Does the current code for the Blender plugin in the branch v3-3 already include
    some importer to load .obj files into Blender? If not, any idea when one will see that?

    Many thanks,
    joomie

  10. Hugo Silverio says:

    Hello Ben!

    Do you guys plan on having VERTEX animation? for pilots, flags, anything that should be a single mesh and not broken parts.

  11. Daniel_L says:

    Where can we get the last version of the scripts for Blender 2.49 ?

Comments are closed.