Pete´s Messageboard... No ISO/BIOS requests!

Homepage Members Register Login Search Old board


Neuer Thread ...
More : [1] [2] [3]


AuthorTopics » Book an abo for this threadClose Thread Move Thread Fix the thread Print view Delete this thread

pmc2 



...

Status:Offline
Date registered: 09.01.2012
Post:1
Send Message
...   Created on 09.01.2012 - 18:02Jump to top Quote this post Report this post Edit Delete


New filter for kega (.rpi) or snes9x (.cg).

Is it possible to convert .cg to .slv/.slf?

http://board.byuu.org/viewtopic.php?f=10&t=2248
(v3.3b / v3.5a Cg shader)



Better than 2xsai/hqnx/EPX !!

source:
http://neosource.1emu.net/forums/index. … 4#msg13204
http://www.multiupload.com/M2SUIU3J6H




Z 
Real addict
.........

...

Status:Offline
Date registered: 03.08.2005
Post:103
Send Message
...   Created on 09.03.2012 - 23:37Jump to top Quote this post Report this post Edit Delete


This would definitely be interesting.

I also think this filter is the best one out there so far, even better than the great HQnx.

My impression is:
There are some situations when HQnx provides better results; but in most situations, this one here wins!

It is not perfect, but overall this one here is the best!


Regards.




KrossX 
Real addict
.........

...

Status:Offline
Date registered: 16.06.2008
Post:122
Send Message
...   Created on 12.03.2012 - 08:16Jump to top Quote this post Report this post Edit Delete


I just tried and gave it a shot at porting the following shader:
https://github.com/twinaphex/common-sha … R-v3.5a.cg
from a few pages later
http://board.byuu.org/viewtopic.php?f=1 … 8&start=60

It's a very, very heavy shader with over a thousand instructions when I checked. Also, use it on native.

Screenshots: on and off. Guess which one is which.


Fragment

Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
 

