Skip to content

Conversation

@ngokevin
Copy link
Member

@ngokevin ngokevin commented Apr 4, 2017

Description:

One image was causing three requests:

  1. <img> in <a-assets>.
  2. Again if crossorigin wasn't set and A-Frame set it for you + re-requested.
  3. three.js TextureLoader

Changes proposed:

  • Pass <img> element through all the way down to the Texture creation process so that three.js TextureLoader doesn't get called. All the way down, we handle string (inline URLs) vs. element (<a-assets>).
  • Store <img> element in THREE.Cache if we use <a-assets> so three.js doesn't ever re-fetch.
  • Start enforcing crossorigin on images because else A-Frame will have to make a second request with the crossorigin flag set if it's not set.
  • Set crossOrigin on the TextureLoader just in case, we had some reports of it not working for inline URLs
  • tests
@machenmusik
Copy link
Contributor

(sounds like images will work more like canvas and video now)

@ngokevin ngokevin changed the title [wip] fix duplicate asset requests (fixes #2472) Apr 4, 2017
@dmarcos dmarcos merged commit 16679ab into aframevr:master Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants