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
toBaseTexture
for thetexture
parameter =>HDRCubeTexture
subclassesBaseTexture
so that’s ok - the check that
_prefiltered
must betrue
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 tofalse
after the call toCreateEnvTextureAsync
, to get back to the right texture state.