16 minutes ago, GuyWithBeard said:EDIT: For the record, Matt77hias, edited his previous posts to provide more info. Thanks dude!
My apologies, but it is a habit of continuously submitting, rereading and editing.
16 minutes ago, GuyWithBeard said:EDIT: For the record, Matt77hias, edited his previous posts to provide more info. Thanks dude!
My apologies, but it is a habit of continuously submitting, rereading and editing.
🧙
No need to apologize, this is very helpful.
Some of my confusion came from the fact that I tried to do the same sanity check in Unity, by setting the project to use linear color space and clearing the screen to [128,128,128,1] and it actually comes out as 128 when color picked in GIMP, while my render window is cleared to 186. Although I realize I have no idea what Unity is doing behind the scenes so this probably is not helpful at all.
Anyway, I realized that I have been converting my textures incorrectly to sRGB which probably explains why they are showing up brighter than they should. I'll fix that and output one of them on screen and see how they look...
Well, I managed to get the textures to look correct. I incorrectly assumed that texconv (of DX SDK fame) would be able to detect if an image was already in sRGB format or not. Turns out my images lacked the necessary metadata, so now my texture converter assumes a texture is in sRGB if it is set to output into sRGB, and that took care of the overly bright textures.
11 hours ago, GuyWithBeard said:I incorrectly assumed that texconv (of DX SDK fame) would be able to detect if an image was already in sRGB format or not.
I use texconv as well. You need to manually specify whether the input and/or output represents sRGB:
-srgb, -srgbi, or -srgbo: Use sRGB if both the input and output data are in the sRGB color format (ie. gamma ~2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB.
But sometimes it is really trial and error. DirectXTex even has a flag forceSRGB for loading .dds files which do not have an explicit sRGB format but should be treated as if the raw data represents sRGB values. So even the .dds format which explicitly encodes the format, can be misused. Nothing is certain anymore.
🧙
Yep. I missed that exact flag. However, texconv seems to do linear-to-SRGB conversion even if you leave it out as long as you specify an SRGB format as output format. So, what I assume happened was that my input texture, already in SRGB, was treated as linear and was converted to SRGB a second time. This caused the texture to come out very bright.