var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
var rawrenderer = renderer;
- console.log(renderer);
-
var m = /\((.*)\)/.exec(renderer);
- if (m.length > 0) {
+ if (m !== null && m.length > 0 && m[1].length > 8) {
renderer = m[1];
}
},
initThree: function () {
+ if (this.scene !== null) {
+ return;
+ }
+
this.scene = new THREE.Scene();
if (this.enableLight) {
this.scene.add(new THREE.AmbientLight(0xffffff, 1.5));
},
texturesLoaded: function (t1, t2, callback) {
+ if (this.textures === undefined || this.textures === null || this.textures.length === 0) {
+ // If textures are not loaded
+ console.warn('Texture object not ready. Waiting');
+ var $this = this;
+ setTimeout(function () {
+ $this.texturesLoaded(t1, t2, callback);
+ }, 500);
+ return;
+ }
+
if (t1 != null) {
this.textures[0].map = t1;
}