Jump to content
  • Advertisement
Sign in to follow this  
peter_b

pixelshaders and d3d lighting

This topic is 4963 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!