Portal:OpenGL Shading Language/Intro: Difference between revisions
Start on the GLSL Portal intro. |
More complete introduction. |
||
Line 1: | Line 1: | ||
The '''OpenGL Shading Language''' (GLSL) is a C-like language used to define programmable parts of the [[Portal:Rendering_Pipeline|OpenGL Rendering Pipeline]]. The rendering pipeline defines a number of locations where programmable code can be inserted to do user-defined processing. These locations are called [[Shader|shader stages]], and each one has its own unique elements and purposes. | The '''OpenGL Shading Language''' (GLSL) is a C-like language used to define programmable parts of the [[Portal:Rendering_Pipeline|OpenGL Rendering Pipeline]]. The rendering pipeline defines a number of locations where programmable code can be inserted to do user-defined processing. These locations are called [[Shader|shader stages]], and each one has its own unique elements and purposes. | ||
All shaders are written in GLSL. | All shaders are written in GLSL. In an OpenGL program, shader code is (usually) provided to OpenGL as a series of C strings. These strings are then compiled; OpenGL has a [[Shader Compilation|fairly complicated compilation model]] that allows the user many different choices for how to build their shaders. The code for one or more shader stages is compiled and linked into a special object called a program object. Any errors produced during this process are [[Shader_Compilation#Error_handling|available for the user to detect and respond to]]. And you should. | ||
Shaders have a number of interfaces to external code. These represent settings that previous or later stages of the rendering pipeline attach themselves to, or hooks for the user to insert user-defined data. GLSL has an [[Program Introspection|extensive querying API]] to iterate through all of the user-visible interfaces between a linked program and the user. |
Revision as of 05:15, 25 July 2013
The OpenGL Shading Language (GLSL) is a C-like language used to define programmable parts of the OpenGL Rendering Pipeline. The rendering pipeline defines a number of locations where programmable code can be inserted to do user-defined processing. These locations are called shader stages, and each one has its own unique elements and purposes.
All shaders are written in GLSL. In an OpenGL program, shader code is (usually) provided to OpenGL as a series of C strings. These strings are then compiled; OpenGL has a fairly complicated compilation model that allows the user many different choices for how to build their shaders. The code for one or more shader stages is compiled and linked into a special object called a program object. Any errors produced during this process are available for the user to detect and respond to. And you should.
Shaders have a number of interfaces to external code. These represent settings that previous or later stages of the rendering pipeline attach themselves to, or hooks for the user to insert user-defined data. GLSL has an extensive querying API to iterate through all of the user-visible interfaces between a linked program and the user.