   What is this for? (Lit)
  I just stumbled over this instruction while looking through the list:http://msdn.microsoft.com/en-us/library/bb509619%28VS.85%29.aspxit looks like it computes a full lighting vector in only a single instruction or so. I have no idea! [grin]Could someone please explain me for what is it for?   
it is only a shortcut for a very common operation in shader code.There are many similar intrinsics in HLSL such as reflect.The documentation you linked explained what it does, the in parameters, the out parameters and the formulas used to compute the result. What is exactly that you don't understand here?;  I don't understand what to do with the return vector.. Do I have to dot it? Or is it the finished lighting (Without color?), or what?   ;  Like the documentation sais: the returned vector contains the light coefficients (intensities) for ambient, diffuse and specular lighting. So, you just multiply your respective colors with those coefficents.   ;  Aha! I misunderstood the word "coefficients"!Now the next question: Is it faster than doing it by hand?   ;Quote:Original post by mind in a boxAha! I misunderstood the word "coefficients"!Now the next question: Is it faster than doing it by hand?in terms of runtime performance ? probably not, its a function that just happens to ship with the language, there is nothing magic about it, the code for all hlsl intrinsic functions are well tested and optimized though so you're very unlikely to gain anything by rolling your own if you need the exact same functionality.   ;  The 'lit' instruction was introduced for vertex shaders back in 1.0 or 1.1.  I wouldn't recommend using it today when targeting vs.2.0 or later...   ;  I wanted to use it for my deferred renderer (ps_4_0), but when it is really not recommend I'll just regard it.   ;Quote:Original post by SimmerDThe 'lit' instruction was introduced for vertex shaders back in 1.0 or 1.1.  I wouldn't recommend using it today when targeting vs.2.0 or later...What's the reason for not recommending it?   