summaryrefslogtreecommitdiffstats
path: root/sdl/GL_notes.txt
blob: 0a19bbb99b87166d6eeb3718e43c6ced55391502 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Performance
- Depth Testing, aka Z-buffer
- Culling: don't render what you can't see

Terms
- Winding: by default, primitives that follow in CCW fashion are front facing

Projections
- Orthographic: glOrtho(), define visibility in a *volume*
- Perspective: gluPerspective()

Transformations
- Viewing: specifies the location of the viewer or camera (must be specified first)
- Modeling: moves objects around the scene
- Modelview: describes the duality of viewing and modeling transformations
- Projection: sizes and reshapes the viewing volume (squishing 3D data down into 2D)
- Viewport: a pseudo-transformation that scales the final output to the window

Matrices
- Modelview
- Projection
- Texture

Buffers
- Color Buffer
- Depth Buffer, aka Z-buffer
- Stencil Buffer
- Multisampling Buffer
- Accumulation Buffer: this buffer allows you to render to the color buffer, and
  then instead of displaying the results in the window, copy the contents of the
  color buffer to the accu-mulation buffer.
- Front Buffer
- Back Buffer

Terms
 - Dithering: simulate displaying wider range of colors on on systems with small
   amount of colors
 - Texture Filtering: process of calculating color fragments from a stretched or
   shrunken texture map   
   
OBJ Loader
- glGenTextures()
- glBindTextures() 

Pipeline
- Display Lists: precompile series of OpenGL commands (static)
    GLuint identifiers
    1st identifier = glGenLists()
    glNewList()
        commands
    glEndList()
    
- Vertex Array: modifiable, gets rid of glBegin() and glEnd()
    glEnableClientState()
        glVertexPointer() || glTexCoordPointer() || glNormalPointer()
	    glDrawArrays() || glDrawElements()
    glDisableClientState()

Shadow Mapping
- getting the depth buffer from lights point of view of the scene, we don't swap
  we only care about raw geometry
  we regenerate the shadow map if the light or object moves, or window size changes
  first we draw the scene with dim lighting, then we double the the values of lighting
  once depth buffer is written to the backbuffer, we retrieve that into a texture, then
  lots of magic is done to project the texture/shadow map back into the final scene

Shaders
- VP: to mimick fixed functionality, multiply incoming vertex by MVP (modelview/projection matrices)
  if no transformation took place, just transfer the vertex data into next stage, clipping AFAIK

Vertex Shader--you can write code for tasks such as:
- Vertex position transformation using the modelview and projection matrices
- Normal transformation, and if required its normalization
- Texture coordinate generation and transformation
- Lighting per vertex or computing values for lighting per pixel
- Color computation