Merge branch 'master' into play

Conflicts:
	hqflt/cg/crt.cg
This commit is contained in:
Themaister 2010-12-08 00:16:37 +01:00
commit 9e2ec0586b
4 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
BUILD_OPENGL = 1
BUILD_CG = 1
BUILD_CG = 0
BUILD_FILTER = 0
BUILD_RSOUND = 1

4
gl.c
View File

@ -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);

View File

@ -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 = {

View File

@ -86,9 +86,9 @@ output main_fragment(in VERTEX_INPUT VAR, uniform sampler2D decal : TEXUNIT0, un
float2 rubyOutputSize = IN.output_size;
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 xy = barrelDistortion(texCoord.xy);
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));
@ -115,8 +115,8 @@ output main_fragment(in VERTEX_INPUT VAR, uniform sampler2D decal : TEXUNIT0, un
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);
@ -124,11 +124,11 @@ output main_fragment(in VERTEX_INPUT VAR, uniform sampler2D decal : TEXUNIT0, un
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(VAR.CT.x*rubyOutputSize.x,2.0) < 1.0)