Practical sessions
Here are some ideas if you want to get a deeper insight into the glTF format:
- Change the
lightPos
andlightColor
fragment shader variables into uniform variables, and make them adjustable via sliders in the user interface. You could use twoSliderFloat3
ImGui elements – one for the color, and the other one for the position. - Load a binary glTF model. A link to sample models is included in the Additional resources section. The
tinygltf
loader has a function to load binary models, calledLoadBinaryFromFile()
; you should use the filename extension to switch between textual (.gltf
) and binary (.glb
) model format loading. - Try to load the textures of the binary models. The textures are not stored as separate files but included in the binary model file. Compared to the normal file-based method, this should be easier, as you will get the texture data to upload to the GPU as part of one of the glTF buffers – no need to load from files.
- Add...