Nice Mojo3D Plane Demo

About Monkey 2 Forums General Discussion Nice Mojo3D Plane Demo

This topic contains 22 replies, has 12 voices, and was last updated by  SekaiChi 7 months, 1 week ago.

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

    peterigz
    Participant

    In case anyone missed it on marks twitter: https://t.co/JwIkqaTkzZ

    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.

    #13912

    abakobo
    Participant

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

    #13915

    DruggedBunny
    Participant

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

    #13917

    Yue
    Participant

    Really beautiful.

    #13939

    Ethernaut
    Participant

    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:

    Airplane

    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.

    Monkey

    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.

    Cheers!

    #13940

    cocon
    Participant

    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.

     

     

    #13941

    Ethernaut
    Participant

    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.

    #13942

    therevills
    Participant

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

    #13944

    Phil
    Participant

    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.

    #13945

    therevills
    Participant

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

    Plane-Demo.zip

    #13946

    Yue
    Participant

    One question: Why is the executable so big?

    #13951

    Mark Sibly
    Keymaster

    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!

    #13954

    Yue
    Participant

    @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.

    #13998

    Richard Betson
    Participant

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

    #14155

    semar
    Participant

    Hi,

    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,

    Sergio

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

You must be logged in to reply to this topic.