OpenGL official Tutorial-Shader language Overview

Source: Internet
Author: User

OpenGL official Tutorial-Shader language Overview
    • OpenGL official Tutorial-Shader language Overview
      • Programmable graphics hardware pipeline (pipelining)
      • Programmable Vertex processor
      • Programmable Geometry processor
      • Programmable chip-element processor
      • Language
Programmable graphics hardware pipeline (pipelining)
将       Pertransformed Vertices (每一个待转换顶点)传人  Programmable Vertex Processor (可编程的顶点处理器)得到      Transformed Vertices (转换的顶点)将       Transformed Vertices (转换的顶点)传入  Programmable Geometry Processor (可编程的几何处理器)得到      Assenbled Polygons,Lines,or Points (组装 多边形、线或点)进行  Clipping,Rasterization and Interpolation (裁剪,光栅化和插值)得到      Rasterized Pertransformed Fragments (光栅化待转换的片元[片段])传入  Programmable Fragment Processor (可编程的片元处理器)得到      Transformed Ftagment (转换的片元)进行  Raster Operations   (光栅运算)进行      Pixel Update    (像素更新)传入  Frame Buffer    (帧缓冲区)

Programmable Vertex processor

A vertex processor is a programmable unit that operates on incoming vertex attributes such as position, color, texture coordinates, and so on. The purpose of the vertex processor is to perform traditional graphical operations such as vertex transformations, normal transformations/normalization, texture coordinate generation, and texture coordinate transformations.

The vertex processor has only one vertex as input, and only one vertex is written as the output. The topology information for the vertex is not available.

Programmable Geometry processor

The geometry processor allows access to geometric shapes (lines, triangles, quads, and so on), and it can even create new geometric shapes. However, geometry shaders are not part of the OpenGL Shader language specification. This is a multi-vendor extension (multivendor extension), and the currently available (developer) graphics card is the NVIDIA GeForce 8 series graphics card. Because this is a very important extension of the OpenGL shader language, it is mentioned in this tutorial. (If you don't want or can't use a geometry shader, simply ignore it and use a fixed-function pipeline)

Programmable chip-element processor

The chip (fragment) processor is designed to perform some traditional graphics operations. Examples include calculating interpolation, texture access, texture applications, atomization, color summation, and so on.

Language

The OpenGL shader language is somewhat similar to the C language. Both the vertex shader, the geometry shader, and the slice (fragment) shader must have an entry function "void main()" .

I can write a full language specification here, but I think the better way is to look at the learning examples. A simple coloring source code is described in the next section. Each paragraph has a simple source code to download. Download those examples and modify it to be a good way to learn GLSL yourself by practicing!

You should also download the official GLSL language specification. You can click here to get (under "Miscellaneous Documents").

OpenGL official Tutorial-Shader language Overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.