Add an OpenGL-Assimp model loading demo
Summary
#619 pointed out that we currently have zero resources demonstrating our Assimp bindings, and because Assimp is usually used with C++ there aren't many resources for the C API which we bind to as is.
We should make a demo model loader using Silk.NET.OpenGL and Silk.NET.Assimp.
In my eyes, this looks like:
- [ ] An ImGui interface allowing you to paste in a file path and load a 3D model (look at
examples/CSharp/OpenGL Demos/ImGuiand ImGui documentation on how to do this) - [ ] When the "Load" button is pressed, call into Silk.NET.Assimp and load the model into OpenGL
- [ ] Loads vertices & indices, and can render meshes (triangulation can be done by Assimp)
- [ ] Maybe loads textures if time permits?
- [ ] Use a Camera similar to the ones demonstrated in
examples/CSharp/OpenGL Tutorialsto explore the model- [ ] However, we'll need a button which will unload the model, put the mouse cursor back into normal mode, and bring the ImGui UI back up again so we can load another model
Resources to Get You Started
- Voltium's usage of Silk.NET.Assimp (very old version): https://github.com/john-h-k/Voltium/blob/master/sources/Voltium.ModelLoader/ModelLoader.cs#L151
- LearnOpenGL + Assimp (using C++ API, doesn't match 1:1 with C API): https://learnopengl.com/Model-Loading/Assimp
- Assimp Simple OpenGL example (uses C API ✅, but uses Old OpenGL 🤢): https://github.com/assimp/assimp/blob/master/samples/SimpleOpenGL/Sample_SimpleOpenGL.c
This is a sizable issue, but doesn't require any deep knowledge of Silk.NET - just a basic understanding of 3D OpenGL (which can be gained from our tutorials) and a willingness to piece things together 😄
As such, this will be great for a community contributor as a learning exercise (or just to play around with Silk more!) and probably a good candidate for Hacktoberfest as well.
I was gonna investigate using ASSIMP later. If I can figure it out I will probably see what I can do if no one else has taken it upon themselves by that point.
Agree, examples would be very appreciated!
I know it's not OpenGL but when I get to the model loading chapter of the Vulkan tutorial series I am porting to Silk.NET I intend to use the Assimp bindings instead. Even though that is not what the original tutorial uses.
Done in #1161, thanks @zoeysaurusrex!