HOME

TheInfoList



OR:

The High-Level Shader Language or High-Level Shading Language (HLSL) is a proprietary
shading language A shading language is a graphics programming language adapted to programming shader effects (characterizing surfaces, volumes, and objects). Such language forms usually consist of special data types, like "vector", "matrix", "color" and "normal". ...
developed by
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
for the
Direct3D Direct3D is a graphics application programming interface (API) for Microsoft Windows. Part of DirectX, Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D uses hardware a ...
9
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standa ...
to augment the shader assembly language, and went on to become the required shading language for the unified shader model of Direct3D 10 and higher. HLSL is analogous to the
GLSL OpenGL Shading Language (GLSL) is a high-level shading language with a syntax based on the C programming language. It was created by the OpenGL ARB (OpenGL Architecture Review Board) to give developers more direct control of the graphics pipeli ...
shading language used with the
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
standard. It is very similar to the
Nvidia Cg Cg (short for C for Graphics) and High-Level Shader Language (HLSL) are two names given to a high-level shading language developed by Nvidia and Microsoft for programming shaders. Cg/HLSL is based on the C programming language and although th ...
shading language, as it was developed alongside it. Early versions of the two languages were considered identical, only marketed differently. HLSL shaders can enable profound speed and detail increases as well as many
special effects Special effects (often abbreviated as SFX, F/X or simply FX) are illusions or visual tricks used in the theatre, film, television, video game, amusement park and simulator industries to simulate the imagined events in a story or virtual wor ...
in both 2D and 3D
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
. HLSL programs come in six forms:
pixel shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of spec ...
s (fragment in GLSL),
vertex shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of speci ...
s,
geometry shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of speci ...
s,
compute shader In computing, a compute kernel is a routine compiled for high throughput accelerators (such as graphics processing units (GPUs), digital signal processors (DSPs) or field-programmable gate arrays (FPGAs)), separate from but used by a main prog ...
s,
tessellation shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of speci ...
s (Hull and Domain shaders), and
ray tracing shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of spec ...
s (Ray Generation Shaders, Intersection Shaders, Any Hit/Closest Hit/Miss Shaders). A vertex shader is executed for each vertex that is submitted by the application, and is primarily responsible for transforming the vertex from object space to view space, generating texture coordinates, and calculating lighting coefficients such as the vertex's normal, tangent, and bitangent vectors. When a group of vertices (normally 3, to form a triangle) come through the vertex shader, their output position is interpolated to form pixels within its area; this process is known as
rasterization In computer graphics, rasterisation (British English) or rasterization (American English) is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image (a series of pixels, dots or lines, whic ...
. Optionally, an application using a Direct3D 10/11/12 interface and Direct3D 10/11/12 hardware may also specify a geometry shader. This shader takes as its input some vertices of a primitive (triangle/line/point) and uses this data to generate/degenerate (or
tessellate A tessellation or tiling is the covering of a surface, often a plane, using one or more geometric shapes, called ''tiles'', with no overlaps and no gaps. In mathematics, tessellation can be generalized to higher dimensions and a variety of ...
) additional primitives or to change the type of primitives, which are each then sent to the rasterizer. D3D11.3 and D3D12 introduced Shader Model 5.1 and later 6.0.


Shader model comparison

GPUs listed are the hardware that first supported the given specifications. Manufacturers generally support all lower shader models through drivers. Note that games may claim to require a certain DirectX version, but don't necessarily require a GPU conforming to the full specification of that version, as developers can use a higher DirectX API version to target lower-Direct3D-spec hardware; for instance DirectX 9 exposes features of DirectX7-level hardware that DirectX7 did not, targeting their fixed-function T&L pipeline.


Pixel shader comparison

*PS 1.0 — Unreleased
3dfx 3dfx Interactive was an American technology company headquartered in San Jose, California, founded in 1994, that specialized in the manufacturing of 3D graphics processing units, and later, video cards. It was a pioneer in the field from the l ...
Rampage, DirectX 8. *PS 1.1 —
GeForce 3 The GeForce 3 series (NV20) is the third generation of Nvidia's GeForce graphics processing units (GPUs). Introduced in February 2001, it advanced the GeForce architecture by adding programmable pixel and vertex shaders, multisample anti-aliasi ...
, DirectX 8. *PS 1.2 —
3Dlabs 3Dlabs was a fabless semiconductor company. It was founded in 1994 with headquarters in San Jose, California. It originally developed the GLINT and PERMEDIA high-end graphics chip technology, that was used on many of the world's leading computer g ...
Wildcat VP, DirectX 8.0a. *PS 1.3 — GeForce 4 Ti, DirectX 8.0a. *PS 1.4 — Radeon 8500-9250,
Matrox Parhelia Matrox Parhelia-512 is a graphics processing unit (GPU) with full support for DirectX 8.1 and incorporating several DirectX 9.0 features. Released in 2002, it was best known for its ability to drive three monitors ("Surround Gaming") and its ''Co ...
, DirectX 8.1. *Shader Model 2.0 — Radeon 9500-9800/X300-X600, DirectX 9. *Shader Model 2.0a — GeForce FX/PCX-optimized model, DirectX 9.0a. *Shader Model 2.0b — Radeon X700-X850 shader model, DirectX 9.0b. *Shader Model 3.0 —
Radeon X1000 The R520 (codenamed Fudo) is a graphics processing unit (GPU) developed by ATI Technologies and produced by TSMC. It was the first GPU produced using a 90 nm photolithography process. The R520 is the foundation for a line of DirectX 9.0c a ...
and
GeForce 6 The GeForce 6 series (codename NV40) is Nvidia's sixth generation of GeForce graphic processing units. Launched on April 14, 2004, the GeForce 6 family introduced PureVideo post-processing for video, '' SLI'' technology, and ''Shader Model 3.0 ...
, DirectX 9.0c. *Shader Model 4.0 —
Radeon HD 2000 The graphics processing unit (GPU) codenamed Radeon R600 is the foundation of the Radeon HD 2000 series and the FireGL 2007 series video cards developed by ATI Technologies. The HD 2000 cards competed with nVidia's GeForce 8 series. Architect ...
and GeForce 8, DirectX 10. *Shader Model 4.1 — Radeon HD 3000 and GeForce 200, DirectX 10.1. *Shader Model 5.0 — Radeon HD 5000 and
GeForce 400 Serving as the introduction of Fermi (microarchitecture), Fermi, the GeForce 400 series is a series of graphics processing units developed by Nvidia. Its release was originally slated in November 2009; however, after delays, it was released on M ...
, DirectX 11. *Shader Model 5.1 — GCN 1+, Fermi+, DirectX 12 (11_0+) with WDDM 2.0. *Shader Model 6.0 — GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.1. *Shader Model 6.1 — GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.3. *Shader Model 6.2 — GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.4. *Shader Model 6.3 — GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.5. *Shader Model 6.4 — GCN 1+, Kepler+, Skylake+, DirectX 12 (11_0+) with WDDM 2.6. *Shader Model 6.5 — GCN 1+, Kepler+, Skylake+, DirectX 12 (11_0+) with WDDM 2.7. *Shader Model 6.6 — GCN 4+, Maxwell+, DirectX 12 (11_0+) with WDDM 3.0. *Shader Model 6.7 — GCN 4+, Maxwell+, DirectX 12 (12_0+) with WDDM 3.1. "32 + 64" for ''Executed Instructions'' means "32 texture instructions and 64 arithmetic instructions."


Vertex shader comparison


See also

*
Direct3D Direct3D is a graphics application programming interface (API) for Microsoft Windows. Part of DirectX, Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D uses hardware a ...
*
DirectX Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct", ...
*
DirectX Raytracing DirectX Raytracing (DXR) is a feature introduced in Microsoft's DirectX 12 that implements ray tracing, for video graphic rendering. DXR was released with the Windows 10 October update (version 1809) on October 10, 2018. It requires an AMD Rade ...


Footnotes

{{reflist


External links


Programming guide for HLSL
at
Microsoft Docs Microsoft Docs is the library of technical documentation for end users, developers, and IT professionals who work with Microsoft products. The Microsoft Docs website provides technical specifications, conceptual articles, tutorials, guides, API ...

Introduction to the DirectX 9 High Level Shading Language
(ATI) AMD developer central
Riemer's HLSL Introduction & Tutorial (includes sample code)



DirectX Intermediate Language
(DXIL) specification C programming language family DirectX Microsoft application programming interfaces Shading languages