IE 9 error - BinaryLoader #257

Closed
renegademaster88 opened this Issue Jun 13, 2011 · 9 comments

Comments

Projects
None yet
4 participants
@renegademaster88

Ok so i am trying to get the renderer to use Canvas when WebGL is not available , i have noticed the Canvas Demos run like a dream in IE 9.

But when i called the Canvas Renderer instead of the WebGL renderer it didnt seem to work in IE 9? It works albeit very slowly in Chrome, and Firefox.

I get : SCRIPT5009: 'Worker' is undefined
THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
THREE.BinaryLoader.prototype={load:function(b){var d=b.model,c=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(d),g=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(d);b=(new Date).getTime();d=new Worker(d)

Three.js, line 454 character 236 in three.js

Looks like a problem with the BinaryLoader i am using for my data.

thanx again

@alteredq

This comment has been minimized.

Show comment
Hide comment
@alteredq

alteredq Jun 13, 2011

Contributor

All three.js models use web workers. Internet Explorer doesn't support web workers, so loader will not work there (neither binary nor ascii format).

Contributor

alteredq commented Jun 13, 2011

All three.js models use web workers. Internet Explorer doesn't support web workers, so loader will not work there (neither binary nor ascii format).

@renegademaster88

This comment has been minimized.

Show comment
Hide comment
@renegademaster88

renegademaster88 Jun 14, 2011

oh dear another compatibility issue to deal with... is that why they use a call back function when the new thread finishes loading the geometry.

Is there a work around for this (like using Modernizr for instance) ?

oh dear another compatibility issue to deal with... is that why they use a call back function when the new thread finishes loading the geometry.

Is there a work around for this (like using Modernizr for instance) ?

@renegademaster88

This comment has been minimized.

Show comment
Hide comment
@renegademaster88

renegademaster88 Jun 14, 2011

i found a git hub project to emulate web workers in IE:
https://github.com/guyht/GWorker

i found a git hub project to emulate web workers in IE:
https://github.com/guyht/GWorker

@renegademaster88

This comment has been minimized.

Show comment
Hide comment
@renegademaster88

renegademaster88 Jun 14, 2011

After looking through the gworker code, it appears i need to declare

self.onmessage = function(event) {
//.... worker code
self.postMessage(response);
}

in order to get this to work, is this supposed to be the callback function that i use am using to load my geometry? Would it be possible to integrate this into the loader so that it worked with IE too ?

https://github.com/guyht/GWorker/blob/master/README.md

After looking through the gworker code, it appears i need to declare

self.onmessage = function(event) {
//.... worker code
self.postMessage(response);
}

in order to get this to work, is this supposed to be the callback function that i use am using to load my geometry? Would it be possible to integrate this into the loader so that it worked with IE too ?

https://github.com/guyht/GWorker/blob/master/README.md

@alteredq

This comment has been minimized.

Show comment
Hide comment
@alteredq

alteredq Jun 14, 2011

Contributor

It may make sense to resurrect ajax model loader.

Long time ago we were loading models without workers, but this was making problems for large models (UI thread freezes, warning popups about unresponsive scripts, exceptions, or simply nothing happening).

But with canvas renderer large models are anyways not usable.

The simplest probably would be to fetch via Ajax regular worker model string, strip out worker parts and parse the rest as JSON (that's what Blender importer does).

Contributor

alteredq commented Jun 14, 2011

It may make sense to resurrect ajax model loader.

Long time ago we were loading models without workers, but this was making problems for large models (UI thread freezes, warning popups about unresponsive scripts, exceptions, or simply nothing happening).

But with canvas renderer large models are anyways not usable.

The simplest probably would be to fetch via Ajax regular worker model string, strip out worker parts and parse the rest as JSON (that's what Blender importer does).

@mrdoob

This comment has been minimized.

Show comment
Hide comment
@mrdoob

mrdoob Jun 19, 2011

Owner

I think IE should implement workers rather than people doing "hacks" so stuff works on IE. Haven't we learnt this lesson from IE6 yet? ;)

Owner

mrdoob commented Jun 19, 2011

I think IE should implement workers rather than people doing "hacks" so stuff works on IE. Haven't we learnt this lesson from IE6 yet? ;)

@mrdoob mrdoob closed this Jun 19, 2011

@renegademaster88

This comment has been minimized.

Show comment
Hide comment
@renegademaster88

renegademaster88 Jun 20, 2011

Yes i think IE has really shot themselves in the foot not supporting WebGL or web workers. People will stop using their browser if they can do cooler things elsewhere!

Yes i think IE has really shot themselves in the foot not supporting WebGL or web workers. People will stop using their browser if they can do cooler things elsewhere!

@georgik

This comment has been minimized.

Show comment
Hide comment
@georgik

georgik Jun 21, 2011

Contributor

It's pitty that workers are not available for IE.

For smaller models you can extract model JSON string and create model manually:

var loader = new THREE.JSONLoader();

var model = {
"version" : 2,
"scale" : 1.000000,
....
}

loader.createModel(model, createMesh, '');

Signature of createModel is: createModel = function ( json, callback, texture_path )
For more details see JSONLoader.js - https://github.com/mrdoob/three.js/blob/master/src/extras/io/JSONLoader.js

Contributor

georgik commented Jun 21, 2011

It's pitty that workers are not available for IE.

For smaller models you can extract model JSON string and create model manually:

var loader = new THREE.JSONLoader();

var model = {
"version" : 2,
"scale" : 1.000000,
....
}

loader.createModel(model, createMesh, '');

Signature of createModel is: createModel = function ( json, callback, texture_path )
For more details see JSONLoader.js - https://github.com/mrdoob/three.js/blob/master/src/extras/io/JSONLoader.js

@georgik

This comment has been minimized.

Show comment
Hide comment
@georgik

georgik Jun 21, 2011

Contributor

Note: Workers are also not supported in Google web browser for Android 2.2.
Solution in previous post also works for Android 2.2.

Contributor

georgik commented Jun 21, 2011

Note: Workers are also not supported in Google web browser for Android 2.2.
Solution in previous post also works for Android 2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment