Canvas to Clipboard returns Black

It seems to work fine in the playground but png is completely black on safe website or local site.

Laravel mix is used. Tried all imports

import {} from "@babylonjs/core"; import {} from "@babylonjs/gui"; import {} from "@babylonjs/inspector"; import {} from "@babylonjs/loaders"; import {} from "@babylonjs/materials"; import {} from "@babylonjs/post-processes"; import {} from "@babylonjs/procedural-textures"; import {} from "@babylonjs/serializers";

Hoping someone has some ideas.

If you download your PG and open at the local server it will work.
Do you have any errors in the console?

It works fine if I download it from PG and local server. Everything works fine if I transfer the Index.html file to a Laravel .Blade.php file. But once I transfer the script to a .js file the image is Black with no error codes.

We need to wait for some Laravel expert :slight_smile:

Got it :

var canvas = document.getElementById("renderCanvas"); 
  canvas.getContext("webgl2", {  preserveDrawingBuffer: true,
        stencil: true,
        disableWebGL2Support: false });

var engine = new Engine(canvas);

let scene = new Scene(engine);

It’s a Laravel issue, but it works now

1 Like