As I understand it, Alpha Testing will simply ignore those pixels, that do not pass the test.
I have made an alpha-test with renderstates [D3DRS_ALPHAFUNC, D3DCMP_GREATER] and [D3DRS_ALPHAREF, 128].
Since the problem arose, I have simplified my texture, making the rgb-layer completely white, while preserving the alpha-layer.
I have further simplified my shader, so that it now simply outputs the texture raw, and that is all. No lighting or any other kinds of calculations.
The result is still scorched edges, as can be seen below:
I would have expected a completely white plant, with no grey-scales (partial alpha) and no black edges.
How come, that the alpha is burned into the texture like that?
As can be seen, the pixel shader is extremely simple (I removed the argument list because it is irrelevant (except a_texcoord0)).
float4 PS_light_SHADOW(...) : COLOR
{
return tex2D(g_texturemap_sampler, a_texcoord0);
}
My renderstates are as follows:
SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE)
SetRenderState(D3DRS_ZWRITEENABLE, TRUE)
SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE)
SetRenderState(D3DRS_ALPHATESTENABLE, TRUE)
SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER)
SetRenderState(D3DRS_ALPHAREF, 128)
Thank you in advance.