How to use the gl/utils.FBO function in gl

To help you get started, we’ve selected a few gl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jwagner / voxelworlds / src / main.js View on Github external
function prepareScene(){
    canvas.style.display = 'block';

    window.world = new voxel.World({width: 8, height: 4, depth: 8, chunk_size: 32, scale: 0.5});
    voxel.random_world(window.world, seed);
    //voxel.flat_world(window.world, 10);
    window.renderer = new glvoxel.Renderer(window.world);

    var albedoFBO = new FBO(canvas.width, canvas.height, gl.FLOAT),
        blurFBO0 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO1 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO2 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT),
        blurFBO3 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT);

    resizeVBO = function() {
        // hoping the GC will clean up...
        FBO.call(albedoFBO, canvas.width, canvas.height, gl.FLOAT);
        FBO.call(blurFBO0, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO1, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO2, canvas.width>>2, canvas.height>>2, gl.FLOAT);
        FBO.call(blurFBO3, canvas.width>>2, canvas.height>>2, gl.FLOAT);
    }; 

    cube = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.5, 0.0, 0.0, 0.5])}, [
            new scene.SimpleMesh(new glUtils.VBO(mesh.cube(-0.5)))])
github jwagner / voxelworlds / src / main.js View on Github external
function prepareScene(){
    canvas.style.display = 'block';

    window.world = new voxel.World({width: 8, height: 4, depth: 8, chunk_size: 32, scale: 0.5});
    voxel.random_world(window.world, seed);
    //voxel.flat_world(window.world, 10);
    window.renderer = new glvoxel.Renderer(window.world);

    var albedoFBO = new FBO(canvas.width, canvas.height, gl.FLOAT),
        blurFBO0 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO1 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO2 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT),
        blurFBO3 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT);

    resizeVBO = function() {
        // hoping the GC will clean up...
        FBO.call(albedoFBO, canvas.width, canvas.height, gl.FLOAT);
        FBO.call(blurFBO0, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO1, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO2, canvas.width>>2, canvas.height>>2, gl.FLOAT);
        FBO.call(blurFBO3, canvas.width>>2, canvas.height>>2, gl.FLOAT);
    }; 

    cube = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.5, 0.0, 0.0, 0.5])}, [
github jwagner / voxelworlds / src / main.js View on Github external
function prepareScene(){
    canvas.style.display = 'block';

    window.world = new voxel.World({width: 8, height: 4, depth: 8, chunk_size: 32, scale: 0.5});
    voxel.random_world(window.world, seed);
    //voxel.flat_world(window.world, 10);
    window.renderer = new glvoxel.Renderer(window.world);

    var albedoFBO = new FBO(canvas.width, canvas.height, gl.FLOAT),
        blurFBO0 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO1 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO2 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT),
        blurFBO3 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT);

    resizeVBO = function() {
        // hoping the GC will clean up...
        FBO.call(albedoFBO, canvas.width, canvas.height, gl.FLOAT);
        FBO.call(blurFBO0, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO1, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO2, canvas.width>>2, canvas.height>>2, gl.FLOAT);
        FBO.call(blurFBO3, canvas.width>>2, canvas.height>>2, gl.FLOAT);
    }; 

    cube = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.5, 0.0, 0.0, 0.5])}, [
            new scene.SimpleMesh(new glUtils.VBO(mesh.cube(-0.5)))])
        ]);
    cube2 = new scene.Transform([
github jwagner / voxelworlds / src / main.js View on Github external
function prepareScene(){
    canvas.style.display = 'block';

    window.world = new voxel.World({width: 8, height: 4, depth: 8, chunk_size: 32, scale: 0.5});
    voxel.random_world(window.world, seed);
    //voxel.flat_world(window.world, 10);
    window.renderer = new glvoxel.Renderer(window.world);

    var albedoFBO = new FBO(canvas.width, canvas.height, gl.FLOAT),
        blurFBO0 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO1 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO2 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT),
        blurFBO3 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT);

    resizeVBO = function() {
        // hoping the GC will clean up...
        FBO.call(albedoFBO, canvas.width, canvas.height, gl.FLOAT);
        FBO.call(blurFBO0, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO1, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO2, canvas.width>>2, canvas.height>>2, gl.FLOAT);
        FBO.call(blurFBO3, canvas.width>>2, canvas.height>>2, gl.FLOAT);
    }; 

    cube = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.5, 0.0, 0.0, 0.5])}, [
            new scene.SimpleMesh(new glUtils.VBO(mesh.cube(-0.5)))])
        ]);
    cube2 = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.0, 0.0, 1.0, 0.5])}, [
github jwagner / voxelworlds / src / main.js View on Github external
function prepareScene(){
    canvas.style.display = 'block';

    window.world = new voxel.World({width: 8, height: 4, depth: 8, chunk_size: 32, scale: 0.5});
    voxel.random_world(window.world, seed);
    //voxel.flat_world(window.world, 10);
    window.renderer = new glvoxel.Renderer(window.world);

    var albedoFBO = new FBO(canvas.width, canvas.height, gl.FLOAT),
        blurFBO0 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO1 = new FBO(canvas.width>>1, canvas.height>>1, gl.FLOAT),
        blurFBO2 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT),
        blurFBO3 = new FBO(canvas.width>>2, canvas.height>>2, gl.FLOAT);

    resizeVBO = function() {
        // hoping the GC will clean up...
        FBO.call(albedoFBO, canvas.width, canvas.height, gl.FLOAT);
        FBO.call(blurFBO0, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO1, canvas.width>>1, canvas.height>>1, gl.FLOAT);
        FBO.call(blurFBO2, canvas.width>>2, canvas.height>>2, gl.FLOAT);
        FBO.call(blurFBO3, canvas.width>>2, canvas.height>>2, gl.FLOAT);
    }; 

    cube = new scene.Transform([
        new scene.Material(shaders.get('solid'), {color: vec4.create([0.5, 0.0, 0.0, 0.5])}, [
            new scene.SimpleMesh(new glUtils.VBO(mesh.cube(-0.5)))])
        ]);