Skip to content
Small examples of WebGL
JavaScript HTML CSS GLSL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Test WebGL

Learn WebGL

Troubleshooting

Debugging

No image

SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at file:///E:/projects/webGL/tutorials/resources/snakeIcon.png may not be loaded.

This happens in Chrome. Either,

  • Load the page from a web server, or
  • use Firefox, or
  • Start Chrome with these arguments: --allow-file-access-from-files --allow-file-access --allow-cross-origin-auth-prompt

Can't read local JSON file

Same problem as above, plus the function in webglacademy tutorial doesn't work even adding

xmlHttp.overrideMimeType("application/json");

Better use jQuery.

$.getJSON("myfile.json", callback);
You can’t perform that action at this time.