1 /**
  2  * potree.js 
  3  * http://potree.org
  4  *
  5  * Copyright 2012, Markus Sch�tz
  6  * Licensed under the GPL Version 2 or later.
  7  * - http://potree.org/wp/?page_id=7
  8  * - http://www.gnu.org/licenses/gpl-3.0.html
  9  *
 10  */
 11 
 12 
 13 /**
 14  * 
 15  * @param {int} width
 16  * @param {int} height
 17  * 
 18  * @class Framebuffer with rgba format and floating point precision for each component.
 19  * requires OES_texture_float extension.
 20  * 
 21  * @augments Framebuffer
 22  */
 23 function FramebufferFloat32(width, height){
 24 	Framebuffer.call(this, width, height);
 25 }
 26 
 27 FramebufferFloat32.prototype = new Framebuffer(inheriting);
 28 FramebufferFloat32.base = Framebuffer.prototype;
 29 
 30 /**
 31  * creates a colourbuffer with gl.FLOAT precision
 32  */
 33 FramebufferFloat32.prototype.initColorbuffer = function(){
 34 	gl.bindTexture(gl.TEXTURE_2D, this.texture.glid);
 35 	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
 36 	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
 37 	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
 38 	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
 39     gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.framebuffer.width, this.framebuffer.height, 0, gl.RGBA, gl.FLOAT, null);
 40 };