GLES Spec Notes

  1. Basic Concept

1.1GLES 1.1 - Chapter 2.6

In the GL, geometricobjects are drawn by specifying a series of coordinate sets

that include vertices and optionally normals, texture coordinates,and colors.

 

Seven geometricobjects that are drawn this way: points (including point sprites), connectedline segments (line strips), line segment loops, separated line segments,triangle strips, triangle fans, and separated triangles.

 

A color isassociated with each vertex. This color is either based on the current color orproduced by lighting, depending on whether or not lighting is enabled.

 

Thevertices defining a primitiveto be rasterized have texture coordinates and color associated with them.

 

1.2 VertexArrays (s for multiple array[])

 

Vertexdata is placed into arrays stored in the client’s address space. (CPU side RAM)

Theclient may specify up to four plus the value of MAX TEXTURE UNITS arrays: oneeach to store vertex coordinates, normals, colors, point sizes, and one or moretexture coordinate sets.

 

1.3Coordinates

Machine generated alternative text:
Object 
Coordinates 
Figure 2.5. 
Model—View 
Matrix 
Eye 
Coordinates 
Projection 
Matrix 
Clip 
Coordinates 
Perspective 
Division 
Viewport 
Transformation 
Normalized 
Device 
Coordinates 
Window 
Coordinates 
Vertex transformation sequence.

 

  1. Pipeline Inside

 

Machine generated alternative text:
Vertex Array Coordinates 
and Current Values In 
Vertex / Normal 
Transformation 
Lighting 
Texture 
Matrix O 
Texture 
Matrix 1 
Transformed 
Coordinates 
Processed 
Vertex Out 
Associated Data 
(Colors and 
Texture 
Coordinates) 
VERTEX ARRAY 
NORMAL ARRAY 
COL,OR ARRAY 
color-4:, 
TEXTURE 
TEXTURE ccORD ARRAY 
Current 
Normal 
Current 
Colors 
& Materials 
Current 
Texture 
Coord Set O 
Current 
Texture 
Coord Set 1 
Figure 2.2. Creation of a processed vertex from vertex array coordinates and current 
values. Two texture units are shown; however, multitexturing may support a greater 
number of units depending on the implementation.

 

 

Machine generated alternative text:
Coordinates 
Processed 
Vertices 
Associated Data 
Point, 
Line Segment, or 
Triangle 
(Primitive) 
Assembly 
Primitive type 
(from DrawArrays or 
DrawElements mode) 
Point culling; 
Line Segment 
or Triangle 
Clipping 
Rasterization 
Color 
Processing 
Figure 2.3. 
Primitive assembly and processing.

 

Machine generated alternative text:
to,2k-1) 
1-2k,2k-1J 
float 
Convert to 
10.0,1.0) 
Convert to 
1-1.0,1.0) 
Convert to 
Current 
RGSA 
Color 
Lighting —-0 
Color 
Clipping 
Clamp to 
to.o, 1.0) 
Flatshade? 
fixed-point 
Primitive 
Clipping 
Figure 2.6. Processing of colors. See Table 2.7 for the interpretation of k.

 

 

  1. Lighting

LightProperty (Direction, reflection and color)

TheOpenGL lighting model considers the lighting to be divided into fourindependent components: emissive, ambient, diffuse, and specular.

Allfour components are computed independently and then added together.

Alighting parameter is of one of five types: color,position, direction, real, or boolean.

 

 

MaterialProperty (Color)

TheOpenGL lighting model makes the approximation that a material's color dependson the percentages of the incoming red, green, and blue light it reflects.

Likelights, materials have different ambient, diffuse, and specular colors, whichdetermine the ambient, diffuse, and specular reflectances of thematerial. 

 

Inother words, if an OpenGL light has components (LR, LG, LB), and a material hascorresponding components (MR, MG, MB), then, ignoring all other reflectivityeffects, the light that arrives at the eye is given by (LR*MR, LG*MG, LB*MB).

 

  1. Rasterization

4.1overview (Chapter 3)

Rasterizationis the process by which a primitive is converted to a two-dimensional image.

Eachpoint of this image contains such information as color and depth.

 

Thus,rasterizing a primitive consists of two parts.

Thefirst is to determine which squares of an integer grid in window coordinatesare occupied by the primitive.

Thesecond is assigning a color and a depth value to each such square.

 

Theresults of this process are passed on to the next stage of the GL (per-fragmentoperations), which uses the information to update the appropriate locations inthe framebuffer.

 

Agrid square along with its parameters of assigned colors, z (depth), andtexture coordinates is called a fragment;

theparameters are collectively dubbed the fragment’s associated data. A fragmentis located by its lower left corner, which lies on integer grid coordinates.Rasterization operations also refer to a fragment’s center, which is offset by(1=2; 1=2) from its lower left corner (and so lies on half-integercoordinates).

 

Machine generated alternative text:
Point 
Rasterizatlon 
From 
Line 
Primitive 
Rasterizatlon 
Assembly 
Texturing 
Fog 
Fragments 
Figure 3.1. 
Triangle 
Rasterization 
Rasterization.

4.2MSAA

https://learnopengl.com/#!Advanced-OpenGL/Anti-Aliasing

 

4.3 Points

Oddwidth - centered at ([x]+0.5, [y]+0.5), with width=odd width+0.5. (cause it isnot possible to draw a point with exact odd width while centered at integerpoint).

Evenwidth - centered at ([x+0.5], [y+0.5]), with width = even width.

 

4.4Line

 

4.5Polygon

 

4.6Pixel Rectangle

 

4.7Texturing

Texturingmaps a portion of one or more specified images onto each primitive for whichtexturing is enabled. This mapping is accomplished by using the color of animage at the location indicated by a fragment’s (s; t) coordinates to modifythe fragment’s RGBA color.

 

voidTexImage2D( enum target, int level,

intinternalformat, sizei width, sizei height,

intborder, enum format, enum type, void *data );

 

4.8Mipmaps

 

Theproblem is with animation. When you slowly zoom out on a texture, you start tosee aliasing artifacts appear. These are caused by sampling fewer than all ofthe texels; the choice of which texels are sampled changes between differentframes of the animation.

 

Theseare pre-shrunk versions of the full-sized image. Each mipmap is half the sizeof the previous one in the chain, using the largest dimension of the image . Soa 64x16 2D texture can have 6 mip-maps: 32x8, 16x4, 8x2, 4x1, 2x1, and 1x1.OpenGL does not require that the entire mipmap chain is complete; you canspecify what range of mipmaps in a texture are available.

 

From <https://www.khronos.org/opengl/wiki/Texture#Mip_maps>

 

4.9fogs

Ifenabled, fog blends a fog color with a rasterized fragment’s post-texturingcolor using a blending factor f.

C= fCr + (1 - f)Cf ;

 

5 Framebufferoperation

Machine generated alternative text:
Frag ment 
Pixel 
Ownership 
Associated 
Scissor 
Test 
Stencil 
Test 
Framebuffer 
Dithering 
Multisample 
Fragment 
Operations 
Alpha 
Test 
Logicop 
Framebuffer 
Framebuffer 
Data 
Figure 4.1. 
Test 
Depth Buffer 
Test 
Frame buffer 
Blending 
Framebuffer 
Per-fragment operations.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值