90 likes | 266 Views
Introduction. 3D API. OPENGL ES v1.0. Owned by Silicon Graphics (SGL). Control was then transferred to Khronos Group. OPENGL ES v1.0. Android includes libraries for both 3D and 2D graphics + Surface manager. Structure of OPENGL ES Commands:
E N D
Introduction 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group
OPENGL ES v1.0 • Android includes libraries for both 3D and 2D graphics + Surface manager • Structure of OPENGL ES Commands: Rtype Name { 1 2 3 4 } { i x f ub ui} { v} Void glColor4f (GLfloat r, GLfloat g, GLfloat b, GLfloat a); -- Immediate Mode Type of vertices • Points • Lines • Triangles All are specified with vertices + Colors, Normals & Texture Vertices
Rendering primitives (1/2) • Immediate Mode • Using Arrays • Using Vertex Buffer Objects (VBO’s) • Bind a newly generated buffer object to a target: • GL_ARRAY_BUFFER • GL_ELEMENTS_ARRAY_BUFFER One can also modify part or all the buffer object’s data Before using an arrays containing primitive data: • Enable the array/s. • Pointers to those arrays need to be specified.
Rendering primitives (2/2) The last step is to display the vertices: • glDrawArrays(); • glDrawElements();
Coordinate Transformation • GL_MODEL_VIEW glMartixMode • GL_PROJECTION
Rasterization (1/2) The process of converting each primitive into 2D so that it can be shown on the screen Deals with Fragments • Antialiasing can be enabled for both points and lines, In which case blending needs to be enabled also • Multisampling can also be enabled in which all primitives can use (including triangle primitives)
Rasterization (2/2) • Textures: texel value is obtained which corresponds to a texture map. • Smaller textures can be loaded on a larger one. • Finally Fog can also be Enabled and specified.
Per-Fragment Operations • Several tests which are done on each fragment if a fragment passes then this fragment is converted into a pixel and would be stored in the Framebuffer.