My Personal Recording
Week One
GPU (Graphics
Processor Unit)
The GPU is a data processor, it works very quickly. GPUs
used to have a fixed pipeline for handling
which is set and cannot be reprogrammed.
Nowadays GPUs can do general parallel computation.
Vertex
Each Vertex can have a variety of data stored in or
associated to it. This includes: positions, colors, normals and UVs (texture co-ordinates)
Immediate Mode
Immediate mode is when you use calls such as glRotatef or
glTranslatef. These change the data stored instantly. This method is slow
though and become depreciated in OpenGL (especially the mobile version OpenGL
ES). It is better for your program to use Vertex buffers and arrays in order to
store and work with your geometry and glMultMatrixf or shaders for
transformations.
To move objects in immediate mode you need to use a
transformation matrix. The specific matrix we use is called the model view
matrix. We call this through glMatrixMode(GL_MODELVIEW). To project the image
we need to use another matrix which is the projection. The projection matrix is
essentially where our camera would be in a scene and is called through glMatrixMode(GL_PROJECTION).
Pixels
Pixels make up images and pixels are made up of channels.
These channels are RGB and Alpha Luminance. Individual channels are data which
generally comes in bytes between 0 and 255. For example the RGB channel values
for a bright red could be 255,0,0.
Textures
Textures are images and are generally used just store color.
This color is also stored as data. Textures can store other data as well such
as maps (see below). Textures are 2D.
UV Mapping
While textures are 2D, models are 3D. We need mapping in
order to be able to put our texture on our model. UV points are specified on a
texture, one for each vertex on a model, and are linked to this vertex. This
means that each UV has an x,y,z position in th digital space. To look up the
color we need to sample it which is essentially grabbing the data from a texture
that you can use.
Normal Maps
Going back to what we were talking about earlier, textures
can store more than just colors. A normal map is a texture that stores normal
vectors per pixel. The rbg = x,y,z. This does not change the physical geometry
but looks up the normal per pixel and interpolates each pixel giving a complicated
appearance to a basic shape by changing how lighting and shading is calculated
on a model.
Displacement Maps
Displacement maps are a greyscale image where each pixel
stores a value that represents an offset for a vertex or pixel that will move
it and change the geometry itself. We use displacement maps in order to overlay
a high polygon model over a low one so that we can save on our polygon count ta
we have to draw. We can take a 300 polygon model and make it look more like an
800 polygon model by overlaying a more complicated one. Displacement Maps can
store vectors instead of just offsets but it generally does not.
Summary
This term is shaping up to be exciting, especially since we are getting into an area that I really want to learn about. As I said I guess I will be using this blog to hold information for myself so that I can go back and study from it. Not sure if I will have to much information. I want to learn shaders so that they can help make up for my lack or artistic skill when it comes to modeling.
Bishop Osborne
No comments:
Post a Comment