glsl-crosshatch-filter

1.0.0 • Public • Published

glsl-crosshatch-filter

stable

crosshatch

(glslbin demo)

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

NPM

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.

Package Sidebar

Install

npm i glsl-crosshatch-filter

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mattdesl