Do you have a git repository for babylon sandbox?

Set the option through the options parameter:

new BABYLON.Engine(canvas, true, {
        preserveDrawingBuffer: true,
        stencil: true,
        premultipliedAlpha: false
});

As @sebavan said, the change to use BaseTexture has been done for 4.2.

However, your changes are ok if you can’t switch to 4.2 and must stick with 4.1, as the only changes performed for 4.2 over 4.1 are:

  • change CubeTexture to BaseTexture for the texture parameter => HDRCubeTexture subclasses BaseTexture so that’s ok
  • the check that _prefiltered must be true has been removed in 4.2. So, setting _prefiltered=true to make the check pass in 4.1 is ok, but you should reset it to false after the call to CreateEnvTextureAsync, to get back to the right texture state.
2 Likes