Welcome to the OpenGL, GLSL and computer graphics course!
It is practical and illustrated program, designed to give you a visual intuition and practical skills to program computer graphics using OpenGL, GLSL and C ++
It is raw concentrated squeeze of OpenGL and GLSL knowledge (no “water”! no long talks that make you fall asleep)
The course is designed to start from fundamentals – and move to advanced topics like shaders, matrices, transformations, GLSL language, raster effects, texturing and shading.
In fact, the course is very easy to master. Because it is practical, visually illustrated and has code samples and live coding sessions.
It’s created to help you develop the visual intuition about 3D programming models (so I developed some beautiful illustrations and visualizations – just to show you how things work “under the hood”)
It will help you to build the proper mental models, patterns, and coding skills – to grasp the underlying concepts and internal elegancy of OpenGL machinery, as well as 3D math (because they’re tricky)
There are live coding sessions and you get the full access to the source code
The course covers all important topics of modern OpenGL, such as:
– geometry, and buffers, VBOs and VAOs
– transformations and matrices, matrix hierarchy
– shaders and GLSL
– procedural art (and GLSL shaders-generated images)
So feel free to explore it and I hope you’ll enjoy it just as I did during its creation
Welcome to the OpenGL and computer graphics course.
The world of computer graphics is amazing! During this course you'll learn how to use modern OpenGL API and render beautiful 2d and 3d images.
This lecture is 101 (introduction) to the fundamental concepts of computer graphics
and typical problems like:
- drawing the basic shapes (circles, triangles)
- basic rendering algorithms
- the essence of the CG images
What is OpenGL?
It is a "state machine" that can be set up to perform rendering
Lets dive into the fundamentals of OpenGL machinery. Actually its easy to get the basic idea - OpenGL is a "server" and you apply C-function calls (as a "client") to "access" and "modify" its state. To setup the scene and the OpenGL renders it
Also in this lecture:
- the "phototable" metaphor
- feeding the OpenGL with the geometry (vertices)
- introduction to shaders
- the "rendering pipeline" concept
- OpenGL screen coordinates
This is summary of the Section 3
I highlight some of the important concepts on the geometry (like CW and CCW directions of vertices, loading of multiple vertex buffer objects, setting up shader variables and varyings, etc)
Hope this help to summarize everything and build the general understanding of how the basic shaders machinery works
How do the shadertoy.com masterpieces work?
They use full-screen rendering from within the shaders.
Lets explore the very basic principle to do so
Want to know more about 4D matrices and why we need them?
Let's explore the homogenous coordinates!
This is an elegant mathematical "trick" to make a uniform stack of 4D matrices - to represent not only rotation and scale but also translation (and concatenate the combined transformations easily!).
In real 2d and 3d games engines this ability gives us amazing boost in performance! Where each child sub-node has its own 4D node transformation defined relative to the parent node.
So we only apply the transformation once
ps. actually for the simplicity I explore 3D homogenous coordinate as we cannot think in 4D
but the same logic is applicable to 4D world as well! So just get the principal idea
Lets enter the 3D space!
3D rendering has its own caveats and tricks.
So lets just start simple and build a rotating cube!
A small lesson of how to add the GLM math library.
It will be neccessary to use it to define the projection transformation later