gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

document more the different texture formats

Open gre opened this issue 8 years ago • 4 comments

needs to appear in https://gl-react-cookbook.surge.sh/api#uniforms

gre avatar Jul 18 '17 12:07 gre

Is there any documentation for textures formats at all? It's hard to guess from the source code. Should base64 data uris work? I'm trying with base64 but getting an error: "EXGL: invalid pixel data argument for gl.tecImage2d()"

superhalb avatar May 24 '18 12:05 superhalb

I don't think base64 works for expo. it's more up to Expo side to list what's supported than on our side because we basically pass-in whatever you pass to the gl.texImage2D call

gre avatar May 24 '18 14:05 gre

if you where using gl-react-expo ! then if gl-react-native , i guess we'll need to doc more react-native-webgl. but yeah i agree we need doc

gre avatar May 24 '18 14:05 gre

@gre Would it be possible to preload textures within react native?

I have to dynamically alter the textures of a rendered object with the THREEjs library but the textureloader doesn't work as there's no DOM and the ImageLoader has to make an HTML Image element (document.createElementNS('img') ). There's some texture loaders available but they all require a GL object (and a renderer object) which only seems to be available within the render function.

I tried using the DOMParser library for creating an IMG but THREEjs seems to be unable to work with that as it says: "image.addEventListener is not a function".

robertjuh avatar Jul 23 '18 07:07 robertjuh