Strange shader behaviour

Hello,

I was playing a bit with PointSprites, a patch I found on this site once (I don’t remember who wrote it though).

The thing is, I used a png with an alpha channel, but for some reason, the alpha channel doesn’t seem to behave the same on each vertex of the mesh…

In the attached image, you can see that on the top half of the renderer, the texture seems to have a black border, but in the lower half, it looks the way I would expect (becoming more and more transparent towards the edges, instead of darker towards the edge).

Does anyone has a clue where this behaviour comes from? Or is it only on this computer, and does it behave correctly on yours? I attach the patch also, so you can see what it does on your end.

PointSprites.zip (15.2 kB)

hi, that was my shader
check here the last snippet might help you:
http://legacy.vvvv.org/tiki-index.php?page=ShaderSnippets
i didn’t try it now but this behavior is typical for z-depth + alpha channel scenarios

yes it works just replace the old one with this tech.

technique workingalpha
{
pass P0
{
	FillMode = POINT;
	PointScaleEnable = true;
        PointSpriteEnable = true;
VertexShader = compile vs_1_0 VS();
PixelShader = compile ps_2_0 PS();
AlphaBlendEnable = false;

AlphaTestEnable = true;
AlphaFunc = Greater;
AlphaRef = 245;

ZEnable = true;
ZWriteEnable = true;

CullMode = None;
}
pass P1
{
	
	FillMode = POINT;
	PointScaleEnable = true;
        PointSpriteEnable = true;
VertexShader = compile vs_1_0 VS();
PixelShader = compile ps_2_0 PS();
AlphaBlendEnable = true;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

AlphaTestEnable = true;
AlphaFunc = LessEqual;
AlphaRef = 245;

ZEnable = true;
ZWriteEnable = false;

CullMode = None;
}

}

I figured out that the reason was because of the drawing order, and because I had Z-buffer enabled. It worked as expected when I turned Z-buffer on, but this update makes it work always.

Thanks a lot.