glsl-crosshatch-filter
v1.0.0
Published
a simple crosshatch effect for 2D scenes
Downloads
16
Maintainers
Readme
glsl-crosshatch-filter
A very basic crosshatch effect for post-processing, from geeks3d.com.
#pragma glslify: crosshatch = require('glsl-crosshatch-filter')
void main() {
vec4 texColor = texture2D(sampler, uv);
gl_FragColor.rgb = crosshatch(texColor.rgb);
gl_FragColor.a = texColor.a;
}
Usage
vec3 crosshatch(vec3 texColor)
Applies a cross-hatch filter to the texColor
RGB based on its luminance, using the thresholds 1.0, 0.75, 0.5, 0.3
. Returns the new RGB color.
vec3 crosshatch(vec3 texColor, float t1, float t2, float t3, float t4)
Applies a cross-hatch filter to the texColor
RGB based on its luminance, using the thresholds from t1
(brightest) to t4
(darkest). Returns the new RGB color.
License
MIT, see LICENSE.md for details.