OES_fbo_render_mipmap WebGL working group (public_webgl 'at' khronos.org) Florian Boesch (pyalot 'at' gmail.com) Members of the WebGL working group 28 Any level of a texture can be attached to a framebuffer object. [NoInterfaceObject] interface OES_fbo_render_mipmap { };
        var extension = gl.getExtension('OES_fbo_render_mipmap');
        if(extension !=== null){
            var texture = gl.createTexture();
            gl.bindTexture(gl.TEXTURE_2D, texture);
            var fbos = [];
            
            for(var level=0; level<7; level++){
                var size = 128/Math.pow(2, level);
                gl.texImage2D(gl.TEXTURE_2D, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
                var fbo = gl.createFramebuffer();
                gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
                gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, level);
                fbos.push(fbo);
                
                var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
                console.assert(fboStatus == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is not complete');
            }

            gl.bindTexture(gl.TEXTURE_2D, null);
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);

            console.assert(gl.getError() == gl.NO_ERROR, 'A GL error occured');
        }
    
Initial revision. Moved to draft.