Skip to content

Commit 366c736

Browse files
committed
cameraEffects: make sRGB conversion work in older GLSL
1 parent 569e784 commit 366c736

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/engine/renderer/glsl_source/cameraEffects_fp.glsl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ void convertToSRGB(inout vec3 color) {
4141
vec3 low = vec3(12.92f) * color;
4242
vec3 high = vec3(1.055f) * pow(color, vec3(1.0f / 2.4f)) - vec3(0.055f);
4343

44-
color = mix(high, low, cutoff);
44+
#if __VERSION__ > 120
45+
color = mix(high, low, cutoff);
46+
#else
47+
color = mix(high, low, vec3(cutoff));
48+
#endif
4549
#else
4650
float inverse = 0.4545454f; // 1 / 2.2
4751
color = pow(color, vec3(inverse));

0 commit comments

Comments
 (0)