Change the dither texture's swizzling

This is a more elegant way to sample from a float alpha texture.
Instead of sampling from the red channel in the fragment shader
we can set the alpha channel swizzle to redirect it to the
red channel. This lets us sample from the alpha channel in the
fragment shader and get the correct value.

Change-Id: I95bbf7a82964e1bf42c0fee1b782b6bdbbcef618
This commit is contained in:
Romain Guy
2013-04-08 19:45:40 -07:00
parent 50b9eb1c73
commit 032d47af73
2 changed files with 5 additions and 1 deletions

View File

@ -186,7 +186,7 @@ const char* gFS_Main_Dither[2] = {
// ES 2.0
"texture2D(ditherSampler, ditherTexCoords).a * " STR(DITHER_KERNEL_SIZE_INV_SQUARE),
// ES 3.0
"texture2D(ditherSampler, ditherTexCoords).r"
"texture2D(ditherSampler, ditherTexCoords).a"
};
const char* gFS_Main_AddDitherToGradient =
" gradientColor += %s;\n";