Coupla Basic Shader Questions
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!
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).
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).
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.
Here is something from Dx9 SDK
discard Statement (DirectX HLSL)
Do not output the result of the current pixel.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement