-
Notifications
You must be signed in to change notification settings - Fork 136
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
glb binary texture data #188
Comments
If the ( However if the |
Oh.. I see.. The normal map. I was looking for the main texture, where is it located in the data structure? |
Keep in mind that some primitives might have no textures whatsoever, but you could look in |
Thank you so much @prideout, it appears I was looking in the wrong place. Now I can see the textures. |
I'm trying to combine cgltf and stb_image to be able to import textures and render them on my 3D model using OpenGL. The code is available here. I was hoping that the binary texture data would be under primitive->material->normal_texture.texture->buffer_view, but unfortunately "texture" is NULL.
Here is the call I was hoping to use to load the binary information about the images:
m->texture.data = stbi_load_from_memory(tview->buffer->data + tview->offset, tview->size, &m->texture.w, &m->texture.h, &m->texture.channels, 3);
But this does not work. Can you please help me out?
I know cgltf is not concerned with loading images, but couldn't it at least load the binary image data in the glb file? The binary information only, it doesn't need to understand or process it.
The text was updated successfully, but these errors were encountered: