Introduction to GPUs with OpenGL
engineering.monstar-lab.com
engineering.monstar-lab.com
This is by now also over a decade old but still gives a much better idea how current GPUs work:
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...
OpenGL was always a higher level API, it just is an API that provides functionality instead of being a framework (so you had to make your own). Even in SGI hardware a lot of features were done only in software and during that time on PCs most cards could barely do more than rasterization and transformations (and some not even that).
The only HW that was truly OpenGL was Silicon Graphics IRIS workstations. IrisGL was released as open standard with some minor changed with the name OpenGL.
Also AFAIK IrisGL had functions for creating windows, etc, that didn't exist in OpenGL (GLUT was meant to bridge that gap).
But if I were to teach modern GPUs and rendering I would recommend starting with something like https://tayfunkayhan.wordpress.com/2018/11/24/rasterization-...
The wiki is nice and it has a functional renderer with cpu vertex/pixel shaders, texture mapping and obj loader. A Python version is just 100 lines:
1. Well-thought API with an actual standard
2. Large conformance test suite
3. Trivial deploy on the WebSure the basic examples look similar, until one wants to start porting existing applications.
OpenGL ES is almost a subset of OpenGL, though there are also some ES-exclusive features. With some care it's possible to write code that works on both OpenGL ES (and WebGL if you want) and OpenGL.
Annoyingly there isn't a name for the common subset that works in both APIs.
Additionally, even the overlapping subset isn't 100% equal due to the security constraints on the browser.
https://raytracing.github.io/books/RayTracingInOneWeekend.ht...
https://graphicscodex.courses.nvidia.com/app.html
https://www.gabrielgambetta.com/computer-graphics-from-scrat...
I can vouch for the first two as being good. I haven't actually looked at the third but I found I had a bookmark for it.
If anything it's GPU's that are specialized to address a narrow set of problems.
> CPUs are highly specialized in computational speed and have a broad range of low-level instructions. GPUs are quite the opposite, because they are slower and simpler, but focuses on parallelization (high number of cores), and have a more limited set of instructions.
-------
The only thing I'd change is that I'd say that "CPUs are specialized in computational latency", because speed is an ambiguous word with regards to performance. Latency is more specific and a better description of how CPUs specialize.
GPUs are of course the opposite: GPUs specialize in bandwidth rather than latency.
I thought the concensus is that 1) OpenGL is bad due to hidden states (and if I remember correctly, the hidden states can behave differently depending on the vendor, which exacerbates the problem), and that 2) people should move to Vulkan (or Metal, or DirectX 12).
Vulkan is very deliberately a very very verbose low-level API to allow maximum optimization for game engine developers. It's not meant for your my-first-3d-program usage and it shouldn't be sold as such. Same way as using ASM to write CLI tools isn't a sensible approach.
<start a timer>
vi vulkan_one_pixel.cpp
<add the required code to open a window and draw *one* pixel>
<save, compile, debug, rinse, repeat until a window is opened and a pixel is drawn in it>
<stop timer>
<read timer>
wc -l vulkan_one_pixel.cpp
du -sh vulkan_one_pixel.cpp
<despair>What is nice to see that with Rust's linearity, cleaning resources once they become unused can be cleared quite easily by implementing a custom drop function. The challenge remains though that to know what order you have to do it requires consultation of the Vulkan specification. Though even for this you can enable Vulkan validation layers which actually give quite clear idea what you are doing wrong.
Think of it this way: wouldn't the world be a better place if Linux provided a way to create a GPU process without reference to displays?