Tuesday, September 27, 2011

WebGL

WebGL Experiments
http://www.chromeexperiments.com/webgl

Learning WebGL
http://learningwebgl.com/blog/?page_id=1217

WebGL Specification
http://www.khronos.org/registry/webgl/specs/latest/

Problems & Solutions:

Problem 1: ‘Can not Initialise’ in Firefox 4+
1. Type “about:config” in your browser’s URL bar
2. Filter by ‘webgl’
3. Set webgl.force-enabled = true (double-click)
4. Set webgl.verbose = true (to see error Tools > Error Console)
5. Restart Firefox
http://support.mozilla.com/en-US/questions/720087

Problem 2: Cross-domain WebGL Texture doesn't render
- ‘forbidden to load a WebGL texture from a cross-domain element’ in Firefox 4+
- or 'Uncaught Error: SECURITY_ERR: DOM Exception 18' in Chrome 10+
Solution1:  work locally
1. Encode the image into base64
Binary File to Base64 Encoder
http://www.greywyvern.com/code/php/binary2base64
 2. Put data source in place of the image's path
<img src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...really long string" alt="" />
http://www.devirtuoso.com/2011/09/working-with-images-and-html5-canvas-locally/
Solution2:
http://mmmovania.blogspot.com/2011/09/resolving-webgl-cross-domain-image.html

No comments:

Post a Comment