From 2e3aae42d950c01aa54d81bd15c17d6eac88bd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 27 Apr 2017 02:04:34 +0200 Subject: [PATCH] Clarified filtering and renderability of floating-point formats. * Half-floats and floats are usable in ES2 / WebGL 1 (they weren't by mistake) -- just use OES_texture_float or OES_texture_half_float. * Half-floats are linearly filterable in ES3 / WebGL 2 and OES_texture_half_float_linear makes it possible in ES2 / WebGL 1. * Floats are not linearly filterable, not even in ES3 (they were by mistake) -- one needs OES_texture_float_linear for that. * Neither floats nor half-floats are renderable in ES < 3.2 -- one needs EXT_color_buffer_half_float or EXT_color_buffer_float for that. The former is available for example on iOS, the latter is apparently only on NV cards. Both are builtin in ES 3.2, EXT_color_buffer_float depends in ES3, so half-floats are the only possible format to render to in ES2. * Rendering to floats in WebGL is slightly more complicated -- unlike with OpenGL ES 2 it's possible to render to floats in WebGL 1 using WEBGL_color_buffer_float. There's another WebGL 1 extension called EXT_color_buffer_half_float and they are both replaced with EXT_color_buffer_float in WebGL 2. And, as a cherry on top, GPH (formerly SGI) has patents on most of these, which is probably why the support for them is so spotty. --- doc/opengl-support.dox | 4 +- src/Magnum/Context.cpp | 6 +- src/Magnum/Extensions.h | 8 +- src/Magnum/PixelFormat.h | 34 ++++-- src/Magnum/RenderbufferFormat.h | 83 ++++++++++++--- src/Magnum/Sampler.h | 41 ++++--- src/Magnum/TextureFormat.h | 183 +++++++++++++++++++++++++------- 7 files changed, 277 insertions(+), 82 deletions(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 0bc699bc3..8464783c7 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -388,7 +388,6 @@ Extension | Status @extension{OES,rgb8_rgba8} | done (desktop-compatible subset) @extension{OES,texture_3D} | done @extension2{OES,texture_half_float_linear,OES_texture_float_linear} | done -@extension{OES,texture_float_linear} | done @extension2{OES,texture_half_float,OES_texture_float} | done @extension{OES,texture_float} | done @extension{OES,texture_npot} | done (nothing to do) @@ -444,6 +443,7 @@ Extension | Status @extension{OES,mapbuffer} | done @extension{OES,stencil1} | done @extension{OES,stencil4} | done +@extension{OES,texture_float_linear} | done @subsection opengl-support-webgl10 WebGL 1.0 @@ -470,7 +470,6 @@ Extension | Status @webgl_extension{OES,standard_derivatives} | done @webgl_extension{OES,vertex_array_object} | done @webgl_extension{OES,element_index_uint} | done -@webgl_extension{OES,texture_float_linear} | done @webgl_extension{OES,texture_half_float_linear} | done @webgl_extension{OES,fbo_render_mipmap} | done @webgl_extension{WEBGL,depth_texture} | done @@ -492,6 +491,7 @@ Extension | Status @webgl_extension{EXT,sRGB} | done @webgl_extension{EXT,disjoint_timer_query} | only time elapsed query @webgl_extension{EXT,color_buffer_float} | | +@webgl_extension{OES,texture_float_linear} | done @webgl_extension{WEBGL,compressed_texture_s3tc} | done @section opengl-unsupported Unsupported OpenGL features diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index c521d8d78..4da7a8d8f 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -237,6 +237,7 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,EXT,texture_filter_anisotropic), _extension(GL,EXT,disjoint_timer_query), _extension(GL,EXT,color_buffer_float), + _extension(GL,OES,texture_float_linear), _extension(GL,WEBGL,compressed_texture_s3tc)}; #ifdef MAGNUM_TARGET_GLES2 static const std::vector extensionsES300{ @@ -250,7 +251,6 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,OES,standard_derivatives), _extension(GL,OES,vertex_array_object), _extension(GL,OES,element_index_uint), - _extension(GL,OES,texture_float_linear), _extension(GL,OES,texture_half_float_linear), _extension(GL,OES,fbo_render_mipmap), _extension(GL,WEBGL,depth_texture), @@ -298,7 +298,8 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,OES,depth32), _extension(GL,OES,mapbuffer), _extension(GL,OES,stencil1), - _extension(GL,OES,stencil4)}; + _extension(GL,OES,stencil4), + _extension(GL,OES,texture_float_linear)}; #ifdef MAGNUM_TARGET_GLES2 static const std::vector extensionsES300{ _extension(GL,ANGLE,framebuffer_blit), @@ -338,7 +339,6 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,OES,rgb8_rgba8), _extension(GL,OES,texture_3D), _extension(GL,OES,texture_half_float_linear), - _extension(GL,OES,texture_float_linear), _extension(GL,OES,texture_half_float), _extension(GL,OES,texture_float), _extension(GL,OES,texture_npot), diff --git a/src/Magnum/Extensions.h b/src/Magnum/Extensions.h index eef7e989e..5b18e2938 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/Extensions.h @@ -279,7 +279,9 @@ namespace GL { _extension(GL,OES,standard_derivatives, GLES200, GLES300) // #4 _extension(GL,OES,vertex_array_object, GLES200, GLES300) // #5 _extension(GL,OES,element_index_uint, GLES200, GLES300) // #10 - _extension(GL,OES,texture_float_linear, GLES200, GLES300) // #20 + #endif + _extension(GL,OES,texture_float_linear, GLES200, None) // #20 + #ifdef MAGNUM_TARGET_GLES2 _extension(GL,OES,texture_half_float_linear, GLES200, GLES300) // #21 _extension(GL,OES,fbo_render_mipmap, GLES200, GLES300) // #28 #endif @@ -436,7 +438,9 @@ namespace GL { #ifdef MAGNUM_TARGET_GLES2 _extension(GL,OES,texture_3D, GLES200, GLES300) // #34 _extension(GL,OES,texture_half_float_linear, GLES200, GLES300) // #35 - _extension(GL,OES,texture_float_linear, GLES200, GLES300) // #35 + #endif + _extension(GL,OES,texture_float_linear, GLES200, None) // #35 + #ifdef MAGNUM_TARGET_GLES2 _extension(GL,OES,texture_half_float, GLES200, GLES300) // #36 _extension(GL,OES,texture_float, GLES200, GLES300) // #36 _extension(GL,OES,texture_npot, GLES200, GLES300) // #37 diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index 353d7d69f..f1abce9a1 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -401,11 +401,18 @@ enum class PixelType: GLenum { * Each component half float. * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @requires_gl30 Extension @extension{ARB,half_float_pixel} - * @requires_gles30 For texture data only, extension - * @extension2{OES,texture_half_float,OES_texture_float} in OpenGL - * ES 2.0. - * @requires_webgl20 For texture data only, extension - * @webgl_extension{OES,texture_half_float} in WebGL 1.0. + * @requires_gles30 Extension @extension2{OES,texture_half_float,OES_texture_float} + * to use for texture reading in OpenGL ES 2.0. + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for filtering the texture using @ref Sampler::Filter::Linear. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float} + * to use the texture as a render target. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float} to + * use for texture reading in WebGL 1.0. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for filtering the texture using @ref Sampler::Filter::Linear. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_half_float} + * to use the texture as a render target. */ #ifndef MAGNUM_TARGET_GLES2 HalfFloat = GL_HALF_FLOAT, @@ -415,10 +422,19 @@ enum class PixelType: GLenum { /** * Each component float. - * @requires_gles30 For texture data only, extension @extension{OES,texture_float} - * in OpenGL ES 2.0. - * @requires_webgl20 For texture data only, extension @webgl_extension{OES,texture_float} - * in WebGL 1.0. + * @requires_gles30 Extension @extension{OES,texture_float} to use for + * texture reading in OpenGL ES 2.0. + * @requires_gles32 Extension @extension{EXT,color_half_float} to use the + * texture as a render target. + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for filtering the texture using @ref Sampler::Filter::Linear. + * @requires_webgl20 Extension @webgl_extension{OES,texture_float} to use + * for texture reading in WebGL 1.0. + * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} + * for filtering the texture using @ref Sampler::Filter::Linear. + * @requires_webgl_extension Extension @webgl_extension{WEBGL,color_buffer_float} + * in WebGL 1.0 or @webgl_extension{EXT,color_buffer_float} in WebGL + * 2.0 to use the texture as a render target. */ Float = GL_FLOAT, diff --git a/src/Magnum/RenderbufferFormat.h b/src/Magnum/RenderbufferFormat.h index f5e569c84..1ae335d06 100644 --- a/src/Magnum/RenderbufferFormat.h +++ b/src/Magnum/RenderbufferFormat.h @@ -333,52 +333,109 @@ enum class RenderbufferFormat: GLenum { RGBA32I = GL_RGBA32I, #endif - #ifndef MAGNUM_TARGET_GLES + #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) /** * Red component, half float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float}. Use + * @ref RenderbufferFormat::R16UI or @ref RenderbufferFormat::R16I + * instead if not available. + * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component + * half-float formats can be ised as a render target in WebGL 1.0, see + * @ref RenderbufferFormat::RGBA16F for more information. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * in WebGL 2.0. Use @ref RenderbufferFormat::R16UI or + * @ref RenderbufferFormat::R16I instead if not available. */ + #ifndef MAGNUM_TARGET_GLES2 R16F = GL_R16F, + #else + R16F = GL_R16F_EXT, + #endif /** * Red and green component, each half float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float}. Use + * @ref RenderbufferFormat::RG16UI or @ref RenderbufferFormat::RG16I + * instead if not available. + * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component + * half-float formats can be ised as a render target in WebGL 1.0, see + * @ref RenderbufferFormat::RGBA16F for more information. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * in WebGL 2.0. Use @ref RenderbufferFormat::RG16UI or + * @ref RenderbufferFormat::RG16I instead if not available. */ + #ifndef MAGNUM_TARGET_GLES2 RG16F = GL_RG16F, + #else + RG16F = GL_RG16F_EXT, + #endif + #endif /** * RGBA, each component half float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float}. Use + * @ref RenderbufferFormat::RGBA16UI or @ref RenderbufferFormat::RGBA16I + * instead if not available. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_half_float} + * in WebGL 1.0, @webgl_extension{EXT,color_buffer_half_float} in + * WebGL 2.0. Use @ref RenderbufferFormat::RGBA16UI or + * @ref RenderbufferFormat::RGBA16I instead if not available. */ + #ifndef MAGNUM_TARGET_GLES2 RGBA16F = GL_RGBA16F, + #else + RGBA16F = GL_RGBA16F_EXT, + #endif + #ifndef MAGNUM_TARGET_GLES2 /** * Red component, float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0 builds. + * @requires_gles32 Extension @extension{EXT,color_buffer_float} in OpenGL + * ES 3.0. Use @ref RenderbufferFormat::R32UI or @ref RenderbufferFormat::R32I + * instead if not available. + * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component + * float formats can be ised as a render target in WebGL 1.0, see + * @ref RenderbufferFormat::RGBA32F for more information. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * in WebGL 2.0. Use @ref RenderbufferFormat::R32UI or + * @ref RenderbufferFormat::R32I instead if not available. */ R32F = GL_R32F, /** * Red and green component, each float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0 builds. + * @requires_gles32 Extension @extension{EXT,color_buffer_float} in OpenGL + * ES 3.0. Use @ref RenderbufferFormat::RG32UI or @ref RenderbufferFormat::RG32I + * instead if not available. + * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component + * float formats can be ised as a render target in WebGL 1.0, see + * @ref RenderbufferFormat::RGBA32F for more information. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * in WebGL 2.0. Use @ref RenderbufferFormat::RG32UI or + * @ref RenderbufferFormat::RG32I instead if not available. */ RG32F = GL_RG32F, + #endif + #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL) /** * RGBA, each component float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gl Only (non)normalized integral formats are available in - * OpenGL ES and WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles32 Extension @extension{EXT,color_buffer_float}. Use + * @ref RenderbufferFormat::RGBA32UI or @ref RenderbufferFormat::RGBA32I + * instead if not available. + * @requires_webgl_extension Extension @webgl_extension{WEBGL,color_buffer_float} + * in WebGL 1.0, @webgl_extension{EXT,color_buffer_float} in WebGL 2.0. + * Use @ref RenderbufferFormat::RGBA32UI or @ref RenderbufferFormat::RGBA32I + * instead if not available. */ RGBA32F = GL_RGBA32F, #endif diff --git a/src/Magnum/Sampler.h b/src/Magnum/Sampler.h index 58fe1825a..a09bd2a12 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/Sampler.h @@ -54,16 +54,20 @@ class MAGNUM_EXPORT Sampler { Nearest = GL_NEAREST, /**< Nearest neighbor filtering */ /** - * Linear interpolation filtering. - * @requires_gles30 Extension @extension{OES,texture_float_linear} / - * @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * Linear interpolation filtering. Can't be used with integer + * texture formats. + * @requires_es_extension Extension @extension{OES,texture_float_linear} * for linear interpolation of textures with - * @ref TextureFormat::HalfFloat / @ref TextureFormat::Float - * in OpenGL ES 2.0. - * @requires_webgl20 Extension @webgl_extension{OES,texture_float_linear} - * / @webgl_extension{OES,texture_half_float_linear} for - * linear interpolation of textures with @ref TextureFormat::HalfFloat - * / @ref TextureFormat::Float in WebGL 1.0. + * @ref TextureFormat::Float + * @requires_webgl_extension Extensiion @webgl_extension{OES,texture_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::Float + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::HalfFloat in OpenGL ES 2.0. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::HalfFloat in WebGL 1.0. */ Linear = GL_LINEAR }; @@ -86,15 +90,18 @@ class MAGNUM_EXPORT Sampler { * Linear interpolation of nearest mip levels. **Unavailable on * rectangle textures.** * @m_keywords{GL_NEAREST_MIPMAP_LINEAR} - * @requires_gles30 Extension @extension{OES,texture_float_linear} / - * @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::Float + * @requires_webgl_extension Extensiion @webgl_extension{OES,texture_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::Float + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for linear interpolation of textures with + * @ref TextureFormat::HalfFloat in OpenGL ES 2.0. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * for linear interpolation of textures with - * @ref TextureFormat::HalfFloat / @ref TextureFormat::Float - * in OpenGL ES 2.0. - * @requires_webgl20 Extension @webgl_extension{OES,texture_float_linear} - * / @webgl_extension{OES,texture_half_float_linear} for - * linear interpolation of textures with @ref TextureFormat::HalfFloat - * / @ref TextureFormat::Float in WebGL 1.0. + * @ref TextureFormat::HalfFloat in WebGL 1.0. */ Linear = GL_NEAREST_MIPMAP_LINEAR & ~GL_NEAREST }; diff --git a/src/Magnum/TextureFormat.h b/src/Magnum/TextureFormat.h index 0546165c2..d7bf8cd41 100644 --- a/src/Magnum/TextureFormat.h +++ b/src/Magnum/TextureFormat.h @@ -546,85 +546,196 @@ enum class TextureFormat: GLenum { /** * Red component, half float. - * @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() + * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @requires_gl30 Extension @extension{ARB,texture_rg} and @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance + * in combination with @ref PixelFormat::HalfFloat + * (@extension2{OES,texture_half_float,OES_texture_float}) in OpenGL + * ES 2.0 instead. + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear in OpenGL ES 2.0. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float} to + * use as a render target. Use @ref TextureFormat::R16UI or + * @ref TextureFormat::R16I instead if not available. + * @requires_webgl20 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance + * in combination with @ref PixelFormat::HalfFloat (@webgl_extension{OES,texture_half_float}) + * in WebGL 1.0. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for filtering using @ref Sampler::Filter::Linear in WebGL 1.0. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0; use @ref TextureFormat::R16UI + * or @ref TextureFormat::R16I instead if not available. Only three- + * and four-component half-float texture formats can be used as + * a render target in WebGL 1.0, see @ref TextureFormat::RGBA16F for + * more information. */ R16F = GL_R16F, /** * Red and green component, each half float. - * @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() + * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @requires_gl30 Extension @extension{ARB,texture_rg} and @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha + * in combination with @ref PixelFormat::HalfFloat + * (@extension2{OES,texture_half_float,OES_texture_float}) in OpenGL + * ES 2.0 instead. + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear in OpenGL ES 2.0. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float} to + * use as a render target in OpenGL ES. Use @ref TextureFormat::RG16UI + * or @ref TextureFormat::RG16I instead if not available. + * @requires_webgl20 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha + * in combination with @ref PixelFormat::HalfFloat (@webgl_extension{OES,texture_half_float}) + * in WebGL 1.0 instead. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for filtering using @ref Sampler::Filter::Linear in WebGL 1.0. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0; use @ref TextureFormat::RG16UI + * or @ref TextureFormat::RG16I instead if not available. Only three- + * and four-component half-float texture formats can be used as + * a render target in WebGL 1.0, see @ref TextureFormat::RGBA16F for + * more information. */ RG16F = GL_RG16F, /** * RGB, each component half float. - * @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() + * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RGB in combination with + * @ref PixelFormat::HalfFloat (@extension2{OES,texture_half_float,OES_texture_float}) + * in OpenGL ES 2.0 instead. + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear in OpenGL ES 2.0. + * @requires_webgl20 Use @ref TextureFormat::RGB in combination with + * @ref PixelFormat::HalfFloat (@webgl_extension{OES,texture_half_float}) + * in WebGL 1.0 instead. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for filtering using @ref Sampler::Filter::Linear in WebGL 1.0. + * @requires_gl Can't be used as a render target in OpenGL ES or WebGL 2.0. + * Use @ref TextureFormat::RGBA16F instead. Use @ref TextureFormat::RGB + * in combination with @ref PixelFormat::HalfFloat + * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 + * instead. */ RGB16F = GL_RGB16F, /** * RGBA, each component half float. - * @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() + * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RGBA in combination with + * @ref PixelFormat::HalfFloat (@extension2{OES,texture_half_float,OES_texture_float}) + * in OpenGL ES 2.0 instead. + * @requires_gles30 Extension @extension2{OES,texture_half_float_linear,OES_texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_gles32 Extension @extension{EXT,color_buffer_half_float} to + * use as a render target in OpenGL ES. Use @ref TextureFormat::RGBA16UI + * or @ref TextureFormat::RGBA16I instead if not available. + * @requires_webgl20 Use @ref TextureFormat::RGBA in combination with + * @ref PixelFormat::HalfFloat (@webgl_extension{OES,texture_half_float}) + * in WebGL 1.0 instead. + * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} + * for filtering using @ref Sampler::Filter::Linear in WebGL 1.0. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0. Use @ref TextureFormat::RGBA16UI + * or @ref TextureFormat::RGBA16I instead if not available. Use + * @ref TextureFormat::RGBA in combination with @ref PixelFormat::HalfFloat + * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 instead. */ RGBA16F = GL_RGBA16F, /** * Red component, float. * @requires_gl30 Extension @extension{ARB,texture_rg} and @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance + * in combination with @ref PixelFormat::Float (@extension{OES,texture_float}) + * in OpenGL ES 2.0 instead. + * @requires_gles32 Extension @extension{EXT,color_buffer_float} to use as + * a render target. Use @ref TextureFormat::R32UI or + * @ref TextureFormat::R32I instead if not available. + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl20 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance + * in combination with @ref PixelFormat::Float (@webgl_extension{OES,texture_float}) + * in WebGL 1.0 instead. + * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0; use @ref TextureFormat::R32UI + * or @ref TextureFormat::R32I instead if not available. Only three- + * and four-component half-float texture formats can be used as + * a render target in WebGL 1.0. See @ref TextureFormat::RGBA32F for + * more information. */ R32F = GL_R32F, /** * Red and green component, each float. * @requires_gl30 Extension @extension{ARB,texture_rg} and @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha + * in combination with @ref PixelFormat::Float (@extension{OES,texture_float}) + * in OpenGL ES 2.0 instead. + * @requires_gles32 Extension @extension{EXT,color_buffer_float} to use as + * a render target. Use @ref TextureFormat::RG32UI or + * @ref TextureFormat::RG32I instead if not available. + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl20 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha + * in combination with @ref PixelFormat::Float (@webgl_extension{OES,texture_float}) + * in WebGL 1.0 instead. + * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0; use @ref TextureFormat::RG32UI + * or @ref TextureFormat::RG32I instead if not available. Only three- + * and four-component half-float texture formats can be used as + * a render target in WebGL 1.0. See @ref TextureFormat::RGBA32F for + * more information. */ RG32F = GL_RG32F, /** * RGB, each component float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RGB in combination with + * @ref PixelFormat::Float (@extension{OES,texture_float}) in OpenGL + * ES 2.0 instead. + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl20 Use @ref TextureFormat::RGB in combination with + * @ref PixelFormat::Float (@webgl_extension{OES,texture_float}) in + * WebGL 1.0 instead. + * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_gl Can't be used as a render target in OpenGL ES or WebGL 2.0. + * Use @ref TextureFormat::RGBA32F instead. Use @ref TextureFormat::RGB + * in combination with @ref PixelFormat::Float + * (@webgl_extension{WEBGL,color_buffer_float}) in WebGL 1.0 instead. */ RGB32F = GL_RGB32F, /** * RGBA, each component float. * @requires_gl30 Extension @extension{ARB,texture_float} - * @requires_gles30 Only normalized integral formats are available in - * OpenGL ES 2.0. - * @requires_webgl20 Only normalized integral formats are available in - * WebGL 1.0. + * @requires_gles30 Use @ref TextureFormat::RGBA in combination with + * @ref PixelFormat::Float (@extension{OES,texture_float}) in OpenGL + * ES 2.0 instead. + * @requires_es_extension Extension @extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_gles32 Extension @extension{EXT,color_buffer_float} to + * use as a render target in OpenGL ES. Use @ref TextureFormat::RGBA32UI + * or @ref TextureFormat::RGBA32I instead if not available. + * @requires_webgl20 Use @ref TextureFormat::RGBA in combination with + * @ref PixelFormat::Float (@webgl_extension{OES,texture_float}) in + * WebGL 1.0 instead. + * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} + * for filtering using @ref Sampler::Filter::Linear. + * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} + * to use as a render target in WebGL 2.0. Use @ref TextureFormat::RGBA32UI + * or @ref TextureFormat::RGBA32I instead if not available. Use + * @ref TextureFormat::RGBA in combination with @ref PixelFormat::Float + * (@webgl_extension{WEBGL,color_buffer_float}) in WebGL 1.0 instead. */ RGBA32F = GL_RGBA32F, #endif