Sign in to follow this  

pixelshaders and d3d lighting

This topic is 4748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this