Difference between revisions of "Shading languages"

From OpenGL.org
Jump to: navigation, search
m (removed underscores in link)
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==== [[Shading languages: General]] ====
+
__NOTOC__ <!-- TOC will mess things up, layout-wise -->
  
All shading languages share common features and pretty much do the same thing with more or less restrictions/flexibility, for example all have vertex and fragment shaders with fixed functionality in between, all support vector types as a fundamental type and all generate interpolated fragments for the fragment program input from the vertex program output. Before delving into the details of any one language one should first understand what a shading language does in general and where it fits/what it replaces in the overall graphics pipeline.
+
{| cellspacing="0" cellpadding="0"
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[Shading languages: General]]|All shading languages share common features and pretty much do the same thing with more or less restrictions/flexibility, for example all have vertex and fragment shaders with fixed functionality in between, all support vector types as a fundamental type and all generate interpolated fragments for the fragment program input from the vertex program output. Before delving into the details of any one language one should first understand what a shading language does in general and where it fits/what it replaces in the overall graphics pipeline.}}
== this should go in subsection but I can't create new pages due to a DB error ==
+
|-
 
+
| valign="top" width="50%" |{{Text Block|[[:Category:OpenGL Shading Language|OpenGL Shading Language (GLSL)]]|
Shading languages are the interface used to program key parts of the modern graphics pipeline which have previously been fixed function state machines without programmability. With shading languages the vertex transformation and lighting fixed function pipeline is replaced by vertex program instructions supplied by the application, and key parts of the rasterization pipeline, mainly texture environment and fog are replaced by fragment program instructions supplied by the application. The key to understanding shaders is that vertex shaders are fed by graphics primitives like triangles and lines with vertex attributes like color, texture coordinates, position and other generic attributes, for each vertex the program is executed, the output is screen space primitives with similar types of per vertex data to the input. The output of a vertex shader is then transformed to the viewport and clipped by the fixed function pipeline. The primitive is rasterized using prudicing per fragment interpolated values for the results of the vertex shader. The fragment shader program is then executed for each pixel produced by aforementioned interpolation process using the interpolated output of the vertex shader as the input to the fragment shader. The fragment shader outputs color attributes and possibly other outputs like zbuffer depth (outputs supported depend on specific shader language feature support). The output from the fragment shader is depth tested and stencil tested using fixed function hardware and if passed the color is blended with the destination pixel using the fixed function hardware.
+
This section discusses the [[OpenGL Shading Language]], or GLSL.
 
+
}}
==== [[Shading languages: vendor-specific assembly-level]] ====
+
| valign="top" width="50%" |{{Text Block|[[Shading languages: Cg]]|This section discusses NVidia's proprietary Cg Shading language.}}
 
+
|-
This section discusses the various vendor-specific shading languages.
+
| valign="top" width="50%" |{{Text Block|[[Shading languages: ARB assembly-level]]|This section discusses ARB_fragment_program and ARB_vertex_program.}}
 
+
| valign="top" width="50%" |{{Text Block|[[Shading languages: vendor-specific assembly-level]]|This section discusses the various vendor-specific shading languages.}}
==== [[Shading languages: ARB assembly-level]] ====
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[GLSL : common mistakes]]|This section discusses common mistakes made when using GLSL.}}
This section discusses ARB_fragment_program and ARB_vertex_program.
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[Selecting a Shading Language]]|This section looks at each shading language's pros and cons, to help you decide which one is right for your project.}}
==== [[Shading languages: GLSL]] ====
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[Vertex Texture Fetch]]|This section looks at how to implement Vertex Texture Fetch.}}
This section discusses the OpenGL Shading Language, or GLSL.
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[Texture Sampling]]|This section looks at what happens when you sample a texture.}}
==== [[Shading languages: Cg]] ====
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[Geometry Shaders]]|Geometry Shaders.}}
This section discusses NVidia's Cg language.
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[GLSL : recommendations]]|This section makes a few recommendations.}}
==== [[Shading languages: Which shading language should I use?]] ====
+
|-
 
+
| valign="top" width="50%" colspan="2" |{{Text Block|[[GLSL : nVidia specific features]]|This section looks at nVidia specific features.}}
This section looks at each shading language's pros and cons, to help you decide which one is right for your project.
+
|-
 +
| valign="top" width="50%" colspan="2" |{{Text Block|[[GLSL : ATI/AMD specific features]]|This section looks at ATI/AMD specific features.}}
 +
|-
 +
|}
 +
[[Category:General OpenGL]]

Latest revision as of 07:37, 4 November 2012


Shading languages: General

All shading languages share common features and pretty much do the same thing with more or less restrictions/flexibility, for example all have vertex and fragment shaders with fixed functionality in between, all support vector types as a fundamental type and all generate interpolated fragments for the fragment program input from the vertex program output. Before delving into the details of any one language one should first understand what a shading language does in general and where it fits/what it replaces in the overall graphics pipeline.

OpenGL Shading Language (GLSL)

This section discusses the OpenGL Shading Language, or GLSL.

Shading languages: Cg

This section discusses NVidia's proprietary Cg Shading language.

Shading languages: ARB assembly-level

This section discusses ARB_fragment_program and ARB_vertex_program.

Shading languages: vendor-specific assembly-level

This section discusses the various vendor-specific shading languages.

GLSL : common mistakes

This section discusses common mistakes made when using GLSL.

Selecting a Shading Language

This section looks at each shading language's pros and cons, to help you decide which one is right for your project.

Vertex Texture Fetch

This section looks at how to implement Vertex Texture Fetch.

Texture Sampling

This section looks at what happens when you sample a texture.

Geometry Shaders

Geometry Shaders.

GLSL : recommendations

This section makes a few recommendations.

GLSL : nVidia specific features

This section looks at nVidia specific features.

GLSL : ATI/AMD specific features

This section looks at ATI/AMD specific features.