Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper dither re-enabled #1045

Merged
merged 4 commits into from Apr 3, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Proper dither() noise factoring

  • Loading branch information
kvark committed Mar 31, 2017
commit 60a449c8e6334be6422ca0d0a63d88d5923889d3
@@ -763,8 +763,9 @@ vec4 dither(vec4 color) {
const int matrix_mask = 7;

ivec2 pos = ivec2(gl_FragCoord.xy) & ivec2(matrix_mask);
float noise_factor = 4.0 / 255.0;
float noise = texelFetch(sDither, pos, 0).r * noise_factor;
float noise_normalized = (texelFetch(sDither, pos, 0).r * 255.0 + 0.5) / 64.0;
float noise = (noise_normalized - 0.5) / 256.0; // scale down to the unit length

return color + vec4(noise, noise, noise, 0);
}
#endif //WR_FRAGMENT_SHADER
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.