Skip to content
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

Firefox vs Chrome WebGL differences - disappearing object #343

Closed
01miru opened this issue Jul 11, 2011 · 4 comments
Closed

Firefox vs Chrome WebGL differences - disappearing object #343

01miru opened this issue Jul 11, 2011 · 4 comments

Comments

@01miru
Copy link

01miru commented Jul 11, 2011

Hi, I just start with WebGL and I have a problem with rendering textures.
In Chrome, everything looks fine but in Firefox nothing appears. What is the cause?
I have enabled support for WebGL in Firefox
Demos from this site work without a problem.

screen's:

http://dl.dropbox.com/u/4271271/chrome.png
http://dl.dropbox.com/u/4271271/firefox.png

code:

http://dl.dropbox.com/u/4271271/CUBE.js

@chandlerprall
Copy link
Contributor

Do you have the Firebug extension for Firefox? If so, can you turn it on and pull up the Console panel to see what errors may be present?

My guess is that it's not working because you're trying to load a texture locally. Browsers treat all files loaded locally as if they are from different domains (cross-domain) and FireFox 5 will error out if this happens.

Can you host your files either through a web host or on your computer through Apache? I'm guessing doing so will fix the issue.

For more information on FF5 and cross-domain textures: http://hacks.mozilla.org/2011/06/cross-domain-webgl-textures-disabled-in-firefox-5/

@01miru
Copy link
Author

01miru commented Jul 11, 2011

This is the same as the files are on the server. I get this message:

uncaught exception: [Exception... "Failure arg 5 [nsIDOMWebGLRenderingContext.texImage2D]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Users/miru/Desktop/projekty/cube/build/Three.js :: L :: line 293" data: no]

@alteredq
Copy link
Contributor

This is the same as the files are on the server

Well, your screenshots and error messages show that you load images from a local file system (file://), not a server (http://).

What's curious is that it works for you on Chrome. For local files to work on Chrome, it has to be started with --allow-file-access-from-files command line flag.

For Firefox, there is a similar parameter security.fileuri.strict_origin_policy accessible via about:config.

Or, as @chandlerprall suggested, you could run local server: Apache, nginx, or if you already have Python installed, there is trivial way how to serve local files via simple server:

$ cd /home/somedir
$ python -m SimpleHTTPServer

http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python

@01miru
Copy link
Author

01miru commented Jul 11, 2011

Sorry, my mistake. When loading from server works fine :)

@01miru 01miru closed this as completed Jul 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants