Vulkan screenshots are much brighter

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Vulkan screenshots are much brighter

Re: Vulkan screenshots are much brighter

by dpJudas » Mon May 20, 2019 4:43 am

I pushed a fix so it applies the present shader to the screenshot on vulkan as well.

About the dithering, we could always turn it off for screenshots if it turns out problematic. I don't know if there should be a threshold size for that or not.

Re: Vulkan screenshots are much brighter

by Graf Zahl » Mon May 20, 2019 4:20 am

I'd expect an image with all effects applied in the original size before scaling to the screen. The main question here is how the dithering gets applied so it doesn't get exaggerated for the screenshot.

Re: Vulkan screenshots are much brighter

by _mental_ » Mon May 20, 2019 4:15 am

I'm expecting to get a screenshot which is exactly the same as a picture on the screen, i.e. with all necessary adjustments applied.
As far as I know, software renderers work like this. OpenGL does the same as well.

Re: Vulkan screenshots are much brighter

by dpJudas » Mon May 20, 2019 4:02 am

Doom itself has always operated in sRGB space (approx 2.2 gamma). Before postprocess was added the Gamma CVAR would be applied by hardware and thus not applied to the screenshot. I'm not sure what the gamma multiplier was set to back then. It doesn't make much sense to me to try apply the Gamma CVAR as it still will not show exactly what the user is seeing as the brightness and contrast CVARs are not included. Maybe it did anyway, I can't remember.

Because early versions of postprocess also had to support OpenGL 2 where postprocess would be completely disabled, the OpenGL backend has always created the screenshot by reading directly from the back buffer. It does this by pretending it is a completely normal render to screen, including running the Present shader and creating black borders and scaling. If the game is running at 640x480 but the monitor is 1920x1080, then its reading a 1920x1080 image. That is why you see the OpenGL backend attempt to scale the image back down to 640x480. This also means the gamma, brightness and contrast CVARs will have been applied.

The Vulkan backend does it differently. It reads the image directly from postprocess - the original 640x480 image before present. Since this is before gamma, bright and contrast those will not have been applied.

So the answer to your question comes down to what people expect from a screenshot. Should it be the raw original image, or the gamma adjusted one? Vulkan does the first, OpenGL the second. In any case, simply applying the Gamma CVAR won't be enough since that doesn't include brightness, contrast and dithering.

Re: Vulkan screenshots are much brighter

by _mental_ » Mon May 20, 2019 2:56 am

While that multiplier was redundant, its removal revealed the real issue with screenshots in Vulkan backend. Gamma is not applied to screenshots at all.
It's enough to assign a value of Gamma CVAR instead of 1.0 at here to fix this. Although, it's a different from what OpenGL backend does. So, is this solution correct?

Re: Vulkan screenshots are much brighter

by Nash » Fri May 10, 2019 10:12 am

Can confirm that fix works, thanks for the fast response! :)

Re: Vulkan screenshots are much brighter

by dpJudas » Fri May 10, 2019 10:02 am

Pushed a fix for this. At least what I think is the source of the problem.

Re: Vulkan screenshots are much brighter

by Nash » Fri May 10, 2019 9:41 am

No, the HDR feature was off all along.

Re: Vulkan screenshots are much brighter

by Rachael » Fri May 10, 2019 9:38 am

Do you have vk_hdr enabled? Try disabling that. (That doesn't resolve this issue though, it's just diagnosing it)

Vulkan screenshots are much brighter

by Nash » Fri May 10, 2019 9:17 am

When taking a screenshot with the Vulkan renderer, it seems the gamma is blown up significantly compared to OpenGL.

With OpenGL, the image result is 1:1 with the in-game rendering.

Top