From: Mikko Rasa Date: Tue, 4 Jun 2019 07:23:39 +0000 (+0300) Subject: Do not use the srgb flag for textures that explicitly define storage X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=8ed377139d48a6fc39eeed9f3494bbe41aed4107;hp=abb4e50bdbb6d62d7e6ee249d52353ccf22762a4 Do not use the srgb flag for textures that explicitly define storage Presumably the texture author knows which colorspace the texture uses. In particular this made it impossible to load non-color textures such as normal maps which require a linear colorspace if the srgb flag was set in the containing resource collection. --- diff --git a/source/texture1d.cpp b/source/texture1d.cpp index 7466a9ef..e746409b 100644 --- a/source/texture1d.cpp +++ b/source/texture1d.cpp @@ -160,8 +160,6 @@ void Texture1D::Loader::raw_data(const string &data) void Texture1D::Loader::storage(PixelFormat fmt, unsigned w) { - if(srgb) - fmt = get_srgb_pixelformat(fmt); obj.storage(fmt, w); } diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 45c2e665..806e4a17 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -218,8 +218,6 @@ void Texture2D::Loader::raw_data(const string &data) void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h) { - if(srgb) - fmt = get_srgb_pixelformat(fmt); obj.storage(fmt, w, h); } diff --git a/source/texture3d.cpp b/source/texture3d.cpp index ed5619cb..7c4b0446 100644 --- a/source/texture3d.cpp +++ b/source/texture3d.cpp @@ -256,8 +256,6 @@ void Texture3D::Loader::raw_data(const string &data) void Texture3D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned d) { - if(srgb) - fmt = get_srgb_pixelformat(fmt); obj.storage(fmt, w, h, d); } diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 03e65167..83063241 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -285,8 +285,6 @@ void TextureCube::Loader::raw_data(TextureCubeFace face, const string &data) void TextureCube::Loader::storage(PixelFormat fmt, unsigned s) { - if(srgb) - fmt = get_srgb_pixelformat(fmt); obj.storage(fmt, s); }