From 8ed377139d48a6fc39eeed9f3494bbe41aed4107 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 4 Jun 2019 10:23:39 +0300 Subject: [PATCH] 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. --- source/texture1d.cpp | 2 -- source/texture2d.cpp | 2 -- source/texture3d.cpp | 2 -- source/texturecube.cpp | 2 -- 4 files changed, 8 deletions(-) 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); } -- 2.43.0