title: Cross-origin image at may not be loaded with PlayCanvas and Amazon s3
body: <p>I'm trying to load texture with <a href="https://playcanvas.com/" rel="nofollow noreferrer">PlayCanvas webGL library</a> from an Amazon S3 bucket but an error happens after loading:</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at --- may not be loaded.</p>
  </blockquote>
  
  <p>launched by playcanvas-stable.js at line</p>
  
  <pre><code>gl.texImage2D(gl.TEXTURE_2D, mipLevel, texture._glInternalFormat, texture._glFormat, texture._glPixelType, mipObject);
  </code></pre>
  
  <p>I made a redirect from 'example.example.com' to 'resources.example.com'. The redirect URL (resources.example.com) is the address of Amazon S3 bucket where texture are stored. </p>
  
  <p>I see many similar errors, so I set the Amazon S3 bucket CORS in this way:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
  &lt;CORSRule&gt;
      &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
      &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
      &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
      &lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
  &lt;/CORSRule&gt;
  </code></pre>
  
  <p>But nothing changes...</p>
  
  <p>Is there something I can fix? </p>
  
  <p>Have you found similar issues?</p>
  
  <p>Thanks.</p>