So, I m trying to make a game in XNA, and I m applying a pixel shader to my level so I can add effects to the gameplay screen. The shader itself is working nicely, but it has one flaw that really pushes back performance. As long as the shader is active, anything I draw to the screen acts as though it was drawn with it s alpha channel at the maximum. I m drawing a lot of things using XNA s built in Color
class, and much of it has varying alpha. However, the shader seems to ignore all of this. This occurs even if I just return the source from the shader.
我看到了一些可能的解决办法。 其中第一个是引向RenderTarget2D,虽然这确实解决了这一问题,但它造成了更严重的甲型问题,我甚至不想去做。
I have seen a few people claim that multiplying the colours by the alpha value in the shader seems to help, but that made absolutely no difference, which suggests to me that the alpha value input is always being read as 1.
Here are some images to illustrate my problem:
希望有人知道如何解决这一问题。