Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    voxel-coloristpublic

    voxel-colorist

    A module for colour grading your voxels in voxel.js, for use with voxel-pp.

    Check out the demo here

    This is done using a 3D colour lookup table (as detailed here and here), which is surprisingly simple and easy to work with. The Witness Blog has a good explanation too.

    voxel-colorist

    Installation

    npm install voxel-colorist voxel-pp

    Usage

    colorist(processor)

    Creates a new colour-grader instance.

    colorist(processor).table(src|element|texture)

    Loads a new colour table from a canvas/image element or image URL.

    // Create the game
    var game = require('voxel-engine')({
      chunkSize: 32
    })
     
    // Load up post-processing
    var composer = require('voxel-pp')(game)
    // Add colour grading
    var colorist = require('voxel-colorist')(composer)
     
    // Load a 33*33*33 colour table
    var img = new Image
    img.onload = function() {
      colorist.table(img)
    };
    img.src = '/warm.png'

    Keywords

    none

    install

    npm i voxel-colorist

    Downloadsweekly downloads

    5

    version

    0.0.3

    license

    none

    last publish

    collaborators

    • avatar