News for hackers. Stuff that matters.
Re:I Am Graphics and So Can You by ryandrake on Wednesday July 12, 2017 @04:11PM (#14756196)
It's interesting: In most areas of software, progress over time means moving up in the abstractions. A framework or library starts out with the low level nuts and bolts, requires a lot of boilerplate, large learning curve, harder to get to "hello world", etc. Then, over time, people add convenience layers, simplify, abstract away hardware specific bits, etc. and you end up with fewer lines needed to achieve something that works well.

In the graphics world it's been the other way around. Earlier libraries were higher level, abstracted away a lot, letting you get to "hello world" very quickly. In ancient OpenGL 1.x immediate mode, "Hello triangle" is a handful of lines of code (minus the non-portable window management stuff). As we've moved to vertex buffers, moved away from the fixed function pipeline, less and less is abstracted for you and you have to deal with more and more granular constructs, more and more quirks, and more and more boilerplate. I haven't even started coding with Vulkan, but from what I know about it, any application I'd want to move over to it is probably going to quadruple in terms of line count, complexity, and "things to deal with".

Re:I Am Graphics and So Can You by pandaman on Wednesday July 12, 2017 @10:42PM (#14758361)
OpenGL is not a general purpose graphics library, it's an API to control the actual graphics hardware, as such it follows the hardware, not the user experience. Older GPUs had been very primitive and did not require a lot of commands to do something. For example, the PS2's GPU, GS, was a kind of GPU the OpenGL 1.x targeted. It had hardware registers for vertex position, color and texture coordinate. After every three writes into the position register it would draw a triangle into the current frame buffer (setup through a couple of registers with address, dimensions and format). If you enable a texture (a couple registers), it will draw textured triangles, if not - no big deal. So the OpenGL's glVertex functions mapped nicely to that hardware.

On a more or less modern GPU you won't find those registers. The GPU reads a stream of commands instead of polling its registers. And the most primitive command is DRAW, which means "run the current vertex shader for the given index range, collect its output, rasterize the primitives made from the output and run the current pixel shader on the resulting pixels". So in order to draw anything it's required to have a command stream set up, two shaders set up and necessary data bound to both shaders. Naturally, there is no place for glVertex() in this setup.

There are high level libraries, which abstract the hardware but it's not the purpose of the OpenGL. It's only "abstracting" hardware in the sense that it works same on different models of GPU but it tries to expose as much of the hardware as possible in a model-independent manner.

Re:I Am Graphics and So Can You by slededit on Wednesday July 12, 2017 @08:06PM (#14757741)
That's because a middle layer emerged on top, the game engine.