Next Generation Emulation banner

1 - 2 of 2 Posts

·
Registered
Joined
·
65 Posts
Discussion Starter #1
Whoaaa, nakonets-to! Shortly, this CRT shaders is shit, 'ultra aa999' is shit to). Its no problem to set max resolution and blur picture. Magic? There is not only Natural shader, its comfort levels! As for me it's 10-236. Everybody can patch favorite shader to set new value. Or put game on pausa and change shader variables using notepad. I gave Natural shader some power and as result





Code:
//patched by Danila Zabiaka - white black noise
#define white 236.0
#define black 10.0
#define noise 10.0
#define offset -25.0
float pseudoNoise(vec2 co)
{
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453)*fract(sin(dot(co.xy ,vec2(12.9898,78.233)*2.0)) * 43758.5453); //pseudo random number generator
}

uniform sampler2D OGL2Texture;

const vec3 RGBtoY = vec3(0.299, 0.587, 0.114);
const vec3 RGBtoI = vec3(0.596,-0.275,-0.321);
const vec3 RGBtoQ = vec3(0.212,-0.523, 0.311);
const vec3 YIQtoR = vec3(1.0, 0.95568806036115671171, 0.61985809445637075388);
const vec3 YIQtoG = vec3(1.0,-0.27158179694405859326,-0.64687381613840131330);
const vec3 YIQtoB = vec3(1.0,-1.10817732668266195230, 1.70506455991918171490);

void main()
{
    vec3 c0, c1;

    c0 = (texture2D(OGL2Texture,gl_TexCoord[0].xy).rgb +
         (texture2D(OGL2Texture,gl_TexCoord[0].zy).rgb) * 0.25 +
         (texture2D(OGL2Texture,gl_TexCoord[0].xw).rgb) * 0.25 +
         texture2D(OGL2Texture,gl_TexCoord[1].xy).rgb +
         (texture2D(OGL2Texture,gl_TexCoord[1].zy).rgb) * 0.25 +
         (texture2D(OGL2Texture,gl_TexCoord[1].xw).rgb) * 0.25 +
         texture2D(OGL2Texture,gl_TexCoord[2].xy).rgb +
         (texture2D(OGL2Texture,gl_TexCoord[2].zy).rgb) * 0.25 +
         (texture2D(OGL2Texture,gl_TexCoord[2].xw).rgb) * 0.25 +
         texture2D(OGL2Texture,gl_TexCoord[3].xy).rgb +
         (texture2D(OGL2Texture,gl_TexCoord[3].zy).rgb) * 0.25 +
         (texture2D(OGL2Texture,gl_TexCoord[3].xw).rgb) * 0.25 ) / 6.0;

    c1 = vec3(pow(dot(c0, RGBtoY), 1.2), dot(c0, RGBtoI) * 1.2, dot(c0, RGBtoQ) * 1.2);

    gl_FragColor = vec4(dot(c1, YIQtoR), dot(c1, YIQtoG), dot(c1, YIQtoB), 0.0);
    gl_FragColor = gl_FragColor *white/255.0+black/255.0-gl_FragColor*black/255.0+(pseudoNoise(gl_TexCoord[0].xy)+offset/100.0)*noise/100.0;
}
gpuPeteOGL2.slv
Code:
uniform vec4 OGL2Param;

void main()
{
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

    gl_TexCoord[0]=gl_MultiTexCoord0.xyxy+vec4(-0.5,-0.5,-1.5,-1.5) * OGL2Param.xyxy*2;
    gl_TexCoord[1]=gl_MultiTexCoord0.xyxy+vec4( 0.5,-0.5, 1.5,-1.5) * OGL2Param.xyxy*2;
    gl_TexCoord[2]=gl_MultiTexCoord0.xyxy+vec4(-0.5, 0.5,-1.5, 1.5) * OGL2Param.xyxy*2;
    gl_TexCoord[3]=gl_MultiTexCoord0.xyxy+vec4( 0.5, 0.5, 1.5, 1.5) * OGL2Param.xyxy*2;
}
The only problem - noise generation is not so often, you cant regenerate it every frame, but even it is enough for me!
 

·
Registered
Joined
·
65 Posts
Discussion Starter #2
Just set bigger strength (shader level) on OPengl2 control or change shader. Im newbie and dont understand complex algorithm
 
1 - 2 of 2 Posts
Top