Skip to content

Commit b05f0b3

Browse files
authored
Fix sRGB exponent in Metal rendering (#2846)
This tiny change should 'fix' the sRGB encoding used on the metal backend. I noticed this while using the MaterialXViewer in a CI setup when generating images where no single pixel matched against reference values (not even the background color :D)
1 parent 1cd6459 commit b05f0b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/MaterialXRenderMsl/MetalState.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
" for(int i = 0; i < 3; ++i) \n"
8383
" color_srgb[i] = (color_linear[i] < 0.0031308) ? \n"
8484
" (12.92 * color_linear[i]) : \n"
85-
" (1.055 * pow(color_linear[i], 1.0h / 2.2h) - 0.055); \n"
85+
" (1.055 * pow(color_linear[i], 1.0h / 2.4h) - 0.055); \n"
8686
" color_srgb[3] = color_linear[3]; \n"
8787
" return color_srgb; \n"
8888
"} \n"
@@ -146,7 +146,7 @@
146146
" for(int i = 0; i < 3; ++i) \n"
147147
" color_srgb[i] = (color_linear[i] < 0.0031308) ? \n"
148148
" (12.92 * color_linear[i]) : \n"
149-
" (1.055 * pow(color_linear[i], 1.0h / 2.2h) - 0.055);\n"
149+
" (1.055 * pow(color_linear[i], 1.0h / 2.4h) - 0.055);\n"
150150
" color_srgb[3] = color_linear[3]; \n"
151151
" return color_srgb; \n"
152152
"} \n"

0 commit comments

Comments
 (0)