expo-three
expo-three copied to clipboard
Canvas as a Texture
Displaying text in a plane with Three requires text placed on a canvas, then used a texture.
However, doing this in expo causes the error 'Invalid pixel data argument for gl.textImage2D()' I imagine because ExpoThree needs to wrap this texture data somehow.
Am I missing something, or is native magic needed for this?
I think that the canvas is converted to base64 then sent to EXGL to be rendered. Unfortunately Base64 isn't supported in EXGL. I would recommend overriding this logic and writing the Base64 to a local URI first.
@Secretmapper Have you successfully written text on canvas, then used that as a texture?
I am trying to do the same thing. I used react-native-canvas
as the canvas and get the same error, Invalid pixel data argument for gl.textImage2D()
.
Same Error here, map Canvas with CanvasTexture in material fails with Invalid pixel data argument for gl.textImage2D().
Will you plan to create some workflow for this issue?
I'm running into this issue when trying to render text sprites through canvas. Some sort of workaround would be useful.
Same error, trying to use react-native-canvas
with Expo. Any workaround would be appreciated!
Same here! Would be awesome in order to create a game HUD within expo.
Same here!
I would like to use some text rendered via react-native in a texture.
And dunno how to do it, when i'm using ExpoTHREE.TextureLoader with a tmp file i got the error Could not download from ...
Same problem here. Anybody find a work around for this?