Skip to content

Add CORS support for textures #65

@AustinMontoya

Description

@AustinMontoya

I ran into this problem when trying to load a model from another domain. The .dae came in fine, but a security error happened when trying to render the texture. Last year, CORS for webgl textures was briefly disabled because it actually was a security risk, but now Chrome and FF currently support the crossorigin attribute on Image to circumvent the problem.

I was able to bypass this issue by modifying GLGE.Texture.prototype.setSrc as following:

// ... snip ...
this.image=new Image();
this.image.crossOrigin = "anonymous"; // Allow cross-domain resource sharing for image
// ..rest of code ...

I'm not sure if this is by design or an oversight; however, any clarification would greatly be appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions