Nice Mojo3D Plane Demo

About Monkey 2 Forums General Discussion Nice Mojo3D Plane Demo

This topic contains 23 replies, has 12 voices, and was last updated by  Ethernaut 7 months, 3 weeks ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
  • #13910


    In case anyone missed it on marks twitter:

    I think it looks great, 3d is really coming along nicely, well done Mark and Leo!

    Would love to see an overview of the process from artwork to code setup.



    Wow! Didn’t know my browser could render such nice 3D! KUDOS!



    It’s great, needs to be featured here properly.



    Really beautiful.



    Thanks guys!

    I fixed some of the most noticeable problems on WASM (shadow flickering on pontoons, retina screens not working properly, etc) in the latest branch.

    Not sure I’ll have time to write a full detailed breakdown, but the basic steps were:


    1. Airplane was modeled and UV mapped in Houdini
      1. The scene graph was a bit complicated, since I really wanted all meshes in the same UV space (two materials only, one for the outside, one for the cockpit)
      2. Some parts had mirrored UVs, for maximum sharpness within the texture size.
      3. Exported as two FBX files, one low res (about 15K triangles) and one high res.
      4. The FBX files were not animated! All movement is added via code in M2
    2. The FBX was brought into Substance Painter
      1. High res normals were baked into the low res mesh
      2. lots of Pbr layers were created with multiple materials
      3. Once painting/shading was done, it was all exported to Color/Roughness/Metalness/Normal/Occlusion maps.
    3. Before bringing it to Monkey, I converted the low res FBX file to GLB using Clay Viewer. This step could probably be skipped, since I didn’t need animation and Painter exports to static Gltf. But I wanted to test a workflow that will allow animation in the future.
    4. Finally in Monkey2
      1. Materials were brought in using PbrMaterial.Load, which finds and loads all Pbr texture channels
      2. I made little extensions like Model.GetChild( name ) to facilitate “grabbing” a model from a hierarchy and doing things like replacing materials.
      3. Transparent objects need the Model.Alpha set in code (may not be needed with latest Clay viewer export, haven’t tested)
      4. Using GetChild I was also able to add movement to the ailerons and rudder.
      5. I made a “SmoothValue” class that not only gives me ease in/out, it behaves as if it has inertia, resisting movement change. That’s how the rudder and ailerons animation “overshoot” when they stop moving, for instance. It needs more work, though. Delta timing doesn’t feel right yet.

    Those steps were repeated many, many times as I iterated on the model. Wash, rinse, repeat.


    Basically the same steps as the airplane, actually! Based on this tiny sketch:

    I still want to rig this little guy so that I can pose him more convincingly like a toy!
    The water was all Mark and his fancy water shader.

    For the future, I want an island you can fly around, and a better BG with a proper horizon (as if we’re in a large lake). Will get to it at some point, maybe if Mark revamps the terrain features.




    Great demo!

    One thing I noticed was by switching a tab in this forum for about 30 seconds and then activating the plane tab again, the game was spinning like crazy and the plane went into the “stratosphere”. Anyone else noticed that?

    I use chrome on windows.





    Yeah, I’ve seen that too. Kinda funny.

    Is there a way to pause a monkey app when it loses focus? Would it work on wasm target? I kinda remember Monkey-X having that.



    Great little demo! I said to Mark (via Twitter) that the little monkey should become Monkey2’s mascot!



    So we have a true artist here! Congratulations on this great banana! This could really be the new Monkey2 mascot and the way to go for the logo. But I think it has to be spiced up a little with some ironic hint like the teddy has in the movie ted. In the banana the plane is hint enough, but for a logo or as a standalone mascot it needs at least some kind of an impish grin.



    I’ve compiled a Windows exe if you want to try it:



    One question: Why is the executable so big?


    Mark Sibly

    Why is the executable so big?

    Monkey2 apps are effectively c++ apps, and c++ apps tend to be on the large side.

    I’m open to ideas for reducing exe size (although I’ve probably tried a lot more than people realize along the way) but please note it’s not a high priority for me as I’m OK with current exe sizes right now, ie: I’m willing to live with a little extra bloat in exchange for the added flexilibity having c++ underlying everything offers.

    That said, the zip above appears to have been built using mingw which produces larger than normal exes IMO, rebuilding with msvc halves the size of the exe. When I rebuild ted2 for release, I ‘rebuild’ all with msvc x86 for smallest size + max compatibility, although I doubt anyone’s actually using monkey2 on 32 bit windows?

    Also, the ‘angle’ dlls etc in there aren’t actually necessary as mojo3d uses pure opengl on desktop by default.

    The rest of the zip’s file size is mainly massively cool textures!



    @Mark Sibly
    Thank you so much for clearing up my doubt. Obviously you are absolutely right, that the executable is smaller is not a priority and that can be fixed with upx. at the time of distribution. For example, the previous executable, has been able to compress to a size of 1.93 megabytes. Something amazing for me, due to the original size of Plane. exe.


    Richard Betson

    Very nice! . . . and in Emscripten to boot. Extra bonus points.




    when I try to run the plane demo with Firefox browser, I get the error:

    no native wasm support detected

    What should I do in order to add wasm support to Firefox ? Or is the demo intended to run with other browsers ? Will in the future the Firefox browser supported ?

    Thanks in advance,


Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.