LWJGL Forum

Programming => General Java Game Development => Topic started by: dajack05 on June 13, 2019, 15:08:19

Title: AssImp GLTF Embedded Texture questions
Post by: dajack05 on June 13, 2019, 15:08:19
Hey everyone!

So, I've got asset loading working, and AssImp has made my life so much better. That said, I'm trying to use GLTF, and I can't seem to wrap my head around the proper usage of embedded textures.

I understand that AssImp loads the texture from the glb file directly. And I get that when the filename is something like "*1" it means that it is an embedded texture.

Here's where I am stuck. I load a GLB, I recognize that it has an embedded texture and then I want to bind it to a GL Texture. Normally I'd use "glTexImage2D" but I need access to a ByteBuffer to pass it.

Am I missing something here? I know there are a whole host of aiGet* methods I am not super familiar with, but I'm at a loss here.

Thanks for the help!
-
Daniel Jackson
Title: Re: AssImp GLTF Embedded Texture questions
Post by: theVerySharpFlat on November 08, 2022, 03:29:22
I encountered this issue as well. After going into the source code, I found these functions: https://github.com/LWJGL/lwjgl3/blob/c84766565202ba41b71e23ca45a8e84a7d4cb971/modules/lwjgl/assimp/src/generated/java/org/lwjgl/assimp/AIScene.java#L181-L190 (https://github.com/LWJGL/lwjgl3/blob/c84766565202ba41b71e23ca45a8e84a7d4cb971/modules/lwjgl/assimp/src/generated/java/org/lwjgl/assimp/AIScene.java#L181-L190) which address my use case. I hope this helps someone!