Home

Awesome

glsl-sat

####Description

glsl-sat is a shader generator for WebGL, to generate a summed-area-table texture of an input texture.

Based on Summed-Area Tables Area Tables And Their Application to Dynamic And Their Application to Dynamic Glossy Environment Reflections

See glsl-sat-demo.js for usage.

####Dependencies

####Demo

To run the demo, run:

    cd ./glsl-sat
    
    #install npm dependencies
    npm install
    
    #browser should open with the demo
    budo glsl-sat-demo.js --open


Live:

branchdemo
masterglsl-sat-demo
developglsl-sat-demo
Source UpscaledSource Red NumerifiedSAT Result UpscaledSAT Result Red Numerified
<img src="http://i.imgur.com/nhR71n4.png" alt="Source Upscaled"><img src="http://i.imgur.com/0iVMjng.png" alt="Source Red Numerified"><img src="http://i.imgur.com/4o4aEv9.png" alt="SAT Result Upscaled"><img src="http://i.imgur.com/f0eBldB.png" alt="SAT Result Red Numerified">

####Docs

const sat = require('./glsl-sat.js');
sat.computeNumPasses ({textureSize, sampleSize})
sat.computeNumBitsRequired ({width, height, channelBitDepth})
`sat.computeSat ({regl, texture, fbos, currentFboIndex = 0, outFbo = null, components = 'rgba', type = 'vec4', clipY = 1})

####Usage

See glsl-sat-demo.js for a full demo using regl and resl.

An excerpt:


  computeSat({texture: texture, fbos: fbos, outFbo: outFbo, regl});