-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotesOpenGL.txt
More file actions
52 lines (41 loc) · 1.59 KB
/
notesOpenGL.txt
File metadata and controls
52 lines (41 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
IMPORTANT:
Can't draw anything without shaders:
https://stackoverflow.com/questions/20376581/is-it-possible-to-draw-anything-in-opengl-3-without-writing-glsl-shaders-will
Fragment:
Fragment is a potential pixel.
https://gamedev.stackexchange.com/questions/8977/what-is-a-fragment
Pipeline:
Vertices:
Just vertices
VOB:
The VBO(Vertex Buffer Object) is one of the “objects” of OpenGL.
It holds all of a single vertex attributes for an object. Not all vertexes,
but all vertexes of one type, like all positions or all colors. So you’ll
end up with one VBO for positions, one VBO for colors, etc…
VAO:
~
glVertexAttribPointer:
After getting the attribute from the shader, tell the system what type of element it is?
Sampling:
Retrieving the texture color using texture coordinates is called sampling
texel:
Texture pixel
mipmaps:
~
linear algebra:
transformations:
float trans[]; // the matrix
// The last parameter (value_ptr) is the actual matrix data, but GLM stores their matrices
// not in the exact way that OpenGL likes to receive them so we first transform
// them with GLM's built-in function value_ptr.
glUniformMatrix4fv(transLoc, 1, GL_FALSE, glm::value_ptr(trans));
Math:
Camera:
Perspective:
https://stackoverflow.com/questions/21830340/understanding-glmlookat
https://stackoverflow.com/questions/8115352/glmperspective-explanation
Rotation:
Rotation around arbitrary axies: https://youtu.be/LazSPnaoJ_Q?t=537
References:
https://cognitivewaves.wordpress.com/opengl-vbo-shader-vao/
http://headerphile.com/sdl2/opengl-part-2-vertexes-vbos-and-vaos/