Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glsl-grid

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-grid

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

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

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 :package:

npm i glsl-grid -S

Usage :book:

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 :floppy_disk:

#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 :pencil:

MIT. See LICENSE for details.

Keywords

FAQs

Package last updated on 31 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc