article

The High Level Shader Language ( HLSL ) is a shader language developed by Microsoft for use with Direct3D, and is very similar to Cg.

HLSL allows writing complex graphical computations to be done on the graphics card quickly and efficiently, thus allowing complex effects while also decreasing the chance of programming errors compared to assembly shader programming.

= Shader Model Comparison =

Pixel Shader Comparison


  PS_2_0 PS_2_a PS_2_b PS_3_0
Dependent texture limit 4 No Limit 4 No Limit
Texture instruction limit 32 Unlimited Unlimited Unlimited
Position register No No No Yes
Instruction slots 32 + 64 512 512 ≥ 512
Executed instructions 32 + 64 512 512 ≥65535
Interpolated registers 2 + 8 2 + 8 2 + 8 10
Instruction predication No Yes No Yes
Index input registers No No No Yes
Temp registers 12 22 32 32
Constant registers 32 32 32 224
Arbitrary swizzling No Yes No Yes
Gradient instructions No Yes No Yes
Loop count register No No No Yes
Face register (2-sided lighting) No No No Yes
Dynamic flow control No No No 24

  • PS_2_0 = DirectX 9.0 original Shader Model 2 specification.
  • PS_2_a = NVIDIA GeForce FX-optimized model.
  • PS_2_b = ATI Radeon X700, X800, X850 shader model, DirectX 9.0b.
  • PS_3_0 = Shader Model 3.

Vertex Shader Comparison


  VS_2_0 VS_2_a VS_3_0
# of instruction slots 256 256 >=512
Max # of instructions executed 65535 65535 >=65535
Instruction Predication No Yes Yes
Temp Registers 12 13 32
# constant registers >=256 >=256 >=256
Static Flow Control Yes Yes Yes
Dynamic Flow Control No Yes Yes
Dynamic Flow Control Depth No 24 24
Vertex Texture Fetch No No Yes
# of texture samplers No No 4
Geometry Instancing Support No No Yes

  • VS_2_0 = DirectX 9.0 original Shader Model 2 specification.
  • VS_2_a = NVIDIA GeForce FX-optimized model.
  • VS_3_0 = Shader Model 3.

=External links=

3D computer graphics | Microsoft APIs

 

This article is licensed under the GNU Free Documentation License. It uses material from the "High Level Shader Language".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld