码迷,mamicode.com
首页 > 其他好文 > 详细

OpenGL学习 Introduction

时间:2014-08-04 14:07:37      阅读:368      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   os   strong   io   for   

OpenGL and Graphics Pipeline

The word pipeline is from production lines in factories.Generating a product at high efficiency and volume generally requires two things: scalability and parallelism.While one worker installs the engine in a car, another can be installing the doors and yet another can be installing the wheels.That is parallelism.

Just as a car plant can build multiple cars simultaneously, so can OpenGL break up the work you give it and work on its fundamental elements in parallel.Though a combination of pipelining and parallelism,incredible performance of modern graphics processors is realized.

 

Current GPUs consist of large number of small programmable processors called shader cores which run mini-programs called shaders. Each core has a relatively low throughput , processing a single instruction of the shader in one or more clock cycles and normally lacking advanced features such as out-of-order execution,branch prediction, super-scalar issue,and together the can perform an immense amount of work.

Figure:

bubuko.com,布布扣

In Figure,the boxes with rounded corners are considered fixed-function stages whereas the boxes with square corners are programmable, which means that they execute shaders that you supply.In practice,some or all of the fixed-function stages may really be implemented in shader code too——it is just that you don’t supply that code, but rather the GPU manufacturer would generally supply it as part of a driver, firmware, or other system software.

 

The version numbers and dates of publication of 17 editions of the OpenGL specification are shown in follow Table:

bubuko.com,布布扣

  OpenGL 4.4               July 2013

 

OpenGL 4.4 pipeline:

bubuko.com,布布扣

 

Core Profile OpenGL

In 2008,the ARB fork the OpenGL specification into two profiles.The first is the modern ,core profile ,which remove a number of legacy features leaving only those that are truly accelerated by current graphics hardware.The other is the compatibility profile which maintains backwards compatibility with all revisions of OpenGL back to version 1.0.The core profile is strongly recommended by most OpenGL experts to be the profile that should be used for new application development.

 

Primitives, Pipelines, and Pixels

The fundamental unit of rendering in OpenGL is known as the primitive.

Primitive A group of one or more vertices formed into a geometric shape by OpenGL such as a line, point, or triangle. All objects and scenes are composed of various combinations of primitives.

Three basic renderable primitive types in OpenGL:

  • Points
  • Lines
  • Triangles

      Applications will normally break complex surfaces into a very large number of triangles and send them to OpenGL where they are rendered using a hardware accelerator called a rasterizer.

As polygons, triangles are always convex, and therefore filling rules are easy to devise and follow.

A vertex is simply a point within a coordinate space.

Vertex A single point in space. Except when used for point and line primitives, it also defines the point at which two edges of a polygon meet.

The graphics pipeline is broken down into two major parts:

The first part:

Often known as the front end, processes vertices and primitives, eventually forming them into the points, lines, and triangles that will be handed off to the rasterizer. (primitive assembly)

The second part:

After the rasterizer, the geometry has been converted from what is essentially a vector representation into a large number of independent pixels. These are handed off to the back end, which includes depth and stencil testing, fragment shading, blending, and updating the output image.

OpenGL is really a large collection of fairly simple concepts, built upon each other.

Having a good foundation and big-picture view of the system is essential.

See you later.

OpenGL学习 Introduction,布布扣,bubuko.com

OpenGL学习 Introduction

标签:des   style   blog   http   os   strong   io   for   

原文地址:http://www.cnblogs.com/wubugui/p/3889836.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!