A few things I'm likely to expect you to know without thinking about it: Higher framerate is good Gamers spend, or would if they could, a bunch of money on high framerate Higher detail and smoother curves is good Sorry, minecraft fans Everyone still thinks Radeon cards are made by ATi AMD bought ATi years ago Everyone is pretty familiar with the graphics market nVidia and AMD are the main players nVidia: GeForce, GTX, RTX (Ray Tracing), Quadro AMD: Radeon, FireGL Intel: Crummy built-in laptop graphics Matrox, 3DFX: Both of these are former graphics giants Refresh rate limits displayed framerate All 3D figures are made of triangles Feel free to contradict this if you're into 3D modeling OpenGL used to have a few other modes I sort of assume everybody has spent a long time playing FPS games Like Unreal Tournament or whatever Ok, let's recap a bit, and talk about 3D graphics OpenGL: Open Graphics Library Started by an industry group including Silicone Graphics Presently maintained by the Khronos group Current version is 4.6 Cross-platform, and supported everywhere I can think of "Red Book" is the standard guide, but the online version covers 1.x - If you order a print copy for money, it can cover more recent versions "Orange Book" is the GLSL guide, but again, the online version is old - Worth reading anyway though A major shift took place in OpenGL 2.0, and "shader" programming was added - Don't bother with older tutorials unless you're into history Basics: What is a transformation? https://www.tutorialspoint.com/computer_graphics/3d_transformation.htm Matrix Multiplication (review of whenever) Basic operations: Rotation Translation Scaling Shear isn't used all that much in graphics for games and such, but it works too... You can combine multiple transformations in a single matrix! Crafting a matrix is a fine way to accomplish any transformation At some point, we should do this without GLM. For now, we'll skip that Manual operations in the real world, and my cousin Direct control in detail is good, but it's also a hassle Separates the pro from the novice So, roll up your sleeves and get ready for work! It's ok to be a novice at some things, but not at your profession I can't strike an arc, but thanks to the easy way, I can arc weld OpenGL 2.x and the shader programming revolution Game developers desired greater control over vertex and fragment operations Vulkan takes the control further So, we will have a high-level shader programming language! There are a few out there. We'll learn GLSL Compiler is IN THE DRIVER Why? Depends on the hardware! This is in contrast to Cg, HLSL, etc. Driver update can change compiler New compiler can be used for new hardware! The bad old days: ARB_vertex_program and ARB_fragment_program Frontend is open source Back ends generally aren't I'm sure there's one out there More about GLSL C basis, but matrix operations are built-in! We can unpack vectors with .x, .y, .z So, how about reshaping the triangle? Piece of cake Upside-down? Sideways? Built-in variables: https://www.khronos.org/opengl/wiki/Built-in_Variable_(GLSL) Or, different colors on each side? That could actually be hard with 1.x! Ok, let's do something strange in the fragment shader Invert colors? Ban use of red? Washed-out effect? Something like that... Question to think about: Why is gl_Position NOT available in the fragment shader? Discussion If we have time: The vertex shader interprets the vertices however it wants That means we can actually hack these in the vertex shader, in 2D, without matrix operations Scale up and down? Translate? The hard one: Rotation? We should probably talk more about linear algebra first How do we get data from the C part of the program into the shaders? There's a couple examples in there, but basically, uniforms or attributes See how MVP is done? We could add another uniform that does something What we're doing here is copying data from main memory to video memory It's a copy, so it could get out of sync The data has to go across the bus to the video card (PCI Express, probably) Bandwidth: Video Memory > Main Memory > PCI Express Our MVP is only 64 bytes, but think about this before sending gigabytes per frame