HLSL: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Nesciuse moved page HLSL/en to HLSL without leaving a redirect: Move en subpage to basepage)
(Removed irrelevant/incorrect information and reworded shader model info. (ToGL disassembles the DirectX shader bytecode to equivalent GLSL, almost the exact opposite of what was described. Cg has been deprecated since 2012 and was almost identical to HLSL anyway.))
Line 2: Line 2:


{{stub}}
{{stub}}
{{Src|4}} uses the C-style [[HLSL]] ('''H'''igh '''L'''evel '''S'''hading '''L'''anguage) for [[shader]]s. Shaders written in other languages, such as [[GLSL]] or [[CG]] can be quickly and easily ported to HLSL. For example, [[ToGL]] converts from GLSL to HLSL on the fly.  
{{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]].


==Direct3D Versions and Shader Models==
==Direct3D Versions and Shader Models==


'''Direct3D 9''' shaders can be designed using any of the following: Shader Model 1, 2 and 3. It should be noted that there are versions 2.0a and 2.0b which are optimized for specific vendor graphics cards.
'''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 be designed on Shader Model 4.
'''Direct3D 10''' shaders can only target Shader Model 4.


'''Direct3D 11''' shaders can be designed on Shader Model 5.
'''Direct3D 11''' shaders can target Shader Model 5.


'''Direct3D 12''' shaders can be designed on Shader Model 5 (DX Feature Level 11.0), 6 and later.
'''Direct3D 12''' shaders can target Shader Models 5 and 6.


[https://msdn2.microsoft.com/en-us/library/bb509561.aspx Microsoft HLSL website]
[https://msdn2.microsoft.com/en-us/library/bb509561.aspx Microsoft HLSL website]

Revision as of 22:07, 5 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.

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


Stub

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