Shading language

Shading language

A shading language is a special programming language adapted to easily map on shader programming. Those kind of languages usually have special data types like color and normal. Because of the various target markets of 3D graphics, different shading languages have been developed: a brief overview is given below.

Production rendering

These kind of shading languages are geared towards maximum image quality. Material properties are totally abstracted, little programming skill and no hardware knowledge is required. These kind of shaders are often developed by artists to get the right "look", just as texture mapping, lighting and other facets of their work.

Processing these kinds of shaders is usually a time-consuming process. The computational power required to get this kind of shading to work can be rather expensive because of their ability to produce photorealistic results. Most of the time, production rendering is run on large computer clusters.

RenderMan Shading Language

The RenderMan Shading Language (often referenced as RSL or SL, for short), which is defined in the "RenderMan Interface Specification"ref|RMspec, is the most common shading language for production-quality rendering. It is also one of the first shading languages ever implemented.

The language defines six major shader types:
* "Light source shaders" compute the color of the light emitted from a point on the light source towards a point on the surface being illuminated.
* "Surface shaders" model the optical properties of the object being illuminated. They output the final color and position of the point being illuminated by taking into account the incoming light and the physical properties of the object.
* "Displacement shaders" manipulate the surface's geometry independent of its color.
* "Deformation shaders" transform the entire space that a geometry is defined in. Only one RenderMan implementation, the AIR renderer, actually implements this shader type.
* "Volume shaders" manipulate the color of a light as it passes through a volume. They create effects like fog.
* "Imager shaders" describe a color transformation to final pixel values. This is much like an image filter, however the imager shader operates on prequantized data, which typically has a greater dynamic range than can be displayed on the output device.

Houdini VEX Shading Language

Houdini VEX (Vector Expressions) shading language (often referenced as VEX, for short) is closely modeled after the RenderMan Shading Language. Since it is integrated into a complete 3D package though, the shader writer has access to information inside the shader which is commonly not available in a rendering context.The language differences between RSL and VEX are mainly syntactical. A few shadeops have different names.

Gelato Shading Language

Gelato'sref|gelatoHome shading language, like Houdini's VEX, is closely modeled after the RenderMan Shading Language.The differences between Gelato Shading Language and RSL are mainly syntactical -- Gelato uses semicolons instead of commas to separate arguments in function definitions and a few shadeops have different names and parameters.

Real-time rendering

Until recently, developers did not have the same level of control over the output from the graphics pipeline of graphics cards, but shading languages for real-time rendering are now widespread. They provide both higher hardware abstraction and a more flexible programming model when compared to previous paradigms which hardcoded transformation and shading equations. This results in both giving the programmer greater control over the rendering process, and delivering richer content at lower overhead.

Quite surprisingly those shaders, which are designed to be executed directly on the GPU at the proper point in the pipeline for maximum performance, also scored successes in general processing because of their stream programming model.

This kind of shading language is usually bound to a graphics API, although some applications also provide built-in shading languages with limited functionalities.

Historically, only few of those languages were successful in both establishing themselves and maintaining strong market position; a short description of those languages follows below.

ARB low-level assembly language

The OpenGL Architecture Review Board established ARB (GPU assembly language)in 2002 as a standard low-level instruction set for programmable graphics processors.

High-level OpenGL shading languages compile to ARB for loading and execution. Unlike high-level shading languages, ARB assembly does not support flow control or branching. However, it continues to be used for portability to a variety of GPUs.

OpenGL shading language

Also known as GLSL or "glslang", this standardizedref|glslangSpec high level shading language is meant to be used with OpenGL.

The language unifies vertex and fragment processing in a single instruction set, allowing conditional loops and (more generally) branches.

Historically, GLSL was preceded by various OpenGL extensions such as [ ARB_vertex_program] and [ ARB_fragment_program] . These preceding extensions were limited, low-level, assembly-like languages and their usage is now discouraged. The preceding extensions were themselves preceded by other proposals which did not survive in the new versionref|oldVtxref|oldFrag.

Cg programming language

This languageref|cgHome developed by NVIDIA has been designed for easy and efficient production pipeline integration. The language features API independence and comes with a large variety of free toolsref|fxcomp to improve asset management.

The first Cg implementations were rather restrictive because of the hardware being abstracted but they were still innovative when compared to previous methods. Cg seems to have survived the introduction of the newer shading languages very well, mainly of its established momentum in the digital content creation area, although the language is seldom used in final products.

