by xinaes » Sat Sep 20, 2014 10:13 am
You're comparing to an exact RGB value, but the value you're reading from texture2D may be subject to bilinear interpolation giving intermediate values as a result of the texture filters you have setup and texture coordinates that are not perfectly aligned to the centre of the texels.