OpenGL Superbible 7 01 Introduction

xiaoxiao2021-02-27  420

01 学习目标

(1) What the graphics pipelineis and how OpenGL relates to it.

图形管道

(2) The origins of OpenGL and how it came to be the way that it is today.

(3) Some of the fundamental concepts that we'll be building on throughout the book.

基础概念

02 接口 移植

OpenGL is an interface that your application can use to access and control the graphics subsystem of the device on which it runs.

commodity 日用品

Standardizing the interface to a subsystem increases portability and allows software developers to concentrate on creating quality products, producing interesting content, and ensuring the overall performs of their applications, rather than worry about the specifics of the platforms they want them to run on.

03 汽车工厂作类比

production lines 生产线

By overlapping(重叠) the phases(阶段) of production of the product, with each phase being executed by a skilled technician who concentrates his or her energy on that single task,each phase becomes more efficient and overall(全部的) productivity goes up. Also, by making many cars at the same time, a factory can have multiple workers installing multiple engines or wheels or doors and many cars can be on the production line at the same time, each at a different stage of completion.

The commands from your program are taken by OpenGL and sent to the underlying graphics hardware, which works on them in an efficient manner to produce the desired result as quickly and efficiently as possible. There could be many commands lined up to execute on the hardware (a status referred to as in flight), and some may even be partially completed. This allows their execution to be  overlapped such that a later stage of one command might run concurrently with an earlier stage of another command.

Futhermore, computer graphics generally consists of many repititions of very similar tasks (such as figuring out what color a pixel should be), and these tasks are usually independent of one another -- that is, the result of coloring one pixel doesn't depend on any other.

管道和同步

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

04 目标

The goal of OpenGL is to provide an abstraction layer between your application and the underlying graphics subsystem, which is often a hardware accelerator(加速器) made up of one or more custom, high-performance processors with dedicated(专用的) memory, display outputs, and so on.

trait 特征

peculiarity 特质

05 Shader

Current GPUs consist of large numbers of small programmable processors called shader cores that 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 issues, and so on.

However, each GPU might contain anywhere from a few tens to a few thousands of these cores, and together they can perform an immense amount of work.

The graphics system is broken into a number of stages, each represented either by a shader or by a fixed-function, possibly configurable processing block.

简化版图形管道

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.

consortium团体

oversee 监督

This book covers version 4.5 of the OpenGL specification, and most of the samples in it require up-to-date drivers and hardware to run.

OpenGL 4.5         August 2014

06

For these reasons, in 2008, the ARB decided it would "fork" the OpenGL specification into two profiles. The first is the modern, core profile, which removes a number of legacy features, leaving only those that are truly accelerated by current graphics hardware.

The compatibility profile maintains backward compatibility with all revisions of OpenGL back to version 1.0.

The compatibility profile really exists to allow software developers to maintain legacy applications and to add features to them without having to tear out years of work to shift to a new API.

This book covers only the core profile of OpenGL.

07 基本概念

数据处理流程

Data flow within this model is generally one way, with data formed from commands called by your programs entering the front of the pipeline and flowing from stage to stage until it reaches the end of the pipeline. Along the way, shaders or other fixed-function blocks within the pipeline may pick up more data from buffers or textures, which are structures designed to store information that will be used during rendering. Some stages in the pipeline may even save data into these buffers or textures, allowing the application to read or save  the data, or even permitting feedback to occur.

The fundamental unit of rendering in OpenGL is known as the primitive. (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.

Concave polygons can always be broken down into two or more triangle, so hardware natively supports rendering triangles directly and relies on other subsystems - to break complex geometry into triangles. The rasterizer is dedicated hardware that converts the three-dimensional representation of triangle into a series of pixels that need to be drawn onto the screen.

08 两部分

The graphics pipelines 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. This is known as primitive assembly. After going through 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 of the output image.

09 总结:

In this chaper you've been introduced to OpenGL and have read a little about its origins, history, status, and direction. You have seen the OpenGL pipeline and have been told how this book will progress. We have mentioned some of the terminology that we'll be using throughout the book. Over the next few chapters, you'll create your first OpenGL program, dig a little deeper into the various stages of the OpenGL pipeline, and then lay some foundations with some of the math that's useful in the world of computer graphics.

转载请注明原文地址: https://www.6miu.com/read-534.html

最新回复(0)