/Lgc graphic rendering/OpenGL ES Overview

Source: Internet
Author: User
OpenGL ES Overview Author:
Liu Peng Date:

2009-05-10

This article gives a comprehensive introduction to OpenGL ES, including the origin, main versions and features of OpenGL ES, and the main differences between OpenGL ES and OpenGL.
Introduction 2

Opengl_es is customized by the khronos Association from OpenGL cropping. It is designed for embedded devices such as mobile phones and game consoles.
Designed for devices. Its interface is actually very similar to Open GL.

Opengl_es has several major versions, but for game development, there are only two to be concerned:
Opengl_es_1.x _ and opengl_es_2.x.

The features and main differences between the two are as follows:

Opengl_es_1.x
Designed for Fixed rendering pipelines (fixed_function. Sub-versions include: 1.0 and 1.1. 1.0 cut from opengl_1.3; 1.1 from
Opengl_1.5 is removed. 1.1 downward compatible with 1.0. After research, because 1.1 is more advanced and more useful than 1.0, it is basically not worth considering 1.0.
The 1.1 and 1.0 changes are not very big. Should the chip price be much higher? For technical specifications of 1.1, see es_full_spec.1.1.12.pdf or
Es_cm_spec_1.1.12.pdf.

Opengl_es_2.x is designed for the programmable rendering pipeline (Programmable. Only 2.0
The sub-version is removed from opengl_2.0. The difference from 1.x is that vertex and pixel are supported.
Shader, so it can implement more special effects. In addition, 2.0 does not support the fixed Pipeline Function in 1.x.
So 2.x is not backward compatible with 1.x. For technical specifications, see es_full_spec_2.0.22.pdf.
Or: es_cm_spec_2.0.22.pdf.

Compared with OpenGL, OpenGL ES reduces all the low-performance operations, and ensures high performance.
That is, performance is not compatible. For example

  • There is no double data type, but a high-performance fixed point decimal data type is added;
  • No glbegin/glend/glvertex, you can only use gldrawarrays/gldraw ......;
  • There is no function to convert non-compressed image data into a compressed texture in real time, and the program must provide Compression
    ;
Differences between OpenGL ES and OpenGL 3

Data Type:

  1. I glint Integer type
  2. F glfixed decimal point
  3. X glclampx fixed-point decimal number

Delete:

  1. Glbegin/glend
  2. Glarrayelement
  3. Display list
  4. Calculator
  5. Index color mode
  6. Custom cropping plane
  7. Glrect
  8. Image Processing (this is not a general graphics card, either firegl or Quadro)
  9. Feedback Buffer
  10. SELECT Buffer
  11. Cumulative Buffer
  12. Border flag
  13. Glpolygonmode
  14. Gl_quads, gl_quad_strip, gl_polygon
  15. Glpushattrib, glpopattrib, glpushclientattrib, glpopclientattrib
  16. Texture_1d, texture_3d, texture_rect, texture_cube_map
  17. Gl_combine
  18. Automatic texture coordinate generation
  19. Texture Boundary
  20. Gl_clamp, gl_clamp_to_border
  21. Deprecated texture Representation
  22. Texture levels
  23. Texture preferences
  24. Automatic texture compression and decompression
  25. Gldrawpixels, glpixeltransfer, glpixelzoom
  26. Glreadbuffer, gldrawbuffer, glcopypixels

Other considerations:

  1. Data in functions such as gldrawarrays must be closely arranged, that is, the interval is 0.
  2. Stack depth of various data is low
OpenGL Based Graphics
: A State machine4

It's a state machine-setup the stage, lighting, actors... then draw
It.

Sample OpenGL ES 2.0 program as following:

// Setup

Handle = get_platform_specific_window_handle();
eglGetDisplay (handle);
eglInitialize ();
eglBindAPI (EGL_OPENGL_ES_API);
eglChooseConfig ();
eglCreateWindowSurface ();
eglCreateContex ();
eglMakeCurrent ();

//Actors

float afVertices [] = {...};
glEnableVertexAttribArray (0);
glVertexAttribPointer (VERTEX_ARRAY, GL_FLOAT, GL_FALSE, afVertices);
glDrawArrays (GL_TRIANGLE_STRIP, 0, 4);

//Show
eglSwapBuffers (eglDisplay, eglSurface);

OpenGL ES 2.0, OpenGL ES 1.1 and full function4
  • Es2.0 offers programmable pipeline vs fixed function in es1.1

    1. Ex, lighting, fog functions in es1.1 not present in es2.0, so need to write code to generate these effects.
    2. More flexibility, little more work, but lot of available code
    3. Android
      Uses es1.1
  • Es2.0 not backward compatible with es1.1
    1. See companion paper for definitive comparison of available functions in es1.1 and es2.0.
  • See "difference specification" Events in khronos OpenGL website,
    For summary of changes compared to OpenGL "full" Function
    Specification
Introduction to OpenGL ES 2.x

OpenGL ES 2.0 is very different thank es 1.1. You don't have
Fixed-function pipeline anymore, so your faimilar "Push matrix,
Translate, rotate ", etc are all gone.

Instead you have the concept of shaders: vertex and frament. They're
Little programs that get executed for each vertex and each pixel. That's
Where all the transformation and other effects happen. Your code will
Prepare the vertex data, tell OpenGL how it's structured, and hand it
Over to the shaders.

How to get started
  • Reading

    1. OpenGL ES 2.0 programming guide
    2. A brief shader tutorial
  • Write several shader programmers and recommend an online shader toy:
    1. Http://www.iquilezles.org/apps/shadertoy/
How to port the application from OpenGL ES 1.1 to OpenGL ES 2.05

You can translate easily:

  1. Textures Management
  2. Framebuffer objects
  3. Blending

More difficult (need shaders ):

  1. Fixed pipeline transformations (rotation, scale ...)
  2. Fog
  3. Lighting

To port your code, I recommand you:

  1. Learn glsl 1.2: You can read webgl tutorials try to write some shaders in shader toy.
  2. List all material you have (or rendering TechCrunch); list all vertices
    Informations as vertices coordinates, normal, textures coord, color
    Informations you need for each material. With theses informations, you
    Will know which glsl programs (vertex + fragment shaders) You must
    Write.
  3. Write your shader compil functions and log each informations;
    Implement a minimal program OpenGL ES 2.x with a quad (two triangles );
    Implement and test your glsl programs one by one.
  4. Optimize
Reference
  1. Official Website
  2. OpenGL ES Overview
  3. Differences between OpenGL and OpenGL ES
  4. OpenGL ES based UI development on Ti platforms
  5. Port 3D app from OpenGL es1.x to OpenGL ES 2.x

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.