Jump to content

Build your own Babylon.js


Recommended Posts

Few additions that would be nice to see in the future:

  • Optional AudioEngine, for projects that don't require audio.
  • Remove other post processes that aren't needed (blackandwhite, fxaa etc)
  • Choose which camera(s) to include, so related dependencies such as gamepad input and VR don't need to be included.
  • Option to remove debug (for prod builds)

This is a great to see as a start though : )

Link to comment
Share on other sites

On 11/29/2016 at 10:44 PM, Deltakosh said:

Not everything is a module yet (And this is a desired outcomee, we want bjs to be simple to use out of the box)

@Dad72: Actually they are here. You can scroll down the content of the boxes

@Deltakosh Is it possible to use gulp to remove modules that are not required (remove audio, remove certain cameras) via a custom build? If yes, how would one go about doing so?

If I am not mistaken, this link regarding instructions before submitting PR (taken from github README), used to recommend adding script tags for all .js files produced by gulp. Thus indicating that Babylon can work by including multiple smaller files and not just one large file. This multiple .js file build suggests that one can create a dependency tree for the .ts/.js files and subsequently remove extraneous branches in a custom build via gulp. Thoughts?

Link to comment
Share on other sites

I agree. But this need to be tested. But I like the idea.

Quick way to do it for now: just change this file and remove the unwanted files: https://github.com/BabylonJS/Babylon.js/blob/master/Tools/Gulp/config.json#L17

Here is what we can do:

- Add a new custom.config.json where eveyone can decide what should be included

- Do intense testing to ensure that engine works well when so module are not included (Like if audio not referenced it should not crash :))


Link to comment
Share on other sites

So I did a first try here: https://github.com/BabylonJS/Babylon.js/blob/master/Tools/Gulp/custom.config.json

Just run "gulp build-custom" and it will generate a babylon.custom.js file in the /dist/preview release folder


There is no tests suite per se. For every update/version I'm running the new version with all demos here: https://github.com/BabylonJS/Website


Link to comment
Share on other sites

@Deltakosh Since you have authored multiple javascript libraries, would you know if there is a way to determine what parts of code have not been utilised/interpreted/run/executed until a given point of time in client side execution? Something that can start of with all lines as unused and marking them as used as when lines are executed/run. For example. consider an application that does not require PBR material for the first 5 seconds of execution, this technique should be able to inform the dev that lines related to PBR material have not been used until 5 seconds. I do not mean an unimported code predictor like rollup / webpack work.

Will a test coverage tool help?

I am motivated to try lazy loading of modules/scripts since reducing babylon.js size was not very successful. (Reduced babylon.js from 1.3MB to 1001KB and babylon.max.js from 2.8MB to 2.3MB. Note: Very little testing. Worked with my use case). 

I am not looking for definitive answers. just a sanity check on the thought process and advice.

Thanks for the quick reply and also putting together a command to for custom builds.

Link to comment
Share on other sites

  • 1 year 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...