Course Intro: Before we start: This class is special! I'm not really sure what we'll cover, but it'll be grand At a minimum, you'll learn a lot about how GPUs work We'll start by using OpenGL Might move to Vulkan and Ray Tracing Might go a different direction I'd like some feedback on this in a month or so When you've got a better idea what GPU programming is all about Syllabus, Calendar, Website General format: Projects, presentation of projects, lab assignments Comparison of content with Game Engine Design GPU Programming will NOT cover: Collision Detection Game entity management (object heirarchy, etc) Physics and movement Multi-threading on the CPU Other game-related stuff OpenGL 1.x Game Engine Design did not cover: Vertex and Fragment Shader Programming (at least, not in much detail) Other types of shaders (geometry, tesselation, compute) GLSL (not in much depth, anyway) Non-visual GPU Programming (CUDA, OpenCL) Commonality: Working with 3D (clipping, color, light, etc) OpenGL Justification for OpenGL Other options: DirectX, GNMX, Nintendo API, Vulkan, Glide, etc. OpenGL is cross-platform and easy to start with We might move to Vulkan halfway through "Hello World" is about 1000 lines! But we need it if we do ray tracing Nature of the GPU Memory Large number of "shaders" Originally, they determined color shades Now, they're fairly general-purpose Wikipedia had this to say: In computer graphics, a shader is a type of computer program that was originally used for shading (the production of appropriate levels of light, darkness, and color within an image) but which now performs a variety of specialized functions in various fields of computer graphics special effects or does video post-processing unrelated to shading, or even functions unrelated to graphics at all. Shaders do these things in a graphics pipeline: for each vertex: Apply a transformation for each fragment: Determine a color The full pipeline is somewhat more complicated than this Khronos picture There are other pictures with more stages OpenGL 2.0+ vs. 1.x Shaders: Vertex and Fragment Vertex shader performs 3D math operations We have to program the shaders to do things like rotate! And, we'll have to maintain our own transformation matrices! man works now red book doesn't Libraries: GL GLU GLUT (not always in caps) GLFW (Does what GLUT does, but more modern) GLEW (didn't use it last time, helps with things glut doesn't) SDL (We might not use this much, but it should be mentioned) GLM (GL Math. It'll help you rotate things, etc) Toolchain: "Official" environment is Linux in MLH 310 Don't get behind trying to get all this working on Windows You totally can! OpenGL and Vulkan work very well on Windows! They're just kind of a pain to set up, and I don't know how make gcc / g++ git for some stuff Book! We'd have needed at least a couple I'll assign various online resources Khronos.org is the holder of both OpenGL and Vulkan They have extensive documentation, and we'll refer to them frequently Search the Internet too. Lots of people are interested in this stuff Ok, enough talk, let's do something! Simple OpenGL demo from CS101 But now you have to do things with it! For lab today: Make the triangle a blend of yellow and orange with no blue