-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can three.js work with IEWEBGL plugin? #2173
Comments
I don't think anyone has tried it. Considering that you seem interested... do you mind trying it? |
I thought I saw a news item this weekend that IE had sunk to 15%? |
@shermanlsh IEWebGL should work with three.js, but you have to modify the code a bit, because IEWebGL creates the 3D canvas in a different way. WebGLHelper.CreateGLCanvasInline('WebGLCanvasId', OnCanvasCreated, OnCanvasFailed) The WebGLHelper libary is located in here: http://iewebgl.com/Scripts/webglhelper.js If you take a closer look on the code, you will find, how WebGLHelper.CreateGLCanvas = function (el, id, replace, okHandler, failHandler) {
if (WebGLHelper.IsIE()) {
var usePlugin;
try {
usePlugin = WebGLRenderingContext.hasOwnProperty('iewebgl');
} catch (e) {
usePlugin = true;
}
if (usePlugin) {
return WebGLHelper.CreatePluginCanvas(el, id, replace, okHandler);
} else {
return WebGLHelper.CreateNativeCanvas(el, id, replace, okHandler, failHandler);
}
} else {
return WebGLHelper.CreateNativeCanvas(el, id, replace, okHandler, failHandler);
}
} @mrdoob @alteredq : I haven't tested IEWebGL with three.js yet, but I think it will be a great feature, if the users would be able to run the three.js webgl project in IE. http://iewebgl.com/Faq.aspx |
I'm working on it. ;-) |
great, if you have any result, please let me know, I want to get it. |
I tried it in many different ways, but none of them worked. I don't get any error message on the console, it just isn't rendered. |
I have tried it, the IEWEBGL can only work with three.js on the CanvasRender, the WebGLRender doesn't work. I will put the code later, I don't know if this is useful? because a large model run with CanvasRender is too slow, WebGl is must for complex project. |
CanvasRender works with the native canvas support of IE9
|
I also share @adamika2000 experience with trying to run three.js using iewebgl. on ie9 i get a weird error, and in ie10 i get no errors and nothing gets rendered ... i contacted the iewebgl guys and they say that in theory three.js should work on ie10. I am not sure the work that needs to happen to integrate the two though. I also feel that having three.js working in ie10 with iewebgl would be great. any way we can help debug things? |
@gonzoramos I tried everything, but still nothing. I uploaded my last try here: http://armacham.tk |
@gonzoramos I think SoftwareRenderer has more potential than iewebgl+WebGLRenderer. |
@mrdoob The metro version of IE10 can't run plugins, so we can't use iewebgl there, but in desktop ie10 and 9 iewebgl is much faster then softwarerenderer. If you look at iewebgl copperlicht demos, you will see, it's fast enough. I hope, somebody will find, why it doesn't work :-) Unfortunately IE will never support WebGl. They will maybe come up with a directx stuff. |
I concur with @arkasia, I the SoftwareRenderer is just not fast enough :( I think is valuable to have the discussion about what has potential or what does not, as long as we explore both options. How can we help? |
Ah wait, I thought you guys were talking about JebGL. Sure, would be good to know why IEWebGL is not playing along. No errors on the console? |
@mrdoob No error message. It just simply isn't rendered. |
Reading my previous comment it looked like I was dismissing the effort put on the SoftwareRender. Quite the oposite! I love three.js and I want it to become a widespread platform for everybody to produce amazing content on the web. Through iewebgl there is a chance to reach a lot of high-framerate (>40 fps, actually the softwarerenderer demo gives 15fps) scenarios where chrome and other webgl-enabled browsers are not an option and I would love for that to happen. |
@mrdoob No console errors, just a console out saying something like webrenderer49 |
...
Always better to share the actual messages, and not your opinion or interpretation :) |
Looks like IEWebGL isn't a 100% drop-in replacement - http://iewebgl.com/Developer.aspx#CreatingTutorial |
@mrdoob indeed :) here is the actual console error on ie9. i am working on the dev branch, which I compiled unminimized... SCRIPT87: Could not complete the operation due to error 8070000c. which translates to
|
That's indeed a bit more useful ;) |
@mrdoob great! Just to confirm, the SCRIPT87 error y refer above occurs on IE9. IE10's console shows no errors (and no content is rendered) |
Hello everybody. As the developers of IEWebGL we also want to fix all possible issues, preventing Three.js to run on IEWebGL. So if anybody have suggestions or can point us to wrong behavior of the plugin, please let us know. At the present time we tried some demos from Three.js repository. After a couple lines of modifications, we have no console errors, but also nothing is rendered, although rendering loop runs OK. We will continue investigation and will publish results and proposed fixes (if they are required) here. |
Thanks for taking a look at this @iewebgl! It sure will be more effective for you to take a look at this than us. |
@mrdoob @gonzoramos @adamika2000 @chandlerprall @shermanlsh Now it works in IE9 and IE10. It was just a matter of proper initialization. Because of asynchronous nature of plugin loading process in IE, we need to load three.js script asynchronously too, because it has some startup code, that checks presense of TypedArray objects, which are not available in IE9 until IEWebGL is loaded. We use require.js for that. We have also done a one-line patch for THREE.js (THREE.BinaryLoader to be precise), to support receiving binary data in IE9, as it does not support XHR with "arraybuffer" response, we have a workaround for that in IEWebGL (http://iewebgl.com/Developer.aspx#NonStandardBehaviour). var buffer = xhr.response;
if (!buffer) buffer = (new Uint8Array(xhr.responseBody)).buffer;
THREE.BinaryLoader.prototype.createBinModel( buffer, callback, texturePath, json.materials ); There is a problem with Detector class, We don't know how to fix it right, so we've just commented it out, and use WebGL support detection from our WebGLHelper.js. Several demos are available: http://iewebgl.com/Engines.aspx#ThreeJS. If somebody experience problems using THREE.js with IEWebGL, please tell us. |
Great news! Glad that you get it to work. Just one question regarding the code change: if ( !buffer ) buffer = ( new Uint8Array( xhr.responseBody ) ).buffer; I'm currently trying to avoid the if ( buffer === undefined ) buffer = ( new Uint8Array( xhr.responseBody ) ).buffer; or... if ( buffer === null ) buffer = ( new Uint8Array( xhr.responseBody ) ).buffer; ? |
if ( buffer === undefined ) buffer = ( new Uint8Array( xhr.responseBody ) ).buffer; is the correct one |
Great. Thanks! |
three.js is a very good library for webgl, but till now IE don't support the WEBGL, IE covers about 60% of browser now, someone else distribute a webgl plugin for IE, but can three.js work with the IEWEBGL plugin? if so, how it works? thank you very much.
The text was updated successfully, but these errors were encountered: