Original Post
Hi, I have been learning about assembly shaders in DirectX, but I'm a little confused about some of the ways they are used. The books and other resources I have learnt from all have example applications and shaders, for example for a spot light, point light, water, bump mapping, even morphing animation, etc... But, for example, what if you want to have two point lights - I don't think you would render the scene twice, each time inputting the data for a different light. Or maybe you could just write the shader to handle two lights at once, but then how do engines handle more lights, say 5 (for example)... The same goes for shadow (shadow volumes, say) - how do you cast a shadow from a mesh using multiple lights? Also, say you want to animate a mesh using a morphing shader, and also have it coloured using a cartoon shader - do you render the mesh once for each shader, or write a seperate shader which incorporates both techniques? Basically, I guess I'm trying to ask how to pull what I have learnt about shaders together to actually be able to use them properly. Any explanations or links would be much appreciated, thanks.