dbhvk
May 30, 2020, 12:44pm
#1
I want to run a custom build of the engine with a few less KBs.
The first thing that came to mind was to get rid of the VR/XR modules which I don’t need. There may be some other stuff that is niche specific, if something else comes to mind please mention it.
Anyways, I want to do a custom build of the opensource engine, but I am afraid to break things in the process. Any tips on how to exclude certain parts cleanly?
All my projects are and will be desktop/mobile experiences.
Thanks
This is something that has come up recently and there a GitHub about looking at how we can do that in a more modular way.
Not sure about WebXR support specifically as it’s integrated with the camera code.
Systems like Physics, Gamepad, animation, etc should be easier though.
dbhvk
May 30, 2020, 1:38pm
#3
Could you share a link please?
We have started at looking for a new build system: https://github.com/playcanvas/engine/issues/2103
That said, for most systems, there’s one place that adds it to the engine IIRC and the files can be removed from the build file
Remove files here:
Here’s the hook up here:
this._inTools = false;
this._skyboxLast = 0;
this._scriptPrefix = options.scriptPrefix || '';
if (this.enableBundles) {
this.loader.addHandler("bundle", new pc.BundleHandler(this.assets));
}
this.loader.addHandler("animation", new pc.AnimationHandler());
this.loader.addHandler("model", new pc.ModelHandler(this.graphicsDevice, this.scene.defaultMaterial));
this.loader.addHandler("material", new pc.MaterialHandler(this));
this.loader.addHandler("texture", new pc.TextureHandler(this.graphicsDevice, this.assets, this.loader));
this.loader.addHandler("text", new pc.TextHandler());
this.loader.addHandler("json", new pc.JsonHandler());
this.loader.addHandler("audio", new pc.AudioHandler(this._soundManager));
this.loader.addHandler("script", new pc.ScriptHandler(this));
this.loader.addHandler("scene", new pc.SceneHandler(this));
this.loader.addHandler("cubemap", new pc.CubemapHandler(this.graphicsDevice, this.assets, this.loader));
this.loader.addHandler("html", new pc.HtmlHandler());
There may be some dependencies else where but that’s where I would start.
2 Likes