Jump to content

What's next?


Recommended Posts

On 11/25/2017 at 3:44 PM, adam said:

I think that @Tomm Huth is referring to a non global import like:

import { Scene, ArcRotateCamera, MeshBuilder } from 'babylonjs'

With the current babylonjs structure webpack is unable to tree-shake explicit imports (as indicated at the end of the NPM page) and will take everything.  I don't think that's an unreasonable thing to have on a wish list!  I am honestly super happy with the progress to get the current NPM support, but agree this would be nice to have.  As @Sebavan said the custom builds would work, but are not as convenient.

Link to comment
Share on other sites

@brianzinn you're totally right. Also I don't understand how plugins could possibly work in a npm workflow, if they all require a global export. 

Building your own version is really only a viable solution as long as you don't use NPM. I did manage to get my own build working, but ended up having to strip out the extra Oimo plugin (500kb extra for no reason if using Cannonjs), and also fixing a problem with the export at the bottom:

(function universalModuleDefinition(root, factory) {
    var f = factory();

    if (root && root["BABYLON"]) {

    var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
    globalObject["BABYLON"] = f;

    if (typeof exports === 'object' && typeof module === 'object')
        module.exports = f;
    else if (typeof define === 'function' && define.amd)
        define(["BABYLON"], factory);
    else if (typeof exports === 'object')
        exports["BABYLON"] = f;
    else {
        root["BABYLON"] = f;
})(this, function () {
    return BABYLON;

For some reason Heroku chokes on this, complaining it can't find BABYLON export 

ERROR in ./node_modules/babylonjs/dist/preview release/babylon.max.js
Module not found: Error: Can't resolve 'BABYLON' in '/tmp/build_2f05ec3c0854af6ba703385c4238bd5e/tommhuth-stacky-4c50f39/node_modules/babylonjs/dist/preview release'

This is not a problem for me locally, and Heroku could not find a reason why this should happen. The solution to get this to work was to simply:

module.exports = BABYLON

For a pretty simple game (http://stacky-game.herokuapp.com/) i saved around 3mb unminified by building my own version -- on the web EVERY KB counts. The downside is that I have to manually edit the generated file and commit generated code to my repo :/

There's lots of great stuff in Babylonjs, so there is no reason why it can't also be more in line with a modern JS workflow. :)

Link to comment
Share on other sites

  • 2 weeks later...

My wish list is basically the continued improvements for webvr:

(Pardon me if it's already covered in 3.1)

- Controller support for Gear VR, and possibly the upcoming Vive Focus and Oculus Go

- Gaze events, along the line of onGaze{Enter|Leave|Move|Xxx}Observables

- Api for dragging/dropping and rotating object using the controller. (so people don't have to reinvent the wheels on their own)

- Custom controller gltf image and behaviors

Link to comment
Share on other sites


Second the zinnman.... @brianzinn on AR support as a package.


1) More AR explorations +1.


       BABYLON works fine on AR. But caveats: wasm heavy , AR.js needs refactoring to package, and suggestion for ARToolkit is promising for review.

      No cycles here until February for AR. Plugin probably deserves (team) or someone more expert than afalcon.

      -->AR-Board-Games<-- in babylon. Cat out of the bag...woosh! :)!?!

      Very interesting...      


2) Interpolation.

       RESEARCH: "time-based-animations  different than frame-based-animations" ~ T. Parisi.

       - And where question pops up. BABYLON has great frame-based-animation on static-type-attributes. .animation(type, f(){keys, frames)...

       QUESTION: does BABYLON have time-based-animation? With dynamic types? Looking, not finding... maybe afalcon missed this?

       Wishing for support of single-line-dynamic-time-based-interpolation syntax like similar 'inbetweening' originally from pixar (not 3):

BABYLON.interpolate.from({x:0}).to({x:10}, time).onFrame(f()).onDone(f()).begin();

       Unique names for BABYLON, but release the "chains" ...

       Instead, Object Configuration Pattern... to rescue, configurable and unique:


        Why? --> Ideal for animators making cinematics that queue dynamically off JSON scripts. CONSIDER:

anim = {...
,cam:{cur:{"x":0,"y":8,"z":-28},tgt:{x:0,y:8,z:-20}, tar:{"x":0,"y":6,"z":0}, dur:1000},

      :)  Enables an Animation Factory Pattern... (almost).


3) MeshEditing... what???

          Why would anyone ever...? You might think: Mesh-Editing is massive.We have great importers. There are advanced vendors. glTF, etc, etc....

          Ah. Yeah, all true. But wait! It is a total-thrill-ride to edit mesh directly inside of BABYLON at run-time! 

          1) Save to beautiful native arrays of numbers and awesome complex custom components (like @JCPalmer shows). And edit assets after import(!)

          2) Similar to awesome terrain editors,  extended build... to buildings, cities, and all kinds of low-poly-props. e.g. Skateparks. With simplified 3D Pipeline. 

          3) hover-editing concept from @Wingnut and @Arte, promising. And "quad-state-vertex-click-editor" where rgb === xyz,  & drags on axis... till click!

                     Countless questions: Might it extrude?  Select All/Deselect? Drop-In Shapes? Materials ectera...  Trail goes forever. Inspired by :) Wingnut.

           4) "Creative Mode"...  heard it is popular with kids.



           Moving stuff around (real-time) in BABYLON:



