OpenGL ES学习笔记

一、OpenGL ES:Open Graphics Library for Embedded Systems

GLSL:OpenGL Shading Language

二、3D-Tranformation

  • Geometric or Modeling transformation
  • Coordinate or Viewing transformation
  • Perspective or Projection transformation

Geometric transformation has three types:

  • Translation: shifting an object to a new position
  • Scaling: changing the dimensions of an obejct
  • Rotation: rotating an object about a center

三、EGL:is an interface between Khronos rendering APIs (such as OpenGL ES or OpenVG) and the underlying native platform windowing system. EGL handles graphics context management, surface/buffer binding, rendering synchronization, and enables "high-performance, accelerated, mixed-mode 2D and 3D rendering using other Khronos APIs."[2] EGL is managed by the non-profit technology consortium Khronos Group.

The acronym EGL is an initialism, which starting from EGL version 1.2 refers to Khronos Native Platform Graphics Interface.[3] Prior to version 1.2, the name of the EGL specification was OpenGL ES Native Platform Graphics Interface. X.org development documentation glossary defines EGL as "Embedded-System Graphics Library".

四、viewport:the area on the display screen on which this image is to be mapped. 

glViewport(int x, int y, int width, int height), (x, y) is a position on the display screen, measured from its bottom-left cornor (in pixels). To ensure the viewport is visible, (x, y) should lie within the bottom-left (x=0, y=0) and top-right (x=width, y=height) cornors of the display screen.

五、Mesh is a primitive shape that can be used to model various complex shapes.

六、types of buffer objects:

array buffer objects: used to cache the per-vertex data, such as vertices {x, y, z}, colors {r, g, b, a}, normals {Nx, Ny, Nz}, and so on;

element array buffer objects: used to cache the corresponding indices of these arrays.

七、Textures can be of  two types - procedural textures and image textures. Procedural textures are generated on the fly, based on some algorithm, whereas image textures, as the name suggests, are textures loaded from image files, such as a .jpg, .png, and so on. In ES 2.0, textures are of two types - 2D textures and cubemap textures.

Textures in OpenGL ES are 2D arrays of texture units known as texels. Similar to defining geometry for primitives (using the Cartesian coordinates x, y, and z), to apply texture(s) to a surface, specify the texture coordinates that correspond to the indices into this texture array data. Unlike the coordinates for geometry, texture coordinates use s and t ( or u and v) . Since texture coordinate space is normalized, both s and t range from 0 to 1. Please note that texture coordinates do not have units, so as to make them independent of the dimensions of source image or final rendered surface (composed of the texture). The process that applies a texture to some geometric object is called UV mapping.

To attach a 2D texture to a surface, we need to provide (s, t) coordinates from this texture such that it can cover the surface. If the specified coordinates (from texture) do not fit the surface completely, we can use texture wrap modes (provided by OpenGL ES) to help the textures wrap the surface, such as by repeating, mirroring, or clamping themselves.


Please note: Android uses the top-left corner as (0, 0) of the texture coordinate space, whereas OpenGL uses the bottom-left corner as (0, 0), which is why you must vertically flip the texture coordinates specified in the texture coordinate array. Therefore, (1, 0) becomes (1, 1), and (1, 1) becomes (1, 0), and so on.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值