Skip to content

Commit

Permalink
Add two new extensions: colorBufferFloatExtension, colorBufferHalfFlo…
Browse files Browse the repository at this point in the history
…atExtension
  • Loading branch information
mortennobel committed Aug 3, 2013
1 parent 0cce594 commit f34e556
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/js/kick/core/GLState.js
Expand Up @@ -22,6 +22,8 @@ define(["kick/core/Constants", "kick/core/Util"], function (constants, Util) {
textureFilterAnisotropicExt = null,
drawBuffersExt = null,
elementIndexUIntExt = null,
colorBufferFloatExt = null,
colorBufferHalfFloatExt = null,
reloadExtensions = function(){
vertexArrayObjectExt = engine.getGLExtension("OES_vertex_array_object");
standardDerivativesExt = engine.getGLExtension("OES_standard_derivatives");
Expand All @@ -31,6 +33,8 @@ define(["kick/core/Constants", "kick/core/Util"], function (constants, Util) {
textureFilterAnisotropicExt = engine.getGLExtension("EXT_texture_filter_anisotropic") || engine.getGLExtension("WEBGL_texture_filter_anisotropic");
drawBuffersExt = engine.getGLExtension("EXT_draw_buffers") || engine.getGLExtension("WEBGL_draw_buffers");
elementIndexUIntExt = engine.getGLExtension("OES_element_index_uint");
colorBufferFloatExt = engine.getGLExtension("WEBGL_color_buffer_float") || engine.getGLExtension("EXT_color_buffer_float");
colorBufferHalfFloatExt = engine.getGLExtension("EXT_color_buffer_half_float");
},
clearExtensions = function(){
vertexArrayObjectExt = null;
Expand All @@ -41,6 +45,8 @@ define(["kick/core/Constants", "kick/core/Util"], function (constants, Util) {
textureFilterAnisotropicExt = null;
drawBuffersExt = null;
elementIndexUIntExt = null;
colorBufferFloatExt = null;
colorBufferHalfFloatExt = null;
};
/**
* The current clear color
Expand Down Expand Up @@ -245,6 +251,32 @@ define(["kick/core/Constants", "kick/core/Util"], function (constants, Util) {
return elementIndexUIntExt;
},
enumerable:true
},
/**
* Adds support for rendering to 32-bit floating-point color buffers.
* See http://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/
* @property colorBufferFloatExtension
* @type Object
* @final
*/
colorBufferFloatExtension:{
get: function(){
return colorBufferFloatExt;
},
enumerable:true
},
/**
* This extension exposes the EXT_color_buffer_half_float functionality to WebGL.
* See http://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/
* @property colorBufferHalfFloatExtension
* @type Object
* @final
*/
colorBufferHalfFloatExtension:{
get: function(){
return colorBufferHalfFloatExt;
},
enumerable:true
}
});

Expand Down
9 changes: 9 additions & 0 deletions tool/extension_viewer/extension_viewer.js
Expand Up @@ -54,7 +54,16 @@ requirejs(['kick'],
return "Max color attachments: " + engine.gl.getParameter(constants.GL_MAX_COLOR_ATTACHMENTS)+"<br>"+
"Max draw buffers: "+engine.gl.getParameter(constants.GL_MAX_DRAW_BUFFERS);
}
},
colorBufferFloatExtension: {
name:"WEBGL_color_buffer_float",
link:"http://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/"
},
colorBufferHalfFloatExtension:{
name: "EXT_color_buffer_half_float",
link: "http://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/"
}

};

var data = [];
Expand Down

0 comments on commit f34e556

Please sign in to comment.