提交 489ae6bc 编写于 作者: M Mr.doob

ShaderChunk: dithering_pars_fragment now using common rand() and removed...

ShaderChunk: dithering_pars_fragment now using common rand() and removed unneeded constant. See #11076.
上级 122a8d55
......@@ -3,7 +3,7 @@
// based on https://www.shadertoy.com/view/MslGR8
vec3 dithering( vec3 color ) {
//Calculate grid position
float grid_position = fract( dot( gl_FragCoord.xy - vec2( 0.5, 0.5 ) , vec2( 1.0 / 16.0, 10.0 / 36.0 ) + 0.25 ) );
float grid_position = rand( gl_FragCoord.xy );
//Shift the individual colors differently, thus making it even harder to see the dithering pattern
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
......@@ -12,7 +12,7 @@
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
//shift the color by dither_shift
return color + 0.5 / 255.0 + dither_shift_RGB;
return color + dither_shift_RGB;
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册