Search code examples
javascriptbabylonjs

Babylon JS - How can I make the transparent background


I have an online project running with Babylon JS where I need to remove the gray and white background (which Babylon JS has by default), and leave the canvas completely transparent.

I need to see what's behind the canvas, and I can not ...

:(

How is it done, editing the .js or directly from my own html code?

Visit my project here

And the .js here

Thanks!


Solution

  • Hello you should just be able to call:

    scene.autoClear = false
    

    Other option:

    scene.clearColor = new BABYLON.Color4(0, 0, 0, 0);