r/GraphicsProgramming • • Dec 04 '23

I hate current state of GPU APIs

Sorry for the rambling but here is my story:

I teach Computer Graphics at the University. For many years I've been using my own OpenGL framework to teach my students the basics of 3D graphics, from meshes/shaders/textures to more complex things (SSAO,PBR,Irradiance Cache, etc).

I provide them with a repo that is small and contains a working project for windows, mac and linux (using SDL). No need to cmake, just contains a VisualStudio, XCode and Makefile project, plus the required libraries so it is straight forward to start. No need to download anything else.

But OpenGL is too old, and I want to teach other stuff like Indirect Rendering, Computer Shaders or Hardware Raytracing for which OpenGL is not the best option (or just not supported).

So time to migrate, but to where?

  • Vulkan is too hard for my students, and it wont work in OSX (I will have to use MoltenVK which makes the project way more complex).

  • WebGPU: The API feels nice but I need an implementation and just compiling the Dawn project is several Gigabytes in size, it is a monster with all the backends.

  • Sokol or BGFX: These wrappers are nice and lightweight, but then Im teaching an abstraction layer that it very random and dont support all features.

So anyway, how will you create a very lightweight multiplatform project for 3D rendering using a modern API that is selfcontained?

Thanks

296 Upvotes

189 comments sorted by

View all comments

2

u/PyroRampage Dec 05 '23

The answer you probably don’t want to hear is - Use Vulkan ! You can provide them with some helper setup code, use Vulkan Hpp from Nvidia, use VMA from AMD, all without abstracting away too much, while making it more manageable. Regarding MacOS, I personally don’t have any experience with MoltenVK, but for students who for some reason cannot find another machine, they can use it in the worst case. Ideally for a module like this I’d expect Linux or Windows. Even without D3D, Visual studio is just nicer for graphics programming.

You could always have them implement a subset of the OpenGL spec themselves in software, for greater understanding of the graphics pipeline. Writing a software rasteriser is a great learning experience.