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=refs%2Fheads%2Fuis%2Fshader;p=xonotic%2Fdarkplaces.git Use proper built-in function for getting fraction part --- diff --git a/shader_glsl.h b/shader_glsl.h index 9d084f6f..acb535ff 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -92,7 +92,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",