I am using the below code to load textures using TextureLoader. It works fine on the browser but not in a mobile app. What I mean to say is that it is working in web applications but not in mobile apps. My mobile app’s codebase is in React Native.
I have used GLView from expo-gl. GLView is used to render 2D and 3D graphics in ReactNative.
const geometry = new THREE.BoxBufferGeometry(1, 1, 1);
const textureLoader = new THREE.TextureLoader()
const dummyURL = "https://images.unsplash.com/photo-1579546929662-711aa81148cf?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Z3JhZGllbnR8ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80"
const dummyTexture = textureLoader.load(dummyURL)
const textureMaterial = new THREE.MeshBasicMaterial({
map: dummyTexture
})
let cube = new THREE.Mesh(geometry, textureMaterial);