diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_SpecialShadersFactory.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_SpecialShadersFactory.cpp index 802277dc..23589683 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_SpecialShadersFactory.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_SpecialShadersFactory.cpp @@ -368,12 +368,12 @@ namespace glsl { " \n" "mediump vec2 norm2denorm(sampler2D tex, mediump vec2 uv) \n" "{ \n" - " return uv * get_texture_size(tex) - 0.5f; \n" + " return uv * vec2(get_texture_size(tex)) - 0.5; \n" "} \n" " \n" "mediump vec2 denorm2norm(sampler2D tex, mediump vec2 denorm_uv) \n" "{ \n" - " return (denorm_uv + 0.5f) / get_texture_size(tex); \n" + " return (denorm_uv + 0.5) / vec2(get_texture_size(tex)); \n" "} \n" " \n" "mediump vec4 hybridFilter(sampler2D tex, mediump vec2 uv) \n" @@ -398,21 +398,21 @@ namespace glsl { " \n" " // Here, fwidth() is used to estimte how much denorm_uv changes per fragment.\n" " // But we divide it by 2, since fwidth() is adding abs(dx) + abs(dy). \n" - " mediump vec2 fragment_size = fwidth(denorm_uv) / 2.0f; \n" + " mediump vec2 fragment_size = fwidth(denorm_uv) / 2.0; \n" " \n" " // Only do this if fragment is smaller than 1 texel. \n" - " if (fragment_size.s < 1.0f) { \n" + " if (fragment_size.s < 1.0) { \n" " // don't make the transition more than one fragment (+/- 0.5 fragment) \n" - " float radius = min(fragment_size.s, 0.5f); \n" - " ratio.s = smoothstep(0.5f - radius, \n" - " 0.5f + radius, \n" + " mediump float radius = min(fragment_size.s, 0.5); \n" + " ratio.s = smoothstep(0.5 - radius, \n" + " 0.5 + radius, \n" " ratio.s); \n" " } \n" - " if (fragment_size.t < 1.0f) { \n" + " if (fragment_size.t < 1.0) { \n" " // don't make the transition more than one fragment (+/- 0.5 fragment) \n" - " float radius = min(fragment_size.t, 0.5f); \n" - " ratio.t = smoothstep(0.5f - radius, \n" - " 0.5f + radius, \n" + " mediump float radius = min(fragment_size.t, 0.5); \n" + " ratio.t = smoothstep(0.5 - radius, \n" + " 0.5 + radius, \n" " ratio.t); \n" " } \n" " \n"