Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/05/2018 in all areas

  1. lol username

    LDraw vs Mecabricks vs LDD for game models

    Let's say you're working on a model for a new Rock Raiders vehicle, or making a fan game, whatever. Often times people just use exports of LDraw models or similar things, without thinking about it too much. They'll also probably be told this isn't a very good idea, because the results will be highly inefficient. But just how inefficient? Let's find out. For those who may be new to all this: When you create a model with LDraw-based software, LDD, or Mecabricks, the saved model doesn't contain the actual geometry of the pieces. Rather, it's a list of what pieces to put where, in what colors, etc. The three systems mentioned above actually have their own libraries of 3D LEGO pieces. So, while these systems have some level of cross-compatibility (LDD can import and export LDraw models, and Mecabricks can import LDD models), this has no bearing on the brick geometry used. For example, if you build a model in LDD, then export to OBJ with an LDraw-based program, the geometry in the OBJ will be of LDraw's pieces, as if you had built it in LDraw to begin with. For these tests, I built a simple test model in LDD, which I was then able to also work with in LDraw-based programs (in this case, LeoCAD) and in Mecabricks, thanks to the cross-compatibility mentioned earlier (though Mecabricks lacked the specific window pieces I'd used, so I had to swap them out with a very similar part it did have). Option 1: LDraw LDraw is a (mostly) fan-created library of 3D LEGO pieces and software for doing things with them. Its origins go back to 1995, and the accuracy of the brick models is often hit or miss (there's an especially notable problem where all the holes in Technic bricks are at the wrong height). The brick models also aren't built with realtime rendering in mind; they favor sharing as much geometry between multiple parts as possible, but this leads to a lot of inefficiencies on exported models. It's also worth noting that studs, tubes, etc are 16 sided, and studs are 4.8 mm wide. There's a few ways of exporting LDraw models to other formats, but they generally give similar results. For this, I exported the test house to 3DS with LeoCAD. There are some issues with faces being flipped the wrong way and smoothing/normals being messy, but in the end, that's the least of your concerns: the triangle count for this simple model is 50350. Most of these tris come from the studs and tubes inside the walls and such; a complete waste. Model - Wireframe Option 2: Mecabricks Mecabricks is relatively new, web-based, and has its own unique brick library made in Blender (with occasional brick geometry borrowed from LDD, though not much, and those cases are gradually being replaced with custom geometry - more on that later). As you can read in that topic, the basic part dimensions are similar to LDraw, but additionally, the outside dimensions of the bricks are reduced slightly to leave gaps between them, like on real LEGO pieces. I exported the house to OBJ with Mecabricks, and the resulting model was 42927 tris - better than LDraw, but still not well suited to a game. Still lots of waste on hidden studs and tubes. Model - Wireframe Option 3: LDD, LXF to OBJ This method uses an old tool by bartvbl that is no longer available, however, I still have a copy and thought I'd include it in these tests. It assembles LDD's bricks together into your model and saves it as an OBJ (though it doesn't support things like flexible elements and decals). LDD's studs are 4.9 mm wide (the official LEGO measurement), but more importantly they're 12 sided rather than 16, and the bricks are generally far more optimized for realtime rendering: the resulting model is 30586 tris. There's still the major issue of hidden studs and tubes, though. Model - Wireframe Option 4: LDD, 3DVIA Printscreen capturing This method works differently than the others: It captures directly from LDD as it's running. Why does this matter? LDD has a system that automatically removes studs, tubes, etc that cannot be seen. It doesn't remove everything, but it does a lot - in fact, LEGO patented it. Capturing with 3DVIA Printscreen, then converting the resulting 3DXML to OBJ with my tool, results in the test house model only having 13548 tris, while looking identical to the previous method! (It also supports flexible elements and decals, if your model has them.) Model - Wireframe Option 5: LDD, 3DVIA Printscreen capturing, with "cap" bricks This is a strategy Hollis/cdmpants came up with. I'll write a topic with specifics later, but in short, you place bricks in your LDD model that serve no purpose but to trigger geometry removal. The bottom of the roof has many tubes that aren't covered, so LDD doesn't remove them - but, if this were in a game, the player would likely never see or care about them. So we put caps there (and on the bottom) to get rid of them. Then, once the model is converted, we delete them, leaving the more optimized bricks they were covering behind. Doing this reduces the model to 2586 tris. Model - Wireframe Option 6: Remodel it yourself The inevitable conclusion. Any model can be optimized further with some manual work; I decided to use the LDD 3DVIA Printscreen rip as a base and work from there. I was easily able to get it down to 884 tris. Model - Wireframe There's another difference between brick libraries: LDraw and Mecabricks are fan-created (well, mostly - we'll get to that in a moment), and LDD's brick geometry is owned by LEGO. So, can you use LDD geometry in game mods, fan games, or other unofficial software? Up until recently, I was under the impression that LEGO was strongly against it. The only major fan-created software (that I knew of) to contain LDD geometry - or rather, enhanced versions of it - was the LDD to POV-Ray Converter: More information was given in this Eurobricks post: In May, I contacted LEGO Customer Service to ask if there were any way for other fan-created projects (such as my own) to use LDD geometry with the official blessing of LEGO, as the LDD to POV-Ray Converter had. Here's their reply: So, using LDD geometry with direct, official approval from LEGO is unlikely to happen these days. The only exception seemed to be a collection of LDD parts that the LEGO Universe developers had shared with LDraw, to "ease up the conversion between LDraw and LEGO Digital Designer". The LU team sent part geometry to LDraw in several batches, the first in 2007, and the last in 2010. But then I found out something unexpected: From 2011 to the present day, LDraw has been adding LDD bricks to their library even beyond the ones officially given by the LU team: https://forums.ldraw.org/thread-800.html https://forums.ldraw.org/thread-1145.html https://forums.ldraw.org/thread-5310.html LDraw's files are plain text, and part files contain information on their history/authors. LDD-derived LDraw parts credit "LEGO Digital Designer" as the author, and searching for that through all files in the current LDraw parts library reveals 542 files which are sourced from LDD. Up until I found this out, I had been basing models in my game project off of LDraw geometry, to avoid using LDD geometry without approval from LEGO. But it turned out that many of the LDraw parts I'd been using were just slightly modified LDD parts, ripped by LDraw parts authors! I then checked Mecabricks, and what do you know, they also have some parts that come from LDD (the ones I specifically checked were some minifig hair pieces). It's a low amount and they're gradually being replaced with custom geometry, but it goes to show LDD ripping isn't a dark forbidden practice or anything. So both LDraw and Mecabricks (and thus their users) have been using LDD geometry, and LEGO doesn't seem to care. And LDraw has been doing this for six years as of when I write this, for hundreds and hundreds of parts. Thus, I think it's safe to say LEGO probably won't care if you were to do something similar in a mod or fan game. Just don't go running around screaming "THESE ARE LDD MODELS, I AM DISTRIBUTING OFFICIAL LDD GEOMETRY EN MASSE, HERE, DOWNLOAD THEM", and chances are you'll be fine.
    1 point
  2. mumboking

    The FREE GAME notification thread!

    Currently free on GOG: "Xenonauts"
    1 point
  3. MinifigRenderer

    Racers Logos.PNG

    From the album: LDDMods Images

    1 point
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.