• Stars
    star
    7
  • Rank 2,294,772 (Top 46 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebGL based library for drawing textures

Texturity.js

WebGL based library for fast drawing textures

Capabilities

  • Normal map
  • Blur
  • Noise
  • Repeat
  • Circle
  • Brick wall
  • Gradient
  • Blending
  • Image drawing
  • Convolution
  • Fourier transormation

Installing

Download the latest release or use CDN

<script src="https://cdn.jsdelivr.net/npm/texturity.js@latest/build/texturity.js"></script>

Or import as module using NPM

npm install --save texturity.js
import * as Texturity from 'texturity.js';

Usage

Optionally initialize the WebGL context

 Texturity.initGL('webgl',{alpha:true}); //optional parameters

Create and process Canvas

var fastCanvas = new Texturity.Canvas(w, h);

fastCanvas.drawCircle(0.5);
fastCanvas.drawBricks(6,0.05);
fastCanvas.blur(fastCanvas.toTexture(), 3);
fastCanvas.normalMap(fastCanvas.toTexture(), 0.5,0,4);

All Canvas instances use the same WebGL context, which allows to get good performance, so be careful and use save()/restore()