From 7cbb9c1c33dae0ecdc425e88be9b1cc7fa594391 Mon Sep 17 00:00:00 2001 From: Jeff Gilbert Date: Fri, 25 Jan 2019 16:54:12 -0800 Subject: [PATCH] Add Texture.canUse[Half]FloatingPointRTT(). --- src/texture.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/texture.js b/src/texture.js index 40b76fd..65c9b2e 100644 --- a/src/texture.js +++ b/src/texture.js @@ -207,6 +207,13 @@ Texture.canUseFloatingPointLinearFiltering = function() { return !!gl.getExtension('OES_texture_float_linear'); }; +// ### GL.Texture.canUseFloatingPointRTT() +// +// Returns false if float32 textures can't be rendered to. +Texture.canUseFloatingPointRTT = function() { + return !!gl.getExtension('WEBGL_color_buffer_float'); +}; + // ### GL.Texture.canUseFloatingPointTextures() // // Returns false if `gl.HALF_FLOAT_OES` is not supported as a texture type. @@ -223,3 +230,10 @@ Texture.canUseHalfFloatingPointTextures = function() { Texture.canUseHalfFloatingPointLinearFiltering = function() { return !!gl.getExtension('OES_texture_half_float_linear'); }; + +// ### GL.Texture.canUseHalfFloatingPointRTT() +// +// Returns false if float16 textures can't be rendered to. +Texture.canUseHalfFloatingPointRTT = function() { + return !!gl.getExtension('EXT_color_buffer_half_float'); +};