"{\n"
" vec3 adir = abs(dir);\n"
" float m = max(max(adir.x, adir.y), adir.z);\n"
-" vec2 mparams = ShadowMap_Parameters.xy / m;\n"
" vec4 proj = dp_textureCube(Texture_CubeProjection, dir);\n"
"#ifdef USEDEPTHRGB\n"
-" return vec3(mix(dir.xy, dir.zz, proj.xy) * mparams.x + proj.zw * ShadowMap_Parameters.z, m + 64 * ShadowMap_Parameters.w);\n"
+" return vec3(mix(dir.xy, dir.zz, proj.xy) * (ShadowMap_Parameters.x / m) + proj.zw * ShadowMap_Parameters.z, m + 64.0 * ShadowMap_Parameters.w);\n"
"#else\n"
+" vec2 mparams = ShadowMap_Parameters.xy / m;\n"
" return vec3(mix(dir.xy, dir.zz, proj.xy) * mparams.x + proj.zw * ShadowMap_Parameters.z, mparams.y + ShadowMap_Parameters.w);\n"
"#endif\n"
"}\n"
" if (adir.x > adir.y) { m = adir.x; proj = vec4(dir.zyx, 0.5); } else { m = adir.y; proj = vec4(dir.xzy, 1.5); }\n"
" if (adir.z > m) { m = adir.z; proj = vec4(dir, 2.5); }\n"
"#ifdef USEDEPTHRGB\n"
-" return vec3(proj.xy * ShadowMap_Parameters.x / m + vec2(0.5,0.5) + vec2(proj.z < 0.0 ? 1.5 : 0.5, proj.w) * ShadowMap_Parameters.z, m + 64 * ShadowMap_Parameters.w);\n"
+" return vec3(proj.xy * (ShadowMap_Parameters.x / m) + vec2(0.5,0.5) + vec2(proj.z < 0.0 ? 1.5 : 0.5, proj.w) * ShadowMap_Parameters.z, m + 64.0 * ShadowMap_Parameters.w);\n"
"#else\n"
" vec2 mparams = ShadowMap_Parameters.xy / m;\n"
" return vec3(proj.xy * mparams.x + vec2(proj.z < 0.0 ? 1.5 : 0.5, proj.w) * ShadowMap_Parameters.z, mparams.y + ShadowMap_Parameters.w);\n"