postprocessor for 3dlut colcorr; dithering should be managed in "dirty" way

dirty way: loads dithered/passthru shader according to the game's config (boolean fxdither)
This commit is contained in:
minjaesong
2017-11-02 17:47:52 +09:00
parent f5636fe0d3
commit 7cd7b4047f
9 changed files with 158 additions and 35 deletions

View File

@@ -10,9 +10,9 @@ uniform sampler2D u_texture;
// "steps" of R, G and B. Must be integer && equal or greater than 2
uniform float rcount = 4.0;
uniform float gcount = 4.0;
uniform float bcount = 4.0;
uniform float rcount = 64.0;
uniform float gcount = 64.0;
uniform float bcount = 64.0;
uniform float acount = 1.0;
@@ -65,15 +65,9 @@ vec4 nearestColour(vec4 incolor) {
color.r = floor((rgbaCounts.r - 1.0) * color.r + 0.5) / (rgbaCounts.r - 1.0);
color.g = floor((rgbaCounts.g - 1.0) * color.g + 0.5) / (rgbaCounts.g - 1.0);
color.b = floor((rgbaCounts.b - 1.0) * color.b + 0.5) / (rgbaCounts.b - 1.0);
color.a = 1.0;//floor((rgbaCounts.a - 1.0) * color.a + 0.5) / (rgbaCounts.a - 1.0);
if (rgbaCounts.a >= 2.0) {
color.a = floor((rgbaCounts.a - 1.0) * color.a + 0.5) / (rgbaCounts.a - 1.0);
}
else {
color.a = 1.0;
}
return (color);
return color;
}
void main(void) {
@@ -87,4 +81,5 @@ void main(void) {
gl_FragColor = nearestColour(inColor + spread * (bayer[int(entry.y) * int(bayerSize) + int(entry.x)] / bayerDivider - 0.5));
//gl_FragColor = nearestColour(inColor);
//gl_FragColor = inColor;
}