pixelshaders and d3d lighting
Hello.
Is it possible to combine the usage of pixelshaders and d3d lights? I was thinking maybe pixelshader maybe replaces that part of the pipeline or something.
Thanks in advance
You certainly can use d3d lights (fixed pipeline) in conjunction with the programmable pipeline. However, what you can't do is use both in the same render. For instance, you can render "simple" lighted objects using the fixed pipeline and save the shaders for more complex lighting models. Shaders are calculated per material so you can't use fixed and programmable on the same part. But you are welcome to mix and match otherwise. Just for instance, I use the programmable pipeline to render my main actors, but at the moment a lot of my props are rendered with the fixed. I will likely convert this later to optimize performance though.
Lighting is done in the fixed pipe vertex processing *or* vertex shader. This is passed to the fixed pipe TSS *or* pixel shader as the diffuse color (v0 in asm).
So yes, because the fixed pipe lighting is a vertex operation, you can still use this result in your own pixel shader.
So yes, because the fixed pipe lighting is a vertex operation, you can still use this result in your own pixel shader.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement