|opengl.org: official website of OpenGL.|
|OpenGL registry: hosts the OpenGL specifications and extensions for all OpenGL versions.|
- GLFW: Window Guide: official GLFW guide on setting up and configuring a GLFW window.
- Building applications: provides great info about the compilation/linking process of your application and a large list of possible errors (plus solutions) that might come up.
- GLFW with Code::Blocks: building GLFW in Code::Blocks IDE.
- Running CMake: short overview of how to run CMake on both Windows and Linux.
- Writing a build system under Linux: an autotools tutorial by Wouter Verholst on how to write a build system in Linux, specifically targeted for these tutorials.
- Polytonic/Glitter: a simple boilerplate project that comes pre-configured with all relevant libraries; great for if you want a sample project for the LearnOpenGL tutorials without the hassle of having to compile all the libraries yourself.
OpenGL for Embedded Systems (OpenGL ES) is a simplified version of OpenGL that eliminates redundant functionality to provide a library that is both easier to learn and easier to implement in mobile graphics hardware.
https://www.khronos.org/ —> search -> keyword: ES shading language
OpenGL is a 3D graphics library so all coordinates that we specify in OpenGL are in 3D (
zcoordinate) OpenGL doesn’t simply transform all your 3D coordinates to 2D pixels on your screen; OpenGL only processes 3D coordinates when they’re in a specific range between
1.0on all 3 axes (
z). All coordinates within this so called normalized device coordinates range will end up visible on your screen (and all coordinates outside this region won’t).
Normalized Device Coordinates (NDC)
Once your vertex coordinates have been processed in the vertex shader, they should be in normalized device coordinates which is a small space where the
z values vary from
1.0. Any coordinates that fall outside this range will be discarded/clipped and won’t be visible on your screen. Below you can see the triangle we specified within normalized device coordinates (ignoring the
Unlike usual screen coordinates the positive y-axis points in the up-direction and the
(0,0) coordinates are at the center of the graph, instead of top-left. 与屏幕坐标系 原点不同，y轴 也不同吗？
Eventually you want all the (transformed) coordinates to end up in this coordinate space, otherwise they won’t be visible.
Your NDC coordinates will then be transformed to screen-space coordinates via the viewport transform using the data you provided with glViewport. The resulting screen-space coordinates are then transformed to fragments as inputs to your fragment shader.
Those hints are called primitives and are given to OpenGL while calling any of the drawing commands. Some of these hints are GL_POINTS, GL_TRIANGLES and GL_LINE_STRIP.
The main purpose of the vertex shader is to transform 3D coordinates into different 3D coordinates (more on that later) and the vertex shader allows us to do some basic processing on the vertex attributes.
The main purpose of the fragment shader is to calculate the final color of a pixel and this is usually the stage where all the advanced OpenGL effects occur. Usually the fragment shader contains data about the 3D scene that it can use to calculate the final pixel color (like lights, shadows, color of the light and so on)
We manage this memory via so called vertex buffer objects (VBO) that can store a large number of vertices in the GPU’s memory.
OpenGL 中，任何事物都在 3D 空间中
OpenGL specification of version 3.3 here
The OpenGL ES® Shading Language, Version 3.20.6 Jul 10, 2019
the OpenGL tutorial.
GLImageProcessing iOS code samples demonstrating how to use OpenGL ES 2.0 for common image processing task
As you might recall from the OpenGL tutorial, the glClearColor function is a state-setting function and glClear is a state-using function in that it uses the current state to retrieve the clearing color from.
片段着色器是 在图元进行 光栅化后对片段（最基本是像素）进行填充。不过， 顶点数据都可以通过顶点程序传递到片段着色器。
The w in vec4(x, y, z, w) is used for clipping, and plays its part while linear algebra transformations are applied to the position.
By default, this should be set to 1.0.
See here for some more info：
- Download the source for the First Edition
- Download the source for the Second Edition
- Download the source for the Third Edition
- Download the source for the Fourth Edition
- Download the source for the Fifth Edition
- Download the source for the Sixth Edition (Media Files)
Browse the latest documentation including API reference and articles.