Dynamic texture loading and CORS

Posted on:February 14 2014

I just implemented support for easily loading and displaying external textures in CopperCube, like loading a texture from somewhere on your disk when you create a Windows or Mac OS X app, or from somewhere from your webserver if you are using WebGL and Flash. This feature will be in the next upcoming free update, and it looks like this:


The texture with the statistics on it is an image generated by Webalizer, and it was not included in the project, it was dynamically loaded.
This opens a lot of new possibilities for creating more interesting content with CopperCube, but it still is a bit limited: Both WebGL and Flash Stage 3D have quite severe security restrictions, limiting the locations from where you are allowed to load textures. For example by default you cannot load a texture - say - from www.reddit.com when your webgl website is running on www.irrlicht3d.org, for example. There is a way to make this work as well, using CORS - cross-origin resource sharing. Basically the JavaScript code needs to set a specific flag when loading the image, and the owner of the web server needs to enable this feature as well. Most server today apparently don't, unfortunately.





Comments:


Thanks Niko. This new update will be great. Looking forward to it.
Ed.
Edward
Quote
2014-02-14 14:22:00


yep, some kind of proxy is always needed for this task... crossdomain.xml for flash is a problem too
IPv6
Quote
2014-02-14 19:01:00


Add comment:


Posted by:


Enter the missing letter in: "Inte?national"


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons