How the shaders were posted (chronological).
11.9.2005:
// BQ2X shader
// by guest(r)
uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
uniform sampler2D OGL2Texture;
varying float y;
void main()
{
vec2 d1 = vec2( OGL2Param.x,y);
vec2 d2 = vec2(-OGL2Param.x,y);
vec2 c0 = gl_TexCoord[0].xy - d1;
vec2 c1 = gl_TexCoord[0].xy - d2;
vec2 c2 = gl_TexCoord[0].xy + d2;
vec2 c3 = gl_TexCoord[0].xy + d1;
vec3 c00 = texture2D(OGL2Texture, c0).xyz;
vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
vec3 c20 = texture2D(OGL2Texture, c1).xyz;
vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
vec3 c02 = texture2D(OGL2Texture, c2).xyz;
vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
vec3 c22 = texture2D(OGL2Texture, c3).xyz;
vec3 dottie = vec3(1.0,1.0,1.0);
vec3 L = (c00+c01+c02)/3.0;
vec3 R = (c20+c21+c22)/3.0;
vec3 U = (c00+c10+c20)/3.0;
vec3 D = (c02+c12+c22)/3.0;
float wl = dot(abs(L-c11),dottie);
float wr = dot(abs(R-c11),dottie);
float wu = dot(abs(U-c11),dottie);
float wd = dot(abs(D-c11),dottie);
gl_FragColor.xyz = (wr*L+wl*R+wd*U+wu*D)/(wl+wr+wu+wd);
}
The remains of the thread the shader was posted in:
Experimental 2x GLSL shader - Pete`s Messageboard Forum
It looked nice with buggy catalyst 5.7.
Nowdays it produces black texels on zero-difference texel surroundings.
Anyhow...on 11.9.2005 i started some research to continue the promising SuperSal and the potentialy good SuperScaler...
-------------------------------------------------------------------------
ShadX Last Shader: (posted by ShadX)
uniform sampler2D OGL2Texture;
uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
void main()
{
vec4 offsety;
offsety=vec4(0.0,OGL2Param.y,0.0,0.0);
vec4 texel[9];
texel[0] = texture2DProj(OGL2Texture,gl_TexCoord[0]);
texel[1] = texture2DProj(OGL2Texture,gl_TexCoord[1]);
texel[2] = texture2DProj(OGL2Texture,gl_TexCoord[2]);
texel[3] = texture2DProj(OGL2Texture,gl_TexCoord[3]);
texel[4] = texture2DProj(OGL2Texture,gl_TexCoord[4]);
texel[5] = texture2DProj(OGL2Texture,gl_TexCoord[1] + offsety);
texel[6] = texture2DProj(OGL2Texture,gl_TexCoord[2] - offsety);
texel[7] = texture2DProj(OGL2Texture,gl_TexCoord[1] - offsety);
texel[8] = texture2DProj(OGL2Texture,gl_TexCoord[2] + offsety);
float diff[4];
diff[0] = dot(texel[1] - texel[2],texel[1] - texel[2]);
diff[1] = dot(texel[3] - texel[4],texel[3] - texel[4]);
diff[2] = dot(texel[5] - texel[6],texel[5] - texel[6]);
diff[3] = dot(texel[7] - texel[8],texel[7] - texel[8]);
float min;
min = min(diff[0],diff[1]);
min = min( min,diff[2]);
min = min( min,diff[3]);
if (min == diff[0])
gl_FragColor = (texel[0]+texel[1]+texel[2])/3.0;
else
if (min == diff[1])
gl_FragColor = (texel[0]+texel[3]+texel[4])/3.0;
else
if (min == diff[2])
gl_FragColor = (texel[0]+texel[5]+texel[6])/3.0;
else
/* if (min == diff[3]) */
gl_FragColor = (texel[0]+texel[7]+texel[8])/3.0;
}
2xGLSL shader:
// 2xGLSL shader 2.0
// by guest(r)
uniform sampler2D OGL2Texture;
uniform vec4 OGL2Param;
varying vec2 dg2;
void main()
{
vec2 c1 = gl_TexCoord[0].xy - dg2;
vec2 c2 = gl_TexCoord[0].xy + dg2;
vec3 c00 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
vec3 c20 = texture2D(OGL2Texture, c1).xyz;
vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz;
vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
vec3 c02 = texture2D(OGL2Texture, c2).xyz;
vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
vec3 c22 = texture2D(OGL2Texture, gl_TexCoord[6].xy).xyz;
vec3 dottie = vec3(1.0,1.0,1.0);
float d1=dot(abs(c00-c22),dottie);
float d2=dot(abs(c02-c20),dottie);
float hr=dot(abs(c01-c21),dottie);
float vt=dot(abs(c10-c12),dottie);
float d = abs(d1-d2);
float r = abs(hr-vt);
float w1 = step(d1,d2)*d;
float w2 = step(d2,d1)*d;
float w3 = step(hr,vt)*r;
float w4 = step(vt,hr)*r;
float ww = w1+w2+w3+w4;
float wx = ww+OGL2Param.x;
gl_FragColor.xyz = (w1*(c00+c22)+w2*(c20+c02)+w3*(c01+c21)+w4*(c10+c1 2)+wx*c11)/(2.0*ww+wx);
}
ShadX-Maruke new: (posted by ShadX)
uniform sampler2D OGL2Texture;
uniform vec4 OGL2Size;
void main(){
vec4 h;
vec3 c0,c1,c2,c3,c4,c5,c6,c7,c8;
c4 = texture2D(OGL2Texture,gl_TexCoord[0].xy).rgb;
c0 = texture2D(OGL2Texture,gl_TexCoord[0].zw).rgb;
c6 = texture2D(OGL2Texture,gl_TexCoord[1].xy).rgb;
c1 = texture2D(OGL2Texture,gl_TexCoord[2].xy).rgb;
c7 = texture2D(OGL2Texture,gl_TexCoord[3].xy).rgb;
c3 = texture2D(OGL2Texture,gl_TexCoord[4].xy).rgb;
c5 = texture2D(OGL2Texture,gl_TexCoord[5].xy).rgb;
c2 = texture2D(OGL2Texture,gl_TexCoord[6].xy).rgb;
c8 = texture2D(OGL2Texture,gl_TexCoord[7].xy).rgb;
h=vec4(dot(c1-c2,c1-c2),dot(c3-c4,c3-c4),dot(c5-c6,c5-c6),dot(c7-c8,c7-c8));
h=step(h,vec4(min(min(h.x,h.y),min(h.z,h.w))));
gl_FragColor.rgb=(c0+((c1+c2)*h.x+(c3+c4)*h.y+(c5+ c6)*h.z+(c7+c8)*h.w)/dot(h,h))*0.333;
}
I'm beginning to understand where the misunderstandings might root.
I corrected my shaders.
regards, guest.r
Last edited by guest.r; April 24th, 2007 at 09:29..