Jump to content

WebGL CORS image loading


mariogarranz
 Share

Recommended Posts

Some of our games images need to be loaded from an external server. The game may be played on different sites, but these images need to remain always on the same default site.


It's an Amazon AWS S3 server, where we declared the images to be public, which apparently enables CORS loading. It works just fine with CANVAS mode, but when we use WebGL mode we get this error:

 

 

Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at ---- may not be loaded. 

 

 

I have read about some other people having this problem with PIXI, but the problem seems to be with CORS not being enabled (which is not our problem, because these images are being loaded correctly for CANVAS drawing).

Is this normal? Shall we use any special headers when loading these images? Amazon S3 servers don't seem to have many other options to configure CORS other than making files public.

 

 

 

 

PS: I just opened this thread on Phaser forum, but I feel it's more of a PIXI thing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...