Dither H
Dither H
Dither H
/ Dither /
'-----------------------------------------------------------*/
/*
Dither version 1.2.0
by Christian Cann Schuldt Jensen ~ CeeJay.dk
Does dithering of the greather than 8-bit per channel precision used in shaders.
Even halfs offer 10(+1)bit per channel
*/
float dither_size = 2.0; //Size of the dithering grid - I'm using a 2x2 grid
here.
float dither_bit = 8.0; //Number of bits per channel. Should be 8 for most
monitors.
/*
//Calculate grid position
float grid_position = frac(dot(tex,(screen_size / dither_size)) + (0.5 /
dither_size)); //returns 0.25 and 0.75
//Shift the individual colors differently, thus making it even harder to see
the dithering pattern
float3 dither_shift_RGB = float3(-dither_shift, dither_shift, -
dither_shift); //subpixel dithering
//Shift the individual colors differently, thus making it even harder to see
the dithering pattern
float3 dither_shift_RGB = float3(dither_shift, -dither_shift,
dither_shift); //subpixel dithering
colorInput.rgb = color.rgb;
return colorInput;
}