diff --git a/src/components/gpu-preloader.js b/src/components/gpu-preloader.js index a2c6b39..681fc20 100644 --- a/src/components/gpu-preloader.js +++ b/src/components/gpu-preloader.js @@ -1,7 +1,7 @@ let i = 0; /** - * Preload stuff to GPU. + * Preload textures to GPU that are not visible from the start.. * three.js renderer by default will not upload textures from non-visible entities. */ AFRAME.registerComponent('gpu-preloader', { @@ -14,6 +14,8 @@ AFRAME.registerComponent('gpu-preloader', { this.preloadCutParticles(); this.preloadKeyboard(); this.preloadMissMap(); + this.preloadPlayButton(); + this.preloadSearchPrevPage(); this.preloadWallMap(); this.preloadWrongMap(); }, 1000); @@ -63,6 +65,16 @@ AFRAME.registerComponent('gpu-preloader', { this.preloadTexture(miss.getObject3D('mesh').material.map); }, + preloadPlayButton: function () { + const playButton = document.querySelector('#playButton'); + this.preloadTexture(playButton.getObject3D('mesh').material.map); + }, + + preloadSearchPrevPage : function () { + const prevPage = document.querySelector('#searchPrevPage'); + this.preloadTexture(prevPage.children[0].getObject3D('mesh').material.map); + }, + preloadWallMap: function () { const wall = document.querySelector('a-entity[wall]'); this.preloadTexture(wall.getObject3D('mesh').material.uniforms.tex.value);