From: uis Date: Thu, 18 Jan 2024 18:17:43 +0000 (+0300) Subject: Use proper built-in function for getting fraction part X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7680c9733d30e36bb0561664582d938ae90ea7fa;p=xonotic%2Fdarkplaces.git Use proper built-in function for getting fraction part --- diff --git a/shader_glsl.h b/shader_glsl.h index 112a91cd..ab2195dc 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -91,7 +91,7 @@ "#ifdef USEDEPTHRGB\n", " // for 565 RGB we'd need to use different multipliers\n", "#define decodedepthmacro(d) dot((d).rgb, vec3(1.0, 255.0 / 65536.0, 255.0 / 16777215.0))\n", -"#define encodedepthmacro(d) (vec4(d, d*256.0, d*65536.0, 0.0) - floor(vec4(d, d*256.0, d*65536.0, 0.0)))\n", +"#define encodedepthmacro(d) fract(vec4(d, d*256.0, d*65536.0, 0.0))\n", "#endif\n", "\n", "#ifdef VERTEX_SHADER\n",