4) ~ Plugins:

          With JCP on a bunch of things... including -->keeping size down<--.

          Suggestions above - as plugins. 

           afalcon does not know how to make plugins. Looked into great ones... @Dad72

           Happy to build plugins... not sure where to start.  



Thank you @Deltakosh. This community is the best.

Link to comment
Share on other sites

On 12/19/2017 at 2:19 PM, MarianG said:

Hello. I think we need a direct dae loader.

The reason is file size, and first loading time on page.

As example:

I have a static dae object around 7mb, export bynary file from 3dsMax around 13mb. :(

With optimize vertices checked on export.

My experience with Collada / DAE going from MakeHuman has not been good with regard to skeletons.  If you implement this, pay attention to skeletons for sure.

Last time I looked at 3dsMax exporter, several years ago (I cannot really read c#), I thought the text version was exporting 8 decimals.  I am only doing 4 decimals for Blender.  This reduces file size greatly, without anyone really able to tell.

This would not directly help a binary, but rounding prior to optimization could yield much better results.  5.78324897 & 5.78324366 both round to 5.7832.  For my implementation of morph targets, I go even further allowing a tolerance after rounding for detecting a vertex change using:

def similar_vertex(vertA, vertB, tolerance = 0.00015):
    if vertA is None or vertB is None: return False

    if (abs(vertA.x - vertB.x) > tolerance or
        abs(vertA.y - vertB.y) > tolerance or
        abs(vertA.z - vertB.z) > tolerance ):
        return False

    return True

This has no effect for BJS morph targets, since a morph target cannot be a sub-mesh.  I have thought about using this for the optimization of initial vertices too, but have postponed until I allow for changing the number of significant digits.  I use decimeters for units in my scenes, but some might use meters.

For Tower of Babel, I use a whole host of additional optimizations.  The simplest is lead zeros are not printed.  leading zeros are about 10% of the entire file. Unfortunately, JSON rules do not allow this so .babylon format cannot use this.

Link to comment
Share on other sites

  • 1 month later...

My needs are really for avatar handling.  Stuff that you'd use for 3rd-person games.

What I think would be cool to have is

  • root-motion (so root bone of skeleton can permanently move the body)
  • morphing that also includes texture morphing and can read those textures from a texture atlas
  • combining animations (so character can run AND shoot)
  • better animation merging (something looks strange when one animation merges into another)
  • be able to export shape-keys and animation from Blender
Link to comment
Share on other sites

suggestion : a Scene Manager

something to link scenes, to orchestrate their succession, etc

example : scene1 = menu, scene2 = gameParameters, scene3 = level1, scene4 = level2, scene5 = level end, scene6 = game end, scene7 = introGame, scene8 = introLevel1, scene9 = introLevel2, etc

 How can I define the game graph to link all these scenes, what conditions trigger one or the other start after some given scene, etc 

Link to comment
Share on other sites

13 hours ago, Deltakosh said:

"Better animation merging (something looks strange when one animation merges into another)": Can you repro this one?

Actually I have this exact same problem as this one

When my avatar is flying and transitions from horizontal to vertical the body gets warped during the blend.

Link to comment
Share on other sites

@aFalcon, yeah should not be to hard to script up a system like that.

I would have the callbacks wrapped in an object that you can have a complete variable stored on, then have a "action" stack or a array that checks the first element in the array if its not been fired, mark it as fired and then run it, then after the function is done have it set the parents variable of done so the action stack knows and then splice that action out and proceed to the next one.

Link to comment
Share on other sites


I now know that you can freeze dynamic shadows with this setup.

shadowGenerator.getShadowMap().refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE;

However, there are still a few movable objects in my scene, can you add a similar one in the future, such as mesh. ShadowRefreshRate=60 setting, to set the shadow matrix calculation of some mesh.


Link to comment
Share on other sites

  • 2 weeks later...

Hi @Deltakosh
If i may suggest some additions to the Babylon GUI;

Because who can't use a dropdown menu :) 

Slider isVertical option,
Because.. it would be nice.

Stackpanel overflow scrolling(..slider) when a predefined width or height is set and exceeded (depending on whether the panel is horizontal or vertical) (or a new 'overflowPanel'?)
Being able to predefine height's & width's while the contents are dynamic is a widely used feature when designing GUI's

Cheers :) 

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...