Discard and MipMaps


I am using the discard function in a pixel shader to remove unwanted pixels.

The only problem is that the scaling of my mipmapped textures blends the edge of my images with the colour I wish to remove.

This leaves a line around my object where the colour I was discarding has blended with the pixels I wanted to keep.

Is there any way to stop this?

Use alpha testing instead of the method you are currently using.
Color discard allways has this problem and there is no way of fixing it.
The best thing is to use an alpha map instead.

Ok, thanks, I have it working now.

I can’t believe it was that simple :smiley:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.