/*
   Hyllian's 5xBR v3.5 Shader
   
   Copyright (C) 2011 Hyllian/Jararaca - sergiogdb@gmail.com

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

// Messed up and ported to Pete's OGL2 GLSL, KrossX (2012-03-12)

#version 110

uniform sampler2D OGL2Texture;
uniform vec4 OGL2Param;
uniform vec4 OGL2Size;

const float coef = 2.0;
const vec3 dtt = vec3(65536,255,1);
const float y_weight = 48.0;
const float u_weight = 7.0;
const float v_weight = 6.0;
const mat3 yuv = mat3(0.299, 0.587, 0.114, -0.169, -0.331, 0.499, 0.499, -0.418, -0.0813);
const mat3 yuv_weighted = mat3(y_weight*yuv[0], u_weight*yuv[1], v_weight*yuv[2]);
//const mat3x3 yuv_weighted = mat3x3(14.352, 28.176, 5.472, -1.183, -2.317, 3.5, 3.0, -2.514, -0.486);


bvec4 and(vec4 a, vec4 b)
{
    return bvec4(a.x != 0.0 && b.x != 0.0, a.y != 0.0 && b.y != 0.0, a.z != 0.0 && b.z != 0.0, a.w != 0.0 && b.w != 0.0);
}

vec4 RGBtoYUV(mat4 mat_color)
{
    vec3 a = abs(yuv_weighted * mat_color[0].xyz);
    vec3 b = abs(yuv_weighted * mat_color[1].xyz);
    vec3 c = abs(yuv_weighted * mat_color[2].xyz);
    vec3 d = abs(yuv_weighted * mat_color[3].xyz);

    return vec4(length(a), length(b), length(c), length(d));
}

vec4 df(vec4 A, vec4 B)
{
    return vec4(abs(A-B));
}

vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h)
{
    return (df(a,b) + df(a,c) + df(d,e) + df(d,f) + 4.0*df(g,h));
}

void main(void)
{
    bvec4 edr, edr_left, edr_up, px; // px = pixel, edr = edge detection rule
    bvec4 interp_restriction_lv1, interp_restriction_lv2_left, interp_restriction_lv2_up;
    
    vec2 fp = fract(gl_TexCoord[0].xy * OGL2Size.xy); // Texture size

    vec2 dx = gl_TexCoord[1].xy;
    vec2 dy = gl_TexCoord[1].zw;

    vec4 A = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dx -dy).xyz, 0.0);
    vec4 B = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dy).xyz, 0.0);
    vec4 C = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dx -dy).xyz, 0.0);
    vec4 D = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dx ).xyz, 0.0);
    vec4 E = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy ).xyz, 0.0);
    vec4 F = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dx ).xyz, 0.0);
    vec4 G = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dx +dy).xyz, 0.0);
    vec4 H = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dy).xyz, 0.0);
    vec4 I = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dx +dy).xyz, 0.0);

    vec4 A1 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dx -2.0*dy).xyz, 0.0);
    vec4 C1 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dx -2.0*dy).xyz, 0.0);
    vec4 A0 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -2.0*dx -dy).xyz, 0.0);
    vec4 G0 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -2.0*dx +dy).xyz, 0.0);
    vec4 C4 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +2.0*dx -dy).xyz, 0.0);
    vec4 I4 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +2.0*dx +dy).xyz, 0.0);
    vec4 G5 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -dx +2.0*dy).xyz, 0.0);
    vec4 I5 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +dx +2.0*dy).xyz, 0.0);
    vec4 B1 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -2.0*dy).xyz, 0.0);
    vec4 D0 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy -2.0*dx ).xyz, 0.0);
    vec4 H5 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +2.0*dy).xyz, 0.0);
    vec4 F4 = vec4(texture2D(OGL2Texture, gl_TexCoord[0].xy +2.0*dx ).xyz, 0.0);

    //vec4 a = RGBtoYUV( mat4(A, G, I, C) );
    vec4 b = RGBtoYUV( mat4(B, D, H, F) );
    vec4 c = RGBtoYUV( mat4(C, A, G, I) );
    vec4 d = RGBtoYUV( mat4(D, H, F, B) );
    vec4 e = RGBtoYUV( mat4(E, E, E, E) );
    vec4 f = RGBtoYUV( mat4(F, B, D, H) );
    vec4 g = RGBtoYUV( mat4(G, I, C, A) );
    vec4 h = RGBtoYUV( mat4(H, F, B, D) );
    vec4 i = RGBtoYUV( mat4(I, C, A, G) );

    //vec4 a1 = RGBtoYUV( mat4(A1, G0, I5, C4) );
    //vec4 c1 = RGBtoYUV( mat4(C1, A0, G5, I4) );
    //vec4 a0 = RGBtoYUV( mat4(A0, G5, I4, C1) );
    //vec4 g0 = RGBtoYUV( mat4(G0, I5, C4, A1) );
    //vec4 c4 = RGBtoYUV( mat4(C4, A1, G0, I5) );
    vec4 i4 = RGBtoYUV( mat4(I4, C1, A0, G5) );
    //vec4 g5 = RGBtoYUV( mat4(G5, I4, C1, A0) );
    vec4 i5 = RGBtoYUV( mat4(I5, C4, A1, G0) );
    //vec4 b1 = RGBtoYUV( mat4(B1, D0, H5, F4) );
    //vec4 d0 = RGBtoYUV( mat4(D0, H5, F4, B1) );
    vec4 h5 = RGBtoYUV( mat4(H5, F4, B1, D0) );
    vec4 f4 = RGBtoYUV( mat4(F4, B1, D0, H5) );

    interp_restriction_lv1 = and(notEqual(e,f), notEqual(e,h));
    interp_restriction_lv2_left = and(notEqual(e,g), notEqual(d,g));
    interp_restriction_lv2_up = and(notEqual(e,c), notEqual(b,c));

    edr = and(lessThan(weighted_distance( e, c, g, i, h5, f4, h, f), weighted_distance( h, d, i5, f, i4, b, e, i)), interp_restriction_lv1);
    edr_left = and(lessThanEqual(coef*df(f,g),df(h,c)), interp_restriction_lv2_left);
    edr_up = and(greaterThanEqual(df(f,g), (coef*df(h,c))), interp_restriction_lv2_up);

    vec3 E0 = E.xyz;
    vec3 E1 = E.xyz;
    vec3 E2 = E.xyz;
    vec3 E3 = E.xyz;

    px = lessThanEqual(df(e,f), df(e,h));

    vec3 P[4];

    P[0] = px.x ? F.xyz : H.xyz;
    P[1] = px.y ? B.xyz : F.xyz;
    P[2] = px.z ? D.xyz : B.xyz;
    P[3] = px.w ? H.xyz : D.xyz;


    if (edr.x)
    {
        if (edr_left.x && edr_up.x)
        {
            E3 = mix(E3 , P[0], 0.833333);
            E2 = mix(E2 , P[0], 0.25);
            E1 = mix(E1 , P[0], 0.25);
        }
        else if (edr_left.x)
        {
            E3 = mix(E3 , P[0], 0.75);
            E2 = mix(E2 , P[0], 0.25);
        }
        else if (edr_up.x)
        {
            E3 = mix(E3 , P[0], 0.75);
            E1 = mix(E1 , P[0], 0.25);
        }
        else
        {
            E3 = mix(E3 , P[0], 0.5);
        }
    }

    if (edr.y)
    {
        if (edr_left.y && edr_up.y)
        {
            E1 = mix(E1 , P[1], 0.833333);
            E3 = mix(E3 , P[1], 0.25);
            E0 = mix(E0 , P[1], 0.25);
        }
        else if (edr_left.y)
        {
            E1 = mix(E1 , P[1], 0.75);
            E3 = mix(E3 , P[1], 0.25);
        }
        else if (edr_up.y)
        {
            E1 = mix(E1 , P[1], 0.75);
            E0 = mix(E0 , P[1], 0.25);
        }
        else
        {
            E1 = mix(E1 , P[1], 0.5);
        }
    }

    if (edr.z)
    {
        if (edr_left.z && edr_up.z)
        {
            E0 = mix(E0 , P[2], 0.833333);
            E1 = mix(E1 , P[2], 0.25);
            E2 = mix(E2 , P[2], 0.25);
        }
        else if (edr_left.z)
        {
            E0 = mix(E0 , P[2], 0.75);
            E1 = mix(E1 , P[2], 0.25);
        }
        else if (edr_up.z)
        {
            E0 = mix(E0 , P[2], 0.75);
            E2 = mix(E2 , P[2], 0.25);
        }
        else
        {
            E0 = mix(E0 , P[2], 0.5);
        }
    }

    if (edr.w)
    {
        if (edr_left.w && edr_up.w)
        {
            E2 = mix(E2 , P[3], 0.833333);
            E0 = mix(E0 , P[3], 0.25);
            E3 = mix(E3 , P[3], 0.25);
        }
        else if (edr_left.w)
        {
            E2 = mix(E2 , P[3], 0.75);
            E0 = mix(E0 , P[3], 0.25);
        }
        else if (edr_up.w)
        {
            E2 = mix(E2 , P[3], 0.75);
            E3 = mix(E3 , P[3], 0.25);
        }
        else
        {
            E2 = mix(E2 , P[3], 0.5);
        }
    }

    vec3 res = (fp.x < 0.50) ? (fp.y < 0.50 ? E0 : E2) : (fp.y < 0.50 ? E1: E3);
    gl_FragColor = vec4(res, 1.0);
}



Vertex

Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
 

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;

void main()
{    
    vec2 dx  = vec2(1.0 / OGL2Size.x, 0.0);
    vec2 dy  = vec2(0.0, 1.0 / OGL2Size.y);
    
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    gl_TexCoord[0] = gl_MultiTexCoord0;
    gl_TexCoord[1].xy = dx; // F
    gl_TexCoord[1].zw = dy; // H
}





Signature


Hyllian 
Frequent poster
...

...

Status:Offline
Date registered: 12.03.2012
Post:11
Send Message
...   Created on 12.03.2012 - 15:45Jump to top Quote this post Report this post Edit Delete


Hi,

I'm glad you liked and ported it.


KrossX, it seems you've used the 2x version of this algorithm. It's really heavier than others.

I recommend you to use this 5xBR-v3.5a.cg here

https://github.com/twinaphex/common-sha … R-v3.5a.cg

It's faster and you can use at 3x and 5x scale factor.


Besides, there's a variant called "b" of that shader, which preserves fonts a bit more. This variant you can get by exchange a single line in that shader:

This:

Code:
1:
2:
3:
 

    interp_restriction_lv1      = ((e!=f) && (e!=h));


By this:

Code:
1:
2:
3:
 

    interp_restriction_lv1      = ((e!=f) && (e!=h) &&  ( f!=b && h!=d || e==i && f!=i4 && h!=i5 || e==g || e==c ) );




guest ...
Real addict
.........

...

Status:Offline
Date registered: 30.07.2004
Post:854
Send Message
...   Created on 13.03.2012 - 15:24Jump to top Quote this post Report this post Edit Delete


gpuPeteOGL2.slv:

Code:
1:
2:
3:
4:
5:
6:
 
void main()

{
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    gl_TexCoord[0] = gl_MultiTexCoord0;
}


gpuPeteOGL2.slf:
Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
 
/*
   Hyllian's 5xBR v3.5a Shader
   
   Copyright (C) 2011 Hyllian/Jararaca - sergiogdb@gmail.com
  
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   
*/


