diff options
Diffstat (limited to 'src/osd/modules/opengl')
-rw-r--r-- | src/osd/modules/opengl/gl_shader_mgr.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c | 50 |
2 files changed, 26 insertions, 26 deletions
diff --git a/src/osd/modules/opengl/gl_shader_mgr.cpp b/src/osd/modules/opengl/gl_shader_mgr.cpp index 26eb0d35ee0..de36240ab3e 100644 --- a/src/osd/modules/opengl/gl_shader_mgr.cpp +++ b/src/osd/modules/opengl/gl_shader_mgr.cpp @@ -24,7 +24,7 @@ static const char * glsl_mamebm_fsh_files [GLSL_SHADER_FEAT_INT_NUMBER] = { "/tmp/glsl_plain_rgb32_dir.fsh", // rgb32 dir plain "/tmp/glsl_bilinear_rgb32_dir.fsh", // rgb32 dir bilinear - "/tmp/glsl_bicubic_rgb32_dir.fsh", // rgb32 dir bicubic + "/tmp/glsl_bicubic_rgb32_dir.fsh", // rgb32 dir bicubic }; #else // GLSL_SOURCE_ON_DISK diff --git a/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c index 21d254e3128..dc610764098 100644 --- a/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c +++ b/src/osd/modules/opengl/shader/glsl_bilinear_rgb32_dir.fsh.c @@ -14,43 +14,43 @@ const char glsl_bilinear_rgb32_dir_fsh_src[] = "\n" "void main()\n" "{\n" -" // mix(x,y,a): x*(1-a) + y*a\n" -" //\n" -" // bilinear filtering includes 2 mix:\n" -" //\n" -" // pix1 = tex[x0][y0] * ( 1 - u_ratio ) + tex[x1][y0] * u_ratio\n" -" // pix2 = tex[x0][y1] * ( 1 - u_ratio ) + tex[x1][y1] * u_ratio\n" -" // fin = pix1 * ( 1 - v_ratio ) + pix2 * v_ratio\n" -" //\n" -" // so we can use the build in mix function for these 2 computations ;-)\n" -" //\n" -" vec2 pixel = gl_TexCoord[0].st * color_texture_pow2_sz - 0.5;\n" +" // mix(x,y,a): x*(1-a) + y*a\n" +" //\n" +" // bilinear filtering includes 2 mix:\n" +" //\n" +" // pix1 = tex[x0][y0] * ( 1 - u_ratio ) + tex[x1][y0] * u_ratio\n" +" // pix2 = tex[x0][y1] * ( 1 - u_ratio ) + tex[x1][y1] * u_ratio\n" +" // fin = pix1 * ( 1 - v_ratio ) + pix2 * v_ratio\n" +" //\n" +" // so we can use the build in mix function for these 2 computations ;-)\n" +" //\n" +" vec2 pixel = gl_TexCoord[0].st * color_texture_pow2_sz - 0.5;\n" " vec2 uv_ratio = fract(pixel);\n" " vec2 one = 1.0 / color_texture_pow2_sz;\n" " vec2 xy = (floor(pixel) + 0.5) * one;\n" " \n" "#if 1\n" -" vec4 col, col2;\n" +" vec4 col, col2;\n" "\n" -" col = mix( TEX2D(xy ), TEX2D(xy + vec2(one.x, 0.0)), uv_ratio.x);\n" -" col2 = mix( TEX2D(xy + vec2(0.0, one.y)), TEX2D(xy + one ), uv_ratio.x);\n" -" col = mix ( col, col2, uv_ratio.y );\n" +" col = mix( TEX2D(xy ), TEX2D(xy + vec2(one.x, 0.0)), uv_ratio.x);\n" +" col2 = mix( TEX2D(xy + vec2(0.0, one.y)), TEX2D(xy + one ), uv_ratio.x);\n" +" col = mix ( col, col2, uv_ratio.y );\n" "#else\n" -" // doesn't work on MacOSX GLSL engine ..\n" -" //\n" -" vec4 col = mix ( mix( TEX2D(xy ), TEX2D(xy + vec2(one.x, 0.0)), uv_ratio.x),\n" -" mix( TEX2D(xy + vec2(0.0, one.y)), TEX2D(xy + one ), uv_ratio.x), uv_ratio.y );\n" +" // doesn't work on MacOSX GLSL engine ..\n" +" //\n" +" vec4 col = mix ( mix( TEX2D(xy ), TEX2D(xy + vec2(one.x, 0.0)), uv_ratio.x),\n" +" mix( TEX2D(xy + vec2(0.0, one.y)), TEX2D(xy + one ), uv_ratio.x), uv_ratio.y );\n" "#endif\n" "\n" -" // gamma, contrast, brightness equation from: rendutil.h / apply_brightness_contrast_gamma_fp\n" +" // gamma, contrast, brightness equation from: rendutil.h / apply_brightness_contrast_gamma_fp\n" "\n" "#ifdef DO_GAMMA\n" -" // gamma/contrast/brightness\n" -" vec4 gamma = vec4(1.0 / vid_attributes.r, 1.0 / vid_attributes.r, 1.0 / vid_attributes.r, 0.0);\n" -" gl_FragColor = ( pow ( col, gamma ) * vid_attributes.g) + vid_attributes.b - 1.0;\n" +" // gamma/contrast/brightness\n" +" vec4 gamma = vec4(1.0 / vid_attributes.r, 1.0 / vid_attributes.r, 1.0 / vid_attributes.r, 0.0);\n" +" gl_FragColor = ( pow ( col, gamma ) * vid_attributes.g) + vid_attributes.b - 1.0;\n" "#else\n" -" // contrast/brightness\n" -" gl_FragColor = ( col * vid_attributes.g) + vid_attributes.b - 1.0;\n" +" // contrast/brightness\n" +" gl_FragColor = ( col * vid_attributes.g) + vid_attributes.b - 1.0;\n" "#endif\n" "}\n" "\n" |