Content-Length: 273568 | pFad | http://github.com/ayamflow/glsl-grid

05 GitHub - ayamflow/glsl-grid: Draws an antialiased grid along the X/Y/Z direction of a mesh.
Skip to content

Draws an antialiased grid along the X/Y/Z direction of a mesh.

License

Notifications You must be signed in to change notification settings

ayamflow/glsl-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glsl-grid

stable

Draws an antialiased grid along the X/Y/Z direction of a mesh. For use with glslify.

Reference from this gamedev post.

glsl-grid

Installation 📦

npm i glsl-grid -S

Usage 📖

grid(vec3 pos, vec3 axis, float size)

  • vec3 pos The position in world space.
  • vec3 axis The axis to draw a grid for. Set to 1.0 to enable, 0.0 to disable. i.e. vec3(0.0, 0.0, 1.0) will draw only along the z axis.
  • float size Space between grid tiles.

Example 💾

#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);
}

Demo

License 📝

MIT. See LICENSE for details.

About

Draws an antialiased grid along the X/Y/Z direction of a mesh.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ayamflow/glsl-grid

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy