@@ -172,7 +172,7 @@ The graphic pipeline
172
172
173
173
If you want to understand modern OpenGL, you have to understand the graphic
174
174
pipeline and shaders. Shaders are pieces of program (using a C-like language)
175
- that are build onto the GPU and executed during the rendering
175
+ that are built onto the GPU and executed during the rendering
176
176
pipeline. Depending on the nature of the shaders (there are many types
177
177
depending on the version of OpenGL you're using), they will act at different
178
178
stage of the rendering pipeline. To simplify this tutorial, we'll use only
@@ -209,7 +209,7 @@ special variable). We'll see later how to make them to do more useful things.
209
209
210
210
One question remains: when are those shaders executed exactly ? The vertex
211
211
shader is executed for each vertex that is given to the rendering pipeline
212
- (we'll see what does that mean exactly later) and the fragment shader is
212
+ (we'll see excatly what that means later) and the fragment shader is
213
213
executed on each fragment (= pixel) that is generated after the vertex
214
214
stage. For example, in the simple figure above, the vertex would be called 3
215
215
times, once for each vertex (1,2 and 3) while the fragment shader would be
@@ -220,20 +220,20 @@ Buffers
220
220
221
221
The next question is thus where do those vertices comes from ? The idea of
222
222
modern GL is that vertices are stored on the CPU and need to be uploaded to
223
- the GPU before rendering. The way to do that is to build buffers onto the CPU
223
+ the GPU before rendering. The way to do that is to build buffers on the CPU
224
224
and to send these buffers onto the GPU. If your data does not change, no need
225
225
to upload them again. That is the big difference with the previous fixed
226
226
pipeline where data were uploaded at each rendering call (only display lists
227
227
were built into GPU memory).
228
228
229
229
But what is the structure of a vertex ? OpenGL does not assume anything about
230
- your vertex structure and you're free to use as many information you may need
230
+ your vertex structure and you're free to use as much information you may need
231
231
for each vertex. The only condition is that all vertices from a buffer have the
232
- same structure (possibly with different content). This again is a big
232
+ same structure (possibly with different content). This, again, is a big
233
233
difference with the fixed pipeline where OpenGL was doing a lot of complex
234
234
rendering stuff for you (projections, lighting, normals, etc.) with an implicit
235
235
fixed vertex structure. The good news is that you're now free to do anything
236
- you want, but the bad news is that you have to program just everything.
236
+ you want, but the bad news is that you have to program just about everything.
237
237
238
238
Let's take a simple example of a vertex structure where we want each vertex to
239
239
hold a position and a color. The easiest way to do that in python is to use a
@@ -257,7 +257,7 @@ one or ten million vertices.
257
257
Variables
258
258
+++++++++
259
259
260
- Now, we need to explain our shaders what to do with these buffers and how to
260
+ Now, we need to explain to our shaders what to do with these buffers and how to
261
261
connect them together. So, let's consider again a CPU buffer of 4 vertices
262
262
using 2 floats for position and 4 floats for color:
263
263
@@ -350,7 +350,7 @@ State of the union
350
350
Last, but not least, we need to access the OpenGL library from within Python
351
351
and we have mostly two solutions at our disposal. Either we use pure bindings
352
352
and we have to program everything (see next chapter) or we use an engine that
353
- provide a lot of convenient functions that ease the development. We'll first
353
+ provides a lot of convenient functions that ease the development. We'll first
354
354
use the PyOpenGL bindings before using the glumpy _ library that offers a tight
355
355
integration with numpy.
356
356
0 commit comments