Comments (8)
Base64 is not supported in EXGL texture rendering at the moment. The ImagePicker
returns a uri that is formatted differently than other things, this will be fixed with a new version of expo-asset-utils
. This issue tracks that: expo/expo-asset-utils#1
from expo-three.
Great! Thanks so much :)
from expo-three.
expo/expo-asset-utils#1 has since been merged — any word on whether this works with the most up-to-date Expo @szymonkaliski ?
from expo-three.
@andrescuervo sorry, forgot to close. This works now.
from expo-three.
@EvanBacon Thanks for the quick response! Unfortunately I was asking because I can't get it to work.
A reduced test case for this:
const pickedImage = await Expo.ImagePicker.launchImageLibraryAsync({
base64: true,
allowsEditing: false
});
if (!pickedImage.cancelled) {
const base64 = "data:image/jpeg;base64," + pickedImage.base64;
const texture = THREE.ImageUtils.loadTexture(base64); // white mesh
console.log("texture: ", texture);
const geometry = new THREE.PlaneGeometry(0.1, 0.1);
const material = new THREE.MeshLambertMaterial({
map: texture // 1..5
});
const mesh = new THREE.Mesh(geometry, material);
mesh.position.z = -0.1;
scene.add(mesh);
}
And console.log("texture: ", texture);
yields:
texture: Object {
"anisotropy": 1,
"center": Array [
0,
0,
],
"flipY": true,
"magFilter": 1006,
"mapping": 300,
"metadata": Object {
"generator": "Texture.toJSON",
"type": "Texture",
"version": 4.5,
},
"minFilter": 1008,
"name": "",
"offset": Array [
0,
0,
],
"repeat": Array [
1,
1,
],
"rotation": 0,
"uuid": "99191947-F6BD-4B1F-A6D6-47C90347A0A1",
"wrap": Array [
1001,
1001,
],
}
Any insight into what might be going wrong? Thanks!
from expo-three.
Sorry, I saw this issue as "get an image from camera roll to load". The problem you are experiencing is related to the fact that EXGL doesn't load base64 textures
from expo-three.
Gotcha - does this gesture work w/o base64 textures then? Loading via the uri
strategy outlined above also yields a white texture, so I wouldn't consider this issue closed yet, right?
from expo-three.
I would just recommend not using Base64. It's really pricey to move over the bridge and there are ways to convert it to a localUri
that would be just as expensive as incorporating it directly into the method. Let me know if I'm missing something here.
from expo-three.
Related Issues (20)
- Cannot use TextureLoader Expo SDK 45. HOT 1
- Can't load GLTF model because readasarraybuffer is not implemented HOT 1
- Obj, mtl File Could be not read HOT 1
- Broken Examples HOT 1
- create-react-native-app with R3F has mismatched dependencies HOT 1
- iOS white screen - expo-three setup HOT 1
- Unable to render .glb/.gltf files on mobile HOT 3
- WARNING: Multiple instances of Three.js being imported HOT 5
- Eas android black screen
- Possible Unhandled Promise Rejection (id: 0): ReferenceError: Can't find variable: BoxBufferGeometry
- @kyaroru Thank you for your example. Update Example
- Please update to expo 47 HOT 4
- Can't find variable: HTMLElement HOT 1
- Ignore `gl.pixelStorei` warning HOT 2
- iOS support for morph targets
- AVIF and WEBP texture support
- GLB/GLTF
- texture based on file:// url won't load HOT 3
- How to upgrade expo-three to use the latest version of three.js HOT 1
- Has this library been discontinued? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo-three.