HLSL: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(19 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{stub}}
{{stub}}
{{Src|4}} uses the C-style [[HLSL]] ('''H'''igh '''L'''evel '''S'''hading '''L'''anguage) for [[shader]]s. The language is very similar to [[GLSL]]. For example, [[ToGL]] converts from HLSL to GLSL on the fly.


HLSL stands for High Level Shading Language.
==Direct3D Versions and Shader Models==


The Source engine uses HLSL for shaders. There is another language called Cg (Which stands for 'C for Graphics'), which was developed alongside HLSL by Nvidia.
'''Direct3D 9''' shaders can target Shader Models 1, 2 or 3. Shader Model 2 has additional pixel shader profiles called ps2.0a and ps2.0b (collectively as ps2.0x) that offer more features than the base ps2.0.


[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/ProgrammingGuide/HLSLShaders/ProgrammableHLSLShaders.asp Microsoft HLSL website]
'''Direct3D 10''' shaders can only target Shader Model 4.


'''Direct3D 11''' shaders can target Shader Model 5.
'''Direct3D 12''' shaders can target Shader Models 5 and 6.
[https://msdn2.microsoft.com/en-us/library/bb509561.aspx Microsoft HLSL website]
== See also ==
* [[GLSL]] ([[OpenGL]] and [[Vulkan]] equivalent)
* [[CG]] {{deprecated}}
[[Category:Technical]]
[[Category:Technical]]
[[Category:Glossary]]
[[Category:Glossary]]

Latest revision as of 07:49, 6 December 2024

English (en)Русский (ru)中文 (zh)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

Source Source uses the C-style HLSL (High Level Shading Language) for shaders. The language is very similar to GLSL. For example, ToGL converts from HLSL to GLSL on the fly.

Direct3D Versions and Shader Models

Direct3D 9 shaders can target Shader Models 1, 2 or 3. Shader Model 2 has additional pixel shader profiles called ps2.0a and ps2.0b (collectively as ps2.0x) that offer more features than the base ps2.0.

Direct3D 10 shaders can only target Shader Model 4.

Direct3D 11 shaders can target Shader Model 5.

Direct3D 12 shaders can target Shader Models 5 and 6.

Microsoft HLSL website

See also