A distinctive feature of Cg is the use of "connectors", special data structures to link the various stages of processing. Connectors define the input from application to vertex processing stage and the attributes to be interpolated as input to fragment processing.

DirectX High-Level Shader Language

The high level shader language (also called HLSL for short) is a C-style shader language for DirectX 8, 9, 10, Xbox and Xbox 360. It is similar to Nvidia's Cg but is only supported by DirectX and Xbox game consoles.


# NVIDIA Gelato official website,
# Official language specification,
# Previous vertex shading languages (in no particular order) for OpenGL include [ EXT_vertex_shader] , [ NV_vertex_program] , the aforementioned [ ARB_vertex_program] , [ NV_vertex_program2] and [ NV_vertex_program3] .
# For fragment shading [ nvparse] is possibly the first shading language featuring high-level abstraction based on [ NV_register_combiners] , [ NV_register_combiners2] for pixel math and [ NV_texture_shader] , [ NV_texture_shader2] and [ NV_texture_shader3] for texture lookups. [ ATI_fragment_shader] did not even provide a "string oriented" parsing facility (although it has been later added by [ ATI_text_fragment_shader] ). [ ARB_fragment_program] , has been very successful. [ NV_fragment_program] and [ NV_fragment_program2] are actually similar although the latter provides much more advanced functionality in respect to others.
# Official Cg home page,
# Fx composer from NVIDIA home page,
#Rudy Cortes and Saty Raghavachary: "The RenderMan Shading Language Guide", Course Technology PTR, 1 edition (December 27, 2007), ISBN 1-598-63286-8

Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Shading language — Shader Un shader (anglais, du verbe to shade : ombrager ou estomper, nuancer) est un programme[Quoi ?] utilisé en image de synthèse pour paramétrer une partie du processus de rendu réalisé par une carte graphique ou un moteur de rendu… …   Wikipédia en Français

  • OpenGL Shading Language — Erscheinungsjahr: 2002 Entwickler: Khronos Group Aktuelle Version: 4.10  (8. August 2011) Einflüsse: C …   Deutsch Wikipedia

  • RenderMan Shading Language — Commonly referred RSL, Renderman Shading Language is used to define shaders used in RenderMan. The language syntax is C like.Pixar has set a standard in the Shading Language.The beauty of using a standard language is that a programmed shader can… …   Wikipedia

  • High Level Shading Language — HLSL (High Level Shading Language) bezeichnet die DirectX Komponente, die die Programmierung von Shader Bausteinen ermöglicht. Inhaltsverzeichnis 1 Shader Sprachen 2 Sprach Elemente 2.1 Globale Shader Parameter …   Deutsch Wikipedia

  • OpenGL Shading Language — Эту статью следует викифицировать. Пожалуйста, оформите её согласно правилам оформления статей …   Википедия

  • shading — [[t]ʃe͟ɪdɪŋ[/t]] shadings 1) N UNCOUNT Shading is material such as nets or dark paint that provide shade, especially for plants. The conservatory will get very hot in summer unless shading is used. 2) N UNCOUNT Dark areas or patches in a picture… …   English dictionary

  • Shading — Original name in latin Shading Name in other language Sadeng, Sadng, Sating, Sha ting, Sha ting tsung, Shading, Shading Xiang, sha ding, sha ding xiang State code CN Continent/City Asia/Urumqi longitude 31.25887 latitude 94.49558 altitude 3749… …   Cities with a population over 1000 database

  • shading — shad|ing [ˈʃeıdıŋ] n 1.) [U] the areas of a drawing or painting that have been made to look darker 2.) shadings [plural] slight differences ▪ He didn t understand the subtle shadings of legal language …   Dictionary of contemporary English

  • Pixel shading — Shader Un shader (anglais, du verbe to shade : ombrager ou estomper, nuancer) est un programme[Quoi ?] utilisé en image de synthèse pour paramétrer une partie du processus de rendu réalisé par une carte graphique ou un moteur de rendu… …   Wikipédia en Français

  • Shader Language — Shader Un shader (anglais, du verbe to shade : ombrager ou estomper, nuancer) est un programme[Quoi ?] utilisé en image de synthèse pour paramétrer une partie du processus de rendu réalisé par une carte graphique ou un moteur de rendu… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”