From b18b731dcc69373efa939741a2494c539072cf12 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 14 Nov 2010 14:36:37 +0100 Subject: [PATCH 1/3] Updated shaders a bit --- hqflt/cg/2xSaI.cg | 4 ++-- hqflt/cg/crt.cg | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hqflt/cg/2xSaI.cg b/hqflt/cg/2xSaI.cg index 158adaa687..91e9ecd470 100644 --- a/hqflt/cg/2xSaI.cg +++ b/hqflt/cg/2xSaI.cg @@ -68,8 +68,8 @@ struct deltas output main_fragment (float2 tex : TEXCOORD0, uniform input IN, uniform sampler2D s_p : TEXUNIT0) { float2 texsize = IN.texture_size; - float dx = 1.0/texsize.x * 0.25; - float dy = 1.0/texsize.y * 0.25; + float dx = pow(texsize.x, -1.0) * 0.25; + float dy = pow(texsize.y, -1.0) * 0.25; float3 dt = float3(1.0, 1.0, 1.0); deltas VAR = { diff --git a/hqflt/cg/crt.cg b/hqflt/cg/crt.cg index bee618ad38..701a3de494 100644 --- a/hqflt/cg/crt.cg +++ b/hqflt/cg/crt.cg @@ -52,8 +52,8 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU float2 rubyTextureSize = IN.texture_size; float2 xy = barrelDistortion(texCoord.xy); - float2 one = 1.0/rubyTextureSize; - xy = xy + float2(0.0 , -0.5 * (phase + (1-phase) * rubyInputSize.y/rubyOutputSize.y) * one.y); + float2 one = pow(rubyTextureSize, -1.0); + xy = xy + float2(0.0 , -0.5 * (phase + (1-phase) * rubyInputSize.y * pow(rubyOutputSize.y, -1.0) * one.y)); float4 texels[8]; texels[0] = TEX2D(xy + float2(-one.x,0.0)); texels[1] = TEX2D(xy); @@ -70,8 +70,8 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU float4 col, col2; float4 coeffs = float4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x); - coeffs = (sin(PI * coeffs) * sin(PI * coeffs / 2.0)) / (coeffs * coeffs); - coeffs = coeffs / (coeffs.x+coeffs.y+coeffs.z+coeffs.w); + coeffs = (sin(PI * coeffs) * sin(PI * coeffs * 0.5)) / (coeffs * coeffs); + coeffs = coeffs * pow(coeffs.x+coeffs.y+coeffs.z+coeffs.w, -1.0); col = clamp(coeffs.x * texels[0] + coeffs.y * texels[1] + coeffs.z * texels[2] + coeffs.w * texels[3], 0.0, 1.0); col2 = clamp(coeffs.x * texels[4] + coeffs.y * texels[5] + coeffs.z * texels[6] + coeffs.w * texels[7], 0.0, 1.0); @@ -79,11 +79,11 @@ output main_fragment(float2 texCoord : TEXCOORD0, uniform sampler2D decal : TEXU col2 = pow(col2, gamma); float4 wid = 2 + 2 * pow(col, 4.0); - float4 weights = uv_ratio.y/0.3; - weights = 0.51*exp(-pow(weights*sqrt(2/wid),wid))/0.3/(0.6+0.2*wid); - wid = 2 + 4 * pow(col2,4.0); - float4 weights2 = (1.0-uv_ratio.y)/0.3; - weights2 = 0.51*exp(-pow(weights2*sqrt(2/wid),wid))/0.3/(0.6+0.2*wid); + float4 weights = uv_ratio.y * 3.333; + weights = 0.51*exp(-pow(weights*sqrt(2 * pow(wid, -1.0)),wid)) * 3.333 * pow(0.6+0.2*wid, -1.0); + wid = 2 + 4 * pow(col2, 4.0); + float4 weights2 = (1.0-uv_ratio.y) * 3.333; + weights2 = 0.51*exp(-pow(weights2*sqrt(2 * pow(wid, -1.0)),wid)) * 3.333 * pow(0.6+0.2*wid, -1.0); float4 mcol = 1.0; if ( fmod(xy.x*rubyOutputSize.x,2.0) < 1.0) From 8b9e0c401c376b8d1eb12284949176460862b155 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 19 Nov 2010 22:41:08 +0100 Subject: [PATCH 2/3] do not build cg by default *sigh* --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 65face463c..edbc2202fb 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,6 @@ BUILD_OPENGL = 1 -BUILD_CG = 1 +BUILD_CG = 0 BUILD_FILTER = 0 BUILD_RSOUND = 0 From 14c656a4194f5a9d8920acabbc2ab5b15714a4c1 Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 8 Dec 2010 00:13:57 +0100 Subject: [PATCH 3/3] Fix small issue --- gl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl.c b/gl.c index f2cdfe14d7..6024236e3b 100644 --- a/gl.c +++ b/gl.c @@ -337,8 +337,8 @@ static void* gl_init(video_info_t *video, const input_driver_t **input) glBindTexture(GL_TEXTURE_2D, gl->texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_filter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_filter);