Talk:High Level Shader Language
From Wikipedia, the free encyclopedia
Contents |
[edit] This article is fairly lacking
HLSL was designed to be similar to the Renderman shading language, and it more useful to compare it against that. There are many differnces neccecitated by hardware architecture. However, many of the language features and intrinics are exactly the same as Renderman. In addition, the language has 2 distinct differnces from C. The first is that it is natively a vector and math language, thus all types are vectored. The 2nd difference is that there is no persistent state. That is, an HLSL program can't access any memory in read/write fasion, it may read from one peice of memory (e.g. textures), and write to another (e.g.) the backbuffer), and one shader cannot pass any information to another instance of a shader (unless it is further down the graphics pipeline.) Dankbaker 15:45, 20 September 2007 (UTC)
Shader Models vs Shader Profiles
[edit] Shader Model 4.0 info?
Could some info on Shader Model 4 be added, please?
I found some here: http://www.atomicmpc.com.au/forums.asp?s=2&c=7&t=10239&p=0. Interestingly, this info is not in Microsoft's own DirectX SDK help files - annoying.
There is a fair amount of material in the SDK concerning shader model 4.0. The main language feature differences are templated texture types, input and output signatures (to prevent runtime linkage), bitwise operators, native integer support (prevous versions were emmulated), and switch statements. There are few more minor features, such as the presence of attributes as in C#, but unlike C# attributes can be specified before any statement and are ignored if unrecoginized. They can be used to specifiy. Additionally, the precision required is near IEEE, with NANs and INFS and the like. There are a few differences, I can't remember them all, but the precision isn't quite as high. 1 bit ULP instead of a half bit that IEEE requires. Dankbaker 15:45, 20 September 2007 (UTC)
[edit] GLSL comparison info?
Where can one find similar info for GLSL and Cg as is provided in the two tables in this article ? —The preceding unsigned comment was added by 88.85.52.191 (talk) 17:19, 1 January 2007 (UTC).
[edit] >= 256
at some places there is a specification of ">= 256" which makes no sense to me. it should be "<=256". maybe it would be even better to be able to express the same without <>= just by using max (or min?) in the specs?
Actually, ≥ 256 is correct. This shows up here http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/Shaders/VertexShader3_0/Registers/Registers.asp in a footnote, "256 is the minimum c# register count required by vs_2_x. The MaxVertexShaderConst cap contains the actual c# register count supported by the device"
It also shows up here: ftp://download.nvidia.com/developer/presentations/2004/GPU_Jackpot/Shader_Model_3.pdf