You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every OpenGL call involves the GPU in some way. OpenGL stores memory in column major format when, data is read in column by column. [Abstracting OpenGL into Classes](https://www.youtube.com/watch?v=bTHqmzjm2UI&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=13) and almost last vid in this series is [Writing a Basic Renderer in OpenGL](https://www.youtube.com/watch?v=jjaTTRFXRAk&list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2&index=16).
7
6
8
-
Depdends on: [GL Extension Wrangler](https://github.com/nigels-com/glew), [imgui](https://github.com/ocornut/imgui).
7
+
Depends on: [GL Extension Wrangler](https://github.com/nigels-com/glew), [imgui](https://github.com/ocornut/imgui).
9
8
10
9
# Draw Pipeline
11
-
(CPU) Bind vertex > (CPU) Bind vertex array >(CPU) Bind index buffer > (CPU) Bind shader > (GPU) GLSM fragment and vertex shader > (CPU) Give all to Renderer > (CPU) Renderer.Draw()
10
+
(CPU) Bind vertex > (CPU) Bind vertex array >(CPU) Bind index buffer > (CPU) Bind shader > (GPU) GLSL fragment and vertex shader > (CPU) Give all to Renderer > (CPU) Renderer.Draw()
12
11
* Vertex buffer has our graphics bytes.
13
12
* Vertex array defines the memory layout of our vertex buffer.
14
13
* Vertex buffer layout defines mem address structure.
15
14
* Shader and Texture adds the color and image graphics.
16
-
* Draw earch frame on Window.
15
+
* Draw each frame on Window.
17
16
18
17
## Unbind
19
18
Generally don't need to call unbind since going to bind something new anyway
@@ -23,26 +22,26 @@ Generally don't need to call unbind since going to bind something new anyway
23
22
Memory
24
23
* Vertex Buffer
25
24
Size of our queued up graphics data
26
-
Tri verticies
25
+
Tri vertices
27
26
28
27
* Vertex Buffer Layout
29
28
Struct for containing our vertex buffer attributes for our glVertexAttribPointer
30
29
Vector of this struct
31
30
Stride for vertex_mem_address_width between verts in our vector
32
31
Push to add m_elements to our Buffer layout
33
-
Ploymorphic funtion to store floats, int, and bytes
32
+
Polymorphic function to store floats, int, and bytes
34
33
35
34
* Vertex Array
36
35
Adds collection of VertexBuffers with offsets
37
36
Binds the vertex buffers and set memory layout
38
37
39
38
* Index Buffer
40
-
Loads rendundant vertex data during drawing
41
-
Supporting 32 bit indicies
39
+
Loads redundant vertex data during drawing
40
+
Supporting 32 bit indices
42
41
43
42
* Vertex Buffer & Index Buffer
44
43
Has a Renderer ID that uniquely identifies each Vertex Buffer
45
-
Can bind, unbind with renderer id holding our pointer to the binded data
44
+
Can bind, unbind with renderer id holding our pointer to the bound data
46
45
47
46
Graphics
48
47
* Shader
@@ -68,7 +67,7 @@ Graphics
68
67
glm::vec4 result = orthographic_projection_matrix * vertex_position;
69
68
```
70
69
* In fragment shader, we can use the last color output to draw our texture with white.
* Belending colors. Render a red squrare and blue square on top of each other will get a purple square.
80
+
* Blending colors. Render a red squrare and blue square on top of each other will get a purple square.
82
81
* Combine both colors using `glBlendFunc` into an "output color" and store in a "target buffer"
83
82
* Math is take each RGBA color channel for square1 and square2 then do:
84
83
* sqaure1 RGBA (1.0, 1.0, 1.0, 0.5) -> SOURCE
@@ -91,7 +90,7 @@ Graphics
91
90
```
92
91
93
92
* Textures
94
-
* Image files loaded into CPU memory and Shader draws by reading the images pixel array and defining what color is for earch array element.
93
+
* Image files loaded into CPU memory and Shader draws by reading the images pixel array and defining what color is for each array element.
95
94
* Use [stb image loader](https://github.com/nothings/stb) header file.
96
95
* In OpenGL bottom left is (0,0) so we must flip our image.
97
96
* Need "Slots" to bind textures to, most desktops have 32 slots
@@ -110,10 +109,10 @@ Graphics
110
109
* OpenlGL uses 0 to 1 as coordinate space then scales up.
111
110
* Model view projection matrix
112
111
* View matrix control camera (simulated by translating all on screen objects).
113
-
* Model matrix code for our object (has position, rotatation, and scale).
112
+
* Model matrix code for our object (has position, rotation, and scale).
114
113
* Vector: directional or positional (where does ball go, where does camera go?).
115
114
116
-
## Visual Studio 2019 Properities
115
+
## Visual Studio 2019 Properties
117
116
Solution should target 32 bit `x86` since opengl libs are `0x20` bit compatible.
118
117
C/C++
119
118
* General: Add GLFW and glew include locations using `$(SolutionDir)`.
@@ -126,5 +125,4 @@ Linker
126
125
## Misc. Concepts
127
126
* Quads are squares.
128
127
* Tris are triangles.
129
-
* Sampling: openGL uses 0 to 1 and scales depending on resolution and interpolates the color to fill in between for * earch pixel in the screen coordinates.
130
-
128
+
* Sampling: OpenGL uses 0 to 1 and scales depending on resolution and interpolates the color to fill in between for * each pixel in the screen coordinates.
0 commit comments