-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native - useGLTF causes EXGL: gl.pixelStorei() doesn't support this parameter yet! #2574
Comments
That warning comes from three with calls to |
Thanks for the fast reply. Do you know any workaround to ignore these logs? |
If you want to hack const pixelStorei = gl.pixelStorei.bind(gl)
gl.pixelStorei = function(...args) {
const [parameter] = args
switch(parameter) {
// expo-gl only supports the flipY param
case gl.UNPACK_FLIP_Y_WEBGL:
return pixelStorei(...args)
}
} |
Alright sounds interesting. Im not very familiar yet with these 3d graphic libs so im still learning what is being called on each single function. |
You could modify both libraries, but a user-land hack like I provided above should also do. It may need some tweaking as I haven't tested whether the |
Alright I get the logic but im still kinda confused and it might sounds stupid and I apologize for that. But where should I write this user-land hack and how do I get access to this 'gl' variable? |
<Canvas
onCreated={(state) => {
const _gl = state.gl.getContext()
const pixelStorei = _gl.pixelStorei.bind(_gl)
_gl.pixelStorei = function(...args) {
const [parameter] = args
switch(parameter) {
// expo-gl only supports the flipY param
case _gl.UNPACK_FLIP_Y_WEBGL:
return pixelStorei(...args)
}
}
}}
/> |
Holyyyyy I just go rid of these annoying logs. I'll check if everything is working in production aswell which I believe it is. |
Im actually having a little problem in production. The glb/gltf files are in the raw folder as I believe its expected but they are not being loaded properly. Im running the app in android and the model is undefined. |
Can you create another issue with a reproduction of some kind? I can take a look but it might be related to #1972 where embedded textures can't be decoded since react-native doesn't implement ArrayBuffer => Blob. In that case, see #1972 (comment). |
Hi im currently using r3f in a react native project. Im loading a .glb model and it works but im getting a spam of logs saying that 'EXGL: gl.pixelStorei() doesn't support this parameter yet!'. I believe it comes from the function useGLTF:
import { useGLTF } from '@react-three/drei/native'.
const { nodes } = useGLTF(url)
Any idea about this? Btw, im not exporting neither using textures here.
Sample of the code:
The text was updated successfully, but these errors were encountered: