Closed dominicrico closed 4 years ago
Hi there,
I'm building a panorama image viewer for iOS at the moment. My problem is that when I load an panorama image my cpu usage jumps from ~5% to over 100% and never drops down.
I'm using this to load the image and create the sphere:
import THREE from './three' export const loadThreeJSTexture = async (gl, src, texture, renderer) => { var properties = renderer.properties.get(texture) await gl.getExtension('RN') .loadTexture({ yflip: false, image: src }) .then(({ texture }) => { properties.__webglTexture = texture properties.__webglInit = true texture.needsUpdate = true gl.flush() gl.getExtension('RN').endFrame() }) } export const loadTexture = async (gl, src, renderer) => { const texture = new THREE.Texture() const material = new THREE.MeshBasicMaterial({map: texture, overdraw: 0.5}) await loadThreeJSTexture(gl, src, texture, renderer) return material } export const createSphere = async (gl, pano, renderer) => { const geometry = new THREE.SphereBufferGeometry(500, 60, 40) const material = await loadTexture(gl, pano, renderer) const mesh = new THREE.Mesh(geometry, material) mesh.rotation.z = Math.PI return mesh }
any ideas why my cpu usage is so high? Thank you in advance!
Hi there,
I'm building a panorama image viewer for iOS at the moment. My problem is that when I load an panorama image my cpu usage jumps from ~5% to over 100% and never drops down.
I'm using this to load the image and create the sphere:
any ideas why my cpu usage is so high? Thank you in advance!