const float coef            = 2.0;
const vec3  rgbw            = vec3(16.163, 23.351, 8.4772);

const vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 );
const vec4 Bo = vec4( 1.0,  1.0, -1.0,-1.0 );
const vec4 Co = vec4( 1.5,  0.5, -0.5, 0.5 );
const vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 );
const vec4 Bx = vec4( 0.5,  2.0, -0.5,-2.0 );
const vec4 Cx = vec4( 1.0,  1.0, -0.5, 0.0 );
const vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 );
const vec4 By = vec4( 2.0,  0.5, -2.0,-0.5 );
const vec4 Cy = vec4( 2.0,  0.0, -1.0, 0.5 );


vec4 df(vec4 A, vec4 B)
{
    return abs(A-B);
}

vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h)
{
    return (df(a,b) + df(a,c) + df(d,e) + df(d,f) + 4.0*df(g,h));
}

uniform vec4 OGL2Size;
uniform vec4 OGL2InvSize;
uniform sampler2D OGL2Texture;

void main()
{
    bvec4 edr, edr_left, edr_up, px; // px = pixel, edr = edge detection rule
    bvec4 interp_restriction_lv1, interp_restriction_lv2_left, interp_restriction_lv2_up;
    bvec4 nc; // new_color
    bvec4 fx, fx_left, fx_up; // inequations of straight lines.
    
    vec2 fp  = fract(gl_TexCoord[0].xy*OGL2Size.xy);
    vec2 TexCoord_0 = gl_TexCoord[0].xy-fp*OGL2InvSize.xy;
    vec2 dx  = vec2(OGL2InvSize.x,0.0);
    vec2 dy  = vec2(0.0,OGL2InvSize.y);
    vec2 y2  = dy + dy; vec2 x2  = dx + dx;
    
    vec3 A  = texture2D(OGL2Texture, TexCoord_0 -dx -dy    ).xyz;
    vec3 B  = texture2D(OGL2Texture, TexCoord_0     -dy    ).xyz;
    vec3 C  = texture2D(OGL2Texture, TexCoord_0 +dx -dy    ).xyz;
    vec3 D  = texture2D(OGL2Texture, TexCoord_0 -dx        ).xyz;
    vec3 E  = texture2D(OGL2Texture, TexCoord_0            ).xyz;
    vec3 F  = texture2D(OGL2Texture, TexCoord_0 +dx        ).xyz;
    vec3 G  = texture2D(OGL2Texture, TexCoord_0 -dx +dy    ).xyz;
    vec3 H  = texture2D(OGL2Texture, TexCoord_0     +dy    ).xyz;
    vec3 I  = texture2D(OGL2Texture, TexCoord_0 +dx +dy    ).xyz;
    vec3 A1 = texture2D(OGL2Texture, TexCoord_0     -dx -y2).xyz;
    vec3 C1 = texture2D(OGL2Texture, TexCoord_0     +dx -y2).xyz;
    vec3 A0 = texture2D(OGL2Texture, TexCoord_0 -x2     -dy).xyz;
    vec3 G0 = texture2D(OGL2Texture, TexCoord_0 -x2     +dy).xyz;
    vec3 C4 = texture2D(OGL2Texture, TexCoord_0 +x2     -dy).xyz;
    vec3 I4 = texture2D(OGL2Texture, TexCoord_0 +x2     +dy).xyz;
    vec3 G5 = texture2D(OGL2Texture, TexCoord_0     -dx +y2).xyz;
    vec3 I5 = texture2D(OGL2Texture, TexCoord_0     +dx +y2).xyz;
    vec3 B1 = texture2D(OGL2Texture, TexCoord_0         -y2).xyz;
    vec3 D0 = texture2D(OGL2Texture, TexCoord_0 -x2        ).xyz;
    vec3 H5 = texture2D(OGL2Texture, TexCoord_0         +y2).xyz;
    vec3 F4 = texture2D(OGL2Texture, TexCoord_0 +x2        ).xyz;

    vec4 b  = vec4(dot(B ,rgbw), dot(D ,rgbw), dot(H ,rgbw), dot(F ,rgbw));
    vec4 c  = vec4(dot(C ,rgbw), dot(A ,rgbw), dot(G ,rgbw), dot(I ,rgbw));
    vec4 d  = vec4(b.y, b.z, b.w, b.x);
    vec4 e  = vec4(dot(E,rgbw));
    vec4 f  = vec4(b.w, b.x, b.y, b.z);
    vec4 g  = vec4(c.z, c.w, c.x, c.y);
    vec4 h  = vec4(b.z, b.w, b.x, b.y);
    vec4 i  = vec4(c.w, c.x, c.y, c.z);
    vec4 i4 = vec4(dot(I4,rgbw), dot(C1,rgbw), dot(A0,rgbw), dot(G5,rgbw));
    vec4 i5 = vec4(dot(I5,rgbw), dot(C4,rgbw), dot(A1,rgbw), dot(G0,rgbw));
    vec4 h5 = vec4(dot(H5,rgbw), dot(F4,rgbw), dot(B1,rgbw), dot(D0,rgbw));
    vec4 f4 = vec4(h5.y, h5.z, h5.w, h5.x);

    // These inequations define the line below which interpolation occurs.
    fx      = greaterThan(Ao*fp.y+Bo*fp.x,Co); 
    fx_left = greaterThan(Ax*fp.y+Bx*fp.x,Cx);
    fx_up   = greaterThan(Ay*fp.y+By*fp.x,Cy);

    interp_restriction_lv1      = bvec4(vec4(notEqual(e,f))*vec4(notEqual(e,h)));
    interp_restriction_lv2_left = bvec4(vec4(notEqual(e,g))*vec4(notEqual(d,g)));
    interp_restriction_lv2_up   = bvec4(vec4(notEqual(e,c))*vec4(notEqual(b,c)));

    edr      = bvec4(vec4(lessThan(weighted_distance( e, c, g, i, h5, f4, h, f), weighted_distance( h, d, i5, f, i4, b, e, i)))*vec4(interp_restriction_lv1));
    edr_left = bvec4(vec4(lessThanEqual(coef*df(f,g),df(h,c)))*vec4(interp_restriction_lv2_left)); 
    edr_up   = bvec4(vec4(greaterThanEqual(df(f,g),coef*df(h,c)))*vec4(interp_restriction_lv2_up));
    
    nc.x = ( edr.x && (fx.x || edr_left.x && fx_left.x || edr_up.x && fx_up.x) );
    nc.y = ( edr.y && (fx.y || edr_left.y && fx_left.y || edr_up.y && fx_up.y) );
    nc.z = ( edr.z && (fx.z || edr_left.z && fx_left.z || edr_up.z && fx_up.z) );
    nc.w = ( edr.w && (fx.w || edr_left.w && fx_left.w || edr_up.w && fx_up.w) );    

    px = lessThanEqual(df(e,f),df(e,h));

    vec3 res = nc.x ? px.x ? F : H : nc.y ? px.y ? B : F : nc.z ? px.z ? D : B : nc.w ? px.w ? H : D : E;    
    gl_FragColor.xyz = res;    
}


