diff options
author | FĂ©lix Poisot <felix@lhfblc.fr> | 2024-01-23 19:54:22 +0000 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-01-26 13:50:55 +0000 |
commit | 5ae8ce807abbf6eab1113a36e190df50ffc2f9c1 (patch) | |
tree | 9c9051b83b63c6664b874cf6ac54215a0871f471 /render/vulkan/shaders | |
parent | d1b39b58432c471c16e09103fd2c7850e3c41950 (diff) |
render/vulkan: correct sRBG gamma expansion in shader
Diffstat (limited to 'render/vulkan/shaders')
-rw-r--r-- | render/vulkan/shaders/texture.frag | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/render/vulkan/shaders/texture.frag b/render/vulkan/shaders/texture.frag index eab2c2d1..6f2f347d 100644 --- a/render/vulkan/shaders/texture.frag +++ b/render/vulkan/shaders/texture.frag @@ -16,7 +16,9 @@ layout (constant_id = 0) const int TEXTURE_TRANSFORM = 0; #define TEXTURE_TRANSFORM_SRGB 1 float srgb_channel_to_linear(float x) { - return max(x / 12.92, pow((x + 0.055) / 1.055, 2.4)); + return mix(x / 12.92, + pow((x + 0.055) / 1.055, 2.4), + x > 0.04045); } vec4 srgb_color_to_linear(vec4 color) { |