Draws an antialiased grid along the X/Y/Z direction of a mesh.
Draws an antialiased grid along the X/Y/Z direction of a mesh. For use with glslify.
Reference from this gamedev post.
npm i glsl-grid -S
#pragma glslify: grid = require(glsl-grid)
varying vec3 vPos;
void main() {
float lines = grid(vPos, vec3(0.0, 0.0, 1.0), 2.0);
gl_FragColor = vec4(vec3(lines), 1.0);
}
MIT. See LICENSE for details.