[Dieser Beitrag wurde am 16.03.2012 - 16:57 von guest aktualisiert]




Hyllian 
Frequent poster
...

...

Status:Offline
Date registered: 12.03.2012
Post:11
Send Message
...   Created on 13.03.2012 - 15:46Jump to top Quote this post Report this post Edit Delete


Great work, Guest! I'm your fan!

I learned about making shaders by porting your shader pack to PS3 emulators.


There are some variants I made with xBR. I've combined some with CRT shaders. Here two with CRT:

4xBR-v3.5+CRT.cg

5xBR-v3.5+CRT


And some other bicubic shader I was working to speed up. This bicubic shader is the fastest I know. Maybe you like and could translate to ePSXe. It's at least 30% faster than other out there:

bicubic-fast.cg




guest ...
Real addict
.........

...

Status:Offline
Date registered: 30.07.2004
Post:854
Send Message
...   Created on 13.03.2012 - 16:37Jump to top Quote this post Report this post Edit Delete


Ehe!

Sometimes they can use a decent tweak!

------------------------------------------------

For PSX there is already a very interesting almost like bicubic resampler here.

[Dieser Beitrag wurde am 21.03.2012 - 16:50 von guest aktualisiert]




Hyllian 
Frequent poster
...

...

Status:Offline
Date registered: 12.03.2012
Post:11
Send Message
...   Created on 13.03.2012 - 16:42Jump to top Quote this post Report this post Edit Delete


