|
@@ -309,6 +309,8 @@ module BABYLON {
|
|
|
private readonly _scene: Scene;
|
|
|
private _options: IEnvironmentHelperOptions;
|
|
|
|
|
|
+ public onErrorObservable: Observable<{ message?: string, exception?: any }>;
|
|
|
+
|
|
|
/**
|
|
|
* constructor
|
|
|
* @param options
|
|
@@ -320,6 +322,7 @@ module BABYLON {
|
|
|
...options
|
|
|
}
|
|
|
this._scene = scene;
|
|
|
+ this.onErrorObservable = new Observable();
|
|
|
|
|
|
this._setupBackground();
|
|
|
this._setupImageProcessing();
|
|
@@ -557,7 +560,7 @@ module BABYLON {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const diffuseTexture = new Texture(this._options.groundTexture, this._scene);
|
|
|
+ const diffuseTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);
|
|
|
diffuseTexture.gammaSpace = false;
|
|
|
diffuseTexture.hasAlpha = true;
|
|
|
this._groundMaterial.diffuseTexture = diffuseTexture;
|
|
@@ -664,12 +667,16 @@ module BABYLON {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene);
|
|
|
+ this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);
|
|
|
this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;
|
|
|
this._skyboxTexture.gammaSpace = false;
|
|
|
this._skyboxMaterial.reflectionTexture = this._skyboxTexture;
|
|
|
}
|
|
|
|
|
|
+ private _errorHandler = (message?: string, exception?: any) => {
|
|
|
+ this.onErrorObservable.notifyObservers({ message: message, exception: exception });
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Dispose all the elements created by the Helper.
|
|
|
*/
|