PDA

View Full Version : Shaders and dynamic lighting in D3D...



alexione
27-04-2006, 05:18 PM
Hi, all!

I was wondering about the best way to implement dynamic lighting in vertex shaders (just normal lights, no per-pixel lighting). As far as I see it, I NEED separate vertex shader for each type of light (distant/point/spot). On the other hand, each material has its own characteristics, and there will be different shaders for materials... Actuall, I'll need all there material-shaders in four variants (one for no local light, and 3 other for d/p/s light). Now, if I want support for another local light, I'll need 3x3 = 9 versions of shader for SAME material. Am I missing something or this is correct way of thinking...?

Clootie
27-04-2006, 09:11 PM
Ok, here we go:

NVIDIA: Implementing the Fixed-Function Pipeline using Cg (http://developer.nvidia.com/object/cg_fixed_function.html)

NVIDIA: Vertex Programs for the Fixed Function Pipeline (http://developer.nvidia.com/object/fixed_function_pipeline.html)

ATI: Implementing A Fixed Function Shader in HLSL - Technology Paper (http://www2.ati.com/misc/samples/dx9/FixedFuncShader.pdf)

alexione
07-05-2006, 06:01 PM
Thanx, Clootie!

Exactly what I needed....