• Advertisement
Sign in to follow this  

Coupla Basic Shader Questions

This topic is 3038 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

Hey. Does the use of a shader override render states, such as BlendFunction and AlphaEnable? If I'm using a pixel shader to color every pixel of a draw call, with no texture, is there a way to tell certain pixels not to draw at all, or do I have to assign some color value to every single pixel? THANKS!

Share this post


Link to post
Share on other sites
Advertisement
AFAIK it shouldn't effect render states such as blending. I had a pixel shader attached while using alpha blending and it worked fine.

As for your second question, I'm not sure how you'd do that in a pixel shader, but I'll assume it can easily be done using Alpha Testing to discard certain pixels if you have an alpha-only texture applied (D3DFMT_A8).

Share this post


Link to post
Share on other sites
Yes, you can us discard to skip color that pixel.

Here is something from Dx9 SDK

discard Statement (DirectX HLSL)
Do not output the result of the current pixel.

Share this post


Link to post
Share on other sites
Short answer: No, they don't; they cover two different parts of the pipeline. A good way to think about it is the shader output corresponding to a texture or something-- you can do anything with it that you could do with traditional fixed-function methodology in this aspect.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement