   "lit" instruction usage
  I wanted to use the "lit" instruction in HLSL but don't know howcurrently I'm computing diffuse/specular using simple diff = max(0.0f, dot(n,l)) ,and so on.could anybody explain "lit" abit more for me or maybe with a simple example? cuz I couldn't understand it clearly from the sdk help.does using lit save me some instructions comparing to the previous method ?thanks   
  As the help page says, it takes n.l, n.h, and the specular power as inputs, and returns a vector with (ambient, diffuse, specular, 1).  I'm not sure why the input and output is rearranged from the assembly instruction, as that would just likely mean the intrinsic has to rearrange the inputs.If you aren't using specular, this instruction will likely slow you down.  If you are doing specular, I'd imagine the hardware will be optimized to do the required pow and saturates faster than if you did it step by step.the diffuse output will be saturate(n.l)the specular output will be 0 if n.l or n.h are negative, or pow(n.h, power) otherwise.the ambient is set to 1.To usendl = dot (normal, lightvec);ndh = dot (normal, halfvec);float4 litresult = lit(ndl, ndh, specpower);float4 outColor;outColor.xyz = matAmbient * globalAmbient;outColor.xyz += matDiffColor * lightDiffColor * litresult.y;outColor.xyz += matSpecColor * lightSpecColor * litresult.z;outColor.w = matDiffColor.w;Personally, I find that setting specular to 0 when diffuse is 0 can cause ugly seams if the specular highlight is crossing the lit/shadowed threshold.  I find that using specular *= diffuse to soften the specular works nicely, though in some cases it may seem too soft.  I imagine with HDR the "too soft" effect would be cancelled out by the large value of the reflecting color.In other words, I don't use lit, because it assumes things about how I'm doing my lighting.   ;  thanksI have tried it, and it actually increased the instructions by 3, so I won't be using it anymore