I'll try your xBR tweaks later and see if speed is improved on PS3 emulators.

I wasn't getting any faster changes lately, so it's good to see other people bringing new ideas.


EDIT: There's some other implementation in this thread. Maybe you wanna see how they ported it.


EDIT 2: I'll try those abs/dot instead mul, later. It seems I was blind and couldn't realize that that abs function only need a dot product and not a matrix multiplication.

[Dieser Beitrag wurde am 13.03.2012 - 20:41 von Hyllian aktualisiert]




guest ...
Real addict
.........

...

Status:Offline
Date registered: 30.07.2004
Post:854
Send Message
...   Created on 13.03.2012 - 20:06Jump to top Quote this post Report this post Edit Delete


Updated the shader.




Hyllian 
Frequent poster
...

...

Status:Offline
Date registered: 12.03.2012
Post:11
Send Message
...   Created on 13.03.2012 - 23:58Jump to top Quote this post Report this post Edit Delete


No optimization here.


this operation (yuv_weighted*A0) isn't what I thought.




More : [1] [2] [3]

Similarly threads:
Topics Created by Replies Boardname
Shader Aquamarin 0 schaddi
MMJ's 4-in-1 Shader MegaManJuno 10 pete_bernert
4-in-1 Shader v1.10 MegaManJuno 3 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 16 pete_bernert
shader guest 2 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com
Do you want a free forum in less than two minutes? Then click here!



Verwandte Suchbegriffe:
rpi shader pack | xbr filter | rpi shader | hyllian xbr 4.0 | crt hyllian download | xbr shader epsxe | xbr.rpi | epsxe 5xbr | 5xbr rpi
blank