Hardware and Software
- The Section
- Pre 1992 there were mostly proprietary graphics standards
- Each company had a graphics library.
- And some languages had graphics facilities.
- There was even PHIGS a standardized package.
- In 1992 OpenGL was released.
- The descendants of this software have become the open standard for graphics work.
- Direct3D on windows and Metal on Mac are proprietary competitors.
- A bit of history
- The first computers had CPU driven graphics.
- IE To draw a set of lines, the CPU
- would loop through the array
- Generate the graphics call to draw the lines
- Send these to the graphics subsystem.
- In most cases, it was probably the case that the CPU handled
the graphics subsystem too.
- The GPU was not a GPU but a fancy frame buffer.
- Which quite possibly shared memory with the CPU.
- This was exceedingly slow.
- The big change was the GPU
- Graphics Processing Unit.
- This is called immediate mode.
- Note, that this is mostly what we are doing in JavaScript.
- Notice a few things
- Moving data across a bus, even if it is an internal bus is slow.
- The CPU could be thought of as a "do everything" machine
- But most graphics, in the end need a "do special things" machine.
- These special things are simple, so we don't need a full CPU
- And we tend to do these special things in batches of two to four.
- But we loop over these things a lot of times.
- Flynn's Taxonomy
- SISD: Traditional Computing
-
- MIMD: Committee Work
-
- SIMD: Army
-
- MISD does not make sense.
- These are sometimes modified to SPMD, MPMD in the parallel world.
- Think about what you know about processing:
- We take in 1,000 triangles.
- We do the same thing to all of them.
- We repeat this at the rasterization level
- Modern GPUs are a SPMD or SIMD's programmers ideal platform.
- Versions of the graphics API's including OpenGL have moved towards this.
- The process has changed greatly
- GPU's are now programmable.
- The first part of most modern API's is to send the programs used to render the graphics scene.
- Then send all of the data.
- The commands to draw are usually very small.
- Thus very little time is spent in the CPU performing graphics action.
- The programs are called shaders
- The vertex shader works on primitives (triangles, lines, points)
- The fragment shader works on the "pixels", but not really, the fragments really, but ...
- OpenGL has other shaders as well but we will not mess with these.
- Shaders are written in a language called GLSL (OpenGL Shading Language).
- There are differences between OpenGL and WebGL, but we will discuss these as we go along.
- Vulkan is the next step in the evolution of graphics.
- This is a very low level language for graphics cards.
- It fixes some problems in OpenGL
- And adds more performance and functionality.
- So what
- The book is going to use the old version of OpenGL for 2d.
- I am going to use the html canvas for this.
- We will then merge when we get to 3d.
- In general
- I don't know Vulkan, but I could learn it.
- It is reasonably new and somewhat in flux
- OpenGL has been written on top of it.
- There is general agreement that it is probably not the API for a first level graphics course.