Course name: It will (hopefully) change soon 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 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 The fixed graphics pipeline and OpenGL 1.x Red book illustration Red book chapter 3 camera picture The red book: https://www.glprogramming.com/red/ This pipeline is flexible, easy to use, and efficient But, it is less direct than programming vertex and fragment operations directly! Bit of an aside: Where does ray tracing fit in? Lighting calculations happen in the vertex operations in OpenGL 1.x So in our red book diagram, that's the box! How it works Must do collision detection on the GPU, generally computationally infeasible for games How else to do it? Back to the point: 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 dislike being a novice so much, I'd rather drink bad lever espresso 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! Let's look at the shader programs from the first tutorial again Focus in on the programs, not what we had to do to run them We can unpack vectors with .x, .y, .z So, how about reshaping the triangle? Piece of cake Upside-down? Sideways? You already changed the fragment shader program How about a fade? 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! Question to think about: Why is gl_Position NOT available in the fragment shader? Thinking period while I apply a fade in the other direction as well 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? Next time: Detail on communication between C code and shaders