Open GL Notes

NIO Buffers (New I/O)

Standard for Android

Vertex Attributes

Setup – Give expecations
glEnableXXXX(GL10.XXXX);
Draw
Can have colors and/or textures(image)

State Machine

States stay active until next state is called or context is lost
Blending
Current Texture

Right Hand Rule

Middle Finger Up
Middle Finger — Z
Fore Finger — Y
Thumb — X

Matrices

4×4 matrix transforms verts (understanding not important)
Can be combined example: rotate and re-size and move

Camera

Camera is fixed
Vertices move to look like camera is moved

Model-View-Projection

Object Space Center is (0,0,0)
Model Space
View Space

Projection Functions

GLU class can control perspective
zNear and zFar will control resolution and what can be seen
Orthographic – for clipping (near and far have no effect)
Perspective

View/Camera Functions

Textures

Must be power of two (faster)
Shrink texture offline then expand in code. It will look bad to the artist.
Mipmaping will auto re-sample textures (must be turned on)

2D Rendering

Batching — should use as few draw calls as possible
Use array of many vertices
Texture switching can slow things down
Put everything in one large texture if possible (called an atlas) texturePacker tool

Store models with .obj
Create with Blender or Maya

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *