Was browsing the extension registry looking for something else and found
this instead. It used to be ES catching up with desktop, now it's the
other way around.
It was mistakenly thought to be replaced by the EXT_color_buffer_float
(which replaces WEBGL_color_buffer_float and in addition lists both 16-
and 32-bit float variants). But since there are still those stupid
patents for rendering to 32-bit float attachments, certain hardware
supports only rendering to 16-bit and not 32-bit, so the "superset"
extension isn't enough to be able to discover which hardware can
render to half-floats.
Also updated (hopefully all) docs to list this extension as being an
option on WebGL 2 as well.
Doxygen 1.8.17 *finally* fixes enum value linking and so linking to
Enum::Value via TotallyArbitraryString::Value no longer works. That
uncovered a ton of documentation errors.
A welcome improvement, for once.
Should make new things more discoverable, avoid confusion when a
documented API isn't there and reduce the need for maintaining multiple
separate versions of the docs.
GL has an extension, but only for ES, not on desktop. Vulkan has
nothing yet (due to there being just ARM that implements it, no other
vendor), except those being listed in a KTX format specification.
Those are now also available under WebGL 1/2 and OpenGL ES 3.O (strangely
not OpenGL ES 2.0) under EXT_texture_compression_{rgtc,bptc}. The GL names
are extra weird-ass now that all other APIs use the BC names.
Deprecated for 2018.04, it's been almost a year since. Whoever is using
Magnum regularly updated already, and who not can always upgrade
gradually (2018.02, 2018.04, 2018.10, 2019.01 etc.).
The Sampler class was split into GL::Sampler (which is now mostly just a
placeholder for implementing OpenGL sampler objects), pairs of generic /
GL-specific SamplerFormat / GL::SamplerFormat, SamplerMipmap /
GL::SamplerMipmap, SamplerWrapping / GL::SamplerWrapping enums and the
GL-specific GL::SamplerCompareMode, GL::SamplerCompareFunction,
GL::SamplerDepthStencilMode enums.
The old Sampler class is marked as deprecated and aliases its enum to
the generic enums (or to the GL-specific ones in case the generic
versions are not available).
At the moment just the GL library itself w/o the tests, and without
backwards compatibility aliases. The following types were left in the
root namespace, despite being in the GL/ directory, as they will get
moved back soon:
* Image, CompressedImage and their dimensional typedefs
* ImageView, CompressedImageView and their dimensional typedefs
* PixelStorage
Not PixelFormat etc., that one will stay in the GL namespace and a
completely new PixelFormat enum will be provided in the root namespace.
Minimal updates (just the include guards) so Git is hopefully able to
detect the rename and track the history properly.
Everything except Magnum::GL doesn't compile now.
* 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.
Since 98a676ef65, on ES2 and WebGL1 the
Texture::setStorage() emulation passes the pixel format to both <format>
and <internalFormat> of glTexImage() APIs. On desktop the go-to way to
create a sRGB texture is by passing GL_SRGB to <internalFormat> and
GL_RGB to <format>, but here GL_RGB was passed to both and thus the
information about sRGB was lost.
With the new PixelFormat::SRGB and PixelFormat::SRGBAlpha enums that
are present only on ES2/WebGL1 this case is fixed -- sRGB texture format
will get translated to sRGB pixel format and that used for both
<format> and <internalFormat>.
Another case is when EXT_texture_storage is available -- passing unsized
GL_SRGB_EXT or GL_SRGB_ALPHA_EXT to glTexStorageEXT() is an error and
there's apparently no mention of this in any extension, making it
impossible to create sRGB textures using EXT_texture_storage. I bit the
bullet and tried passing the (numerical value of) GL_SRGB8 and
GL_SRGB8_ALPHA8 to it. At least on my NV it worked, so I enabled these
two in TextureFormat for ES2. No EXT_texture_storage is on WebGL1, so
they are only on ES2.
These two sized TextureFormat::SRGB8 and TextureFormat::SRGB8Alpha8
formats are translated to GL_SRGB and GL_SRGB_ALPHA and so using them
unconditionally for all platforms (except WebGL1) "just works".
Followup to previous commit -- links to opengl.org are now redirected to
khronos.org and the extension links have the same format for both GL and
GLES. That allows me to remove some of the Doxygen aliases and use just
a single set of the functions for both GL and GLES.