OpenGL Rendering Pipeline
来源:互联网 发布:js 二维数组定义 编辑:程序博客网 时间:2024/05/15 01:33
Vertex Operation顶点操作(平移、旋转、伸缩、光照)
Each vertex and normal coordinates are transformed by GL_MODELVIEW matrix
(from object coordinates to eye coordinates). Also, if lighting is enabled, the lighting
calculation per vertex is performed using the transformed vertex and normal data.
This lighting calculation updates new color of the vertex.
Primitive Assembly图元装配(将基本的几何图元装配)
After vertex operation, the primitives (point, line, and polygon) are transformed once
again by projection matrix(将3D转换成2D) then clipped by viewing volume clipping
planes(通过裁剪面进行裁剪)from eye coordinates to clip coordinates. After that,
perspective division by w occurs and viewport transform is applied in order to map
3D scene to window space coordinates. Last thing to do in Primitive Assembly is culling
test if culling is enabled.
以上两步可以细节如下:
Geometric data such as vertex positions and normal vectors are transformed via Vertex
Operation and Primitive Assembly operation in OpenGL pipeline before raterization process.
物体坐标系-人眼坐标系-裁剪坐标系-标准设备坐标系--窗口坐标系
物体坐标系-人眼坐标系(物体坐标系-世界坐标系-人眼坐标系):平移、旋转、伸缩、光照
人眼坐标系-裁剪坐标系:将3D投影至2D并通过裁剪面裁剪至去头视锥体
裁剪坐标系-标准设备坐标系:对坐标值进行标准化(-1,1)
标准设备坐标系--窗口坐标系:对标准化的坐标进行适应屏幕像素的调整
Display List
Display list is a group of OpenGL commands that have been stored (compiled) for later execution.
All data, geometry (vertex) and pixel data, can be stored in a display list. It may improve performance
since commands and data are cached in a display list.
Display List相当于数据和命令的缓存,但是用的场景是固定的静态数据或者OpenGL命令(没有返回值),
比如静态画面的数据和用于生成此静态画面的命令。对于动态的数据或者OpenGL命令,用VBO要更好一点。
Pixel Transfer Operation
After the pixels from client's memory are unpacked(read), the data are performed scaling, bias,
mapping and clamping. These operations are called Pixel Transfer Operation. The transferred
data are either stored in texture memory or rasterized directly to fragments.
Texture Memory
Texture images are loaded into texture memory to be applied onto geometric objects.
Raterization
Rasterization is the conversion of both geometric and pixel data into fragment. Fragments are a
rectangular array containing color, depth, line width, point size and antialiasing calculations
(GL_POINT_SMOOTH, GL_LINE_SMOOTH, GL_POLYGON_SMOOTH). If shading mode is GL_FILL,
then the interior pixels (area) of polygon will be filled at this stage. Each fragment corresponds to
a pixel in the frame buffer.
Fragment Operation
It is the last process to convert fragments to pixels onto frame buffer. The first process in this stage
is texel generation; A texture element is generated from texture memory and it is applied to the each
fragment. Then fog calculations are applied. After that, there are several fragment tests follow in order;
Scissor Test ⇒ Alpha Test ⇒ Stencil Test ⇒ Depth Test. Finally, blending, dithering, logical operation
and masking by bitmask are performed and actual pixel data are stored in frame buffer.
Feedback
OpenGL can return most of current states and information through glGet*() and glIsEnabled() commands. Further more, you can read a rectangular area of pixel data from
frame buffer using glReadPixels(), and get fully transformed vertex data using glRenderMode
(GL_FEEDBACK). glCopyPixels() does not return pixel data to the specified system memory, but
copy them back to the another frame buffer, for example, from front buffer to back buffer.
- OpenGL Rendering Pipeline
- OpenGL Rendering Pipeline
- OpenGL Rendering Pipeline
- Unity's Rendering Pipeline
- DirectX Rendering Pipeline
- DirectX Rendering Pipeline
- 3 rendering pipeline
- Unity's Rendering Pipeline
- The Rendering Pipeline
- chromium rendering pipeline
- DirectX Rendering Pipeline
- OpenGL Pipeline
- 介绍5---OpenGL Pipeline
- The OpenGL Pipeline
- The OpenGL pipeline
- OpenGL ES pipeline简介
- The OpenGL Pipeline
- CH2 The Graphics Rendering Pipeline —— Real-time Rendering
- executenonquery 返回值
- 识别和预测消费者行为与社会媒体分析工具
- JavaBean封装数据库连接
- android考评系统需求分析报告
- printf和cout的运算顺序
- OpenGL Rendering Pipeline
- 开启Digilent提供的Linux内核的NFS支持
- struts框架编写的用户登陆代码
- 网站对于艺术家信息技术的冲击,世界
- 数据库培训总结
- Smash The Stack Wargame IO Level 01-04
- nfs安装与配置
- javascript 堆栈与列队
- IOS开发之CocoaAsyncSocket学习