PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

HLSL

HLSL

HLSL is a pl created in 2002.

#434on PLDB 20Years Old 640Users
8Books 0Papers 2kRepos

The High-Level Shader Language or High-Level Shading Language (HLSL) is a proprietary shading language developed by Microsoft for the Direct3D 9 API 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 shading language used with the OpenGL standard. It is very similar to the Nvidia Cg shading language, as it was developed alongside it. Read more on Wikipedia...


Example from Compiler Explorer:
// The entry point and target profile are needed to compile this example: // -T ps_6_6 -E PSMain struct PSInput { float4 position : SV_Position; float4 color : COLOR0; }; float4 PSMain(PSInput input) : SV_Target0 { return input.color * input.color; }
Example from Linguist:
float alpha = 1.f; texture tex; sampler tex_sampler = sampler_state { Texture = (tex); MipFilter = LINEAR; MinFilter = LINEAR; MagFilter = LINEAR; AddressU = WRAP; AddressV = WRAP; }; struct VS_OUTPUT { float4 pos : POSITION; float2 tex : TEXCOORD1; }; VS_OUTPUT vertex(float4 ipos : POSITION, float2 tex : TEXCOORD0) { VS_OUTPUT Out; Out.pos = ipos; Out.tex = tex * 2; return Out; } float4 pixel(VS_OUTPUT In) : COLOR { return tex2D(tex_sampler, In.tex) * alpha; } technique blur_ps_vs_2_0 { pass P0 { VertexShader = compile vs_2_0 vertex(); PixelShader = compile ps_2_0 pixel(); } }

Language features

Feature Supported Example Token
Comments
MultiLine Comments
Line Comments
Integers
Floats
Hexadecimals
Octals

Books about HLSL on goodreads

title author year reviews ratings rating
HLSL and Pixel Shaders for XAML Developers Walt Ritscher 2012 2 7 3.57
Hlsl and Pixel Shaders for Xaml Developers Walt Ritscher 2012 0 0 0.0
Real-Time 3D Rendering with DirectX and HLSL: A Practical Guide to Graphics Programming (Game Design) Paul Varcholik 2014 0 2 4.50

Books about HLSL from ISBNdb

title authors year publisher
HLSL and Pixel Shaders for XAML Developers: A Comprehensive Guide to Creating HLSL Pixel Shaders for WPF and Silverlight Applications Ritscher, Walt 2012 O'Reilly Media
HLSL and Pixel Shaders for XAML Developers Walt Ritscher 20120703 O'Reilly Media, Inc.
HLSL Development Cookbook Doron Feinstein 20130613 Packt Publishing
HLSL and Pixel Shaders for XAML Developers Walt Ritscher 20120703 O'Reilly Media, Inc.
Real-Time 3D Rendering with DirectX and HLSL Paul Varcholik 20140503 Pearson Technology Group
luna.html · hlsl.html · cilk.html

View source

PLDB - Build the next great programming language · v2022 · Day 32 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com