From 232a4cd791ff1895acd3e08b83c054f65cb5838c Mon Sep 17 00:00:00 2001 From: Kojiro Futamura Date: Mon, 7 Oct 2024 15:29:20 +0900 Subject: [PATCH] fix: Add support for sRGBTransferOETF to fix the runtime error `'LinearTosRGB' : no matching overloaded function found` (#380) --- src/shaders/GammaCorrectionShader.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shaders/GammaCorrectionShader.ts b/src/shaders/GammaCorrectionShader.ts index 4e194ea9..00f0425d 100644 --- a/src/shaders/GammaCorrectionShader.ts +++ b/src/shaders/GammaCorrectionShader.ts @@ -37,7 +37,11 @@ export const GammaCorrectionShader: IGammaCorrectionShader = { ' vec4 tex = texture2D( tDiffuse, vUv );', - ' gl_FragColor = LinearTosRGB( tex );', + ' #ifdef LinearTosRGB', + ' gl_FragColor = LinearTosRGB( tex );', + ' #else', + ' gl_FragColor = sRGBTransferOETF( tex );', + ' #endif', '}', ].join('\n'),