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

tsunami2311 



...

Status:Offline
Date registered: 12.08.2009
Post:2
Send Message
...   Created on 07.07.2012 - 20:49Jump to top Quote this post Report this post Edit Delete


stupid question, How do i turn those codes in to the respective files?

Cause I just copy text but the code colum in to text file and save them as there respective file and save as asci code




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

...

Status:Offline
Date registered: 03.08.2005
Post:103
Send Message
...   Created on 02.10.2012 - 00:30Jump to top Quote this post Report this post Edit Delete


So, what is the best version of this shader regarding quality (speed dont matter)?

What should we set shader levels to and what resolution should be used?




Hyllian 
Frequent poster
...

...

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


Z schrieb

    So, what is the best version of this shader regarding quality (speed dont matter)?

    What should we set shader levels to and what resolution should be used?

There's no better version.

I can give my opinion, though.

xBR is very good for cartoon games like Mario and Zelda, and not so good for digitized games. So, lately I've been working on a hybrid version which addresses that weak point without breaking too much the other strong points.

The xBR-hybrid only works at 2x (it's a limitation for now). But in emulators like Retroarch you can use a second shader to upscale to 4x, for example, without loosing too much details.


Here's the first version of my hybrid: 2xBR-hybrid


And here are some screenshots of some games for Genesis and Snes:

Genesis with 2xBR-hybrid at 4x (using ddt.cg as second shader)

SNES with 2xBR-hybrid at 4x (using ddt.cg as second shader) - part 1

SNES with 2xBR-hybrid at 4x (using ddt.cg as second shader) - part 2


In my opinion, the quality is very good. Not so crispy as pure xBR, but in games like Mortal Kombat and Killer Instinct it works much better!




Pernicio 



...

Status:Offline
Date registered: 19.09.2013
Post:2
Send Message
...   Created on 20.09.2013 - 15:55Jump to top Quote this post Report this post Edit Delete


At first the older 3.5a shader didn't work for me - as in didn't improve or worsen the image quality at all, as if there was no shaders in use - but the newer 3.7 works fine.

Thank you for this I would be more than glad if you could take a look at the xBRZ shaders also, as the only ones I know are still just CPU shaders.

[Dieser Beitrag wurde am 20.09.2013 - 16:40 von Pernicio aktualisiert]




quequotion 



...

Status:Offline
Date registered: 24.01.2012
Post:6
Send Message
...   Created on 17.09.2014 - 08:07Jump to top Quote this post Report this post Edit Delete


How about making a new shader with 2xBR-Hybrid+HQ4X+FXAA?

We have all the pieces, scatter about in this forum.

There are two things I don't know how to do, or I would do this myself:

-How to convert from .cg shaders to .slf/.slv

-How to combine shaders

If someone could show me how that's done, I will do this myself.




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

...

Status:Offline
Date registered: 30.07.2004
Post:854
Send Message
...   Created on 15.10.2014 - 18:07Jump to top Quote this post Report this post Edit Delete


I can give an example how to combine shaders.

We can merge 5xBR with 4xMSaL and Natural Vision with some tweaking quite normaly.

The problem is that a pseudo pass doesen't work that nice with 5xBR and 4xMSaL so i had to use an emulated 2-pass approach. Natural Vison enhances a single color value so it's not problematic to attach.

The 5xBR + 4xMSaL + NV shader:

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:
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:
 
/*
   Hyllian's 5xBR v3.7a shader
   Copyright (C) 2011 Hyllian/Jararaca - sergiogdb@gmail.com
   

   4xMSaL shader
   Copyright (C) 2007 guest(r) - guest.r@gmail.com


   Natural Vision code by ShadX 


   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.

*/

/* SHADER NOTES:
    *Best shader level is 3 or 4 (shader level 1 = only 5xBR)
    *Screen smoothing must be turned OFF.
*/

uniform sampler2D OGL2Texture;

const float natural = 1.15;  // NV param

const mat3 RGBtoYIQ = mat3(0.299, 0.596, 0.212, 
                           0.587,-0.275,-0.523, 
                           0.114,-0.321, 0.311);

const mat3 YIQtoRGB = mat3(1.000, 1.000, 1.000,
                           0.955,-0.271,-1.108,
                           0.619,-0.646, 1.705);



const   float coef      = 2.0;
const   vec3  rgbw      = vec3(14.352, 28.176, 5.472);
const   vec2 OGLSize    = vec2( 1024.0, 512.0);
const   vec2 OGLInvSize = vec2( 0.0009765625, 0.001953125); 
const   vec2 dx         = vec2( 0.0009765625, 0.0);
const   vec2 dy         = vec2( 0.0, 0.001953125 );
const   vec2 x2         = vec2( 0.001953125 , 0.0);
const   vec2 y2         = vec2( 0.0 , 0.00390625 );
const   vec4 xy         = vec4( 0.0009765625, 0.001953125,-0.0009765625,-0.001953125);  
const   vec4 zw         = vec4( 0.001953125 , 0.001953125,-0.001953125 ,-0.00390625 );  
const   vec4 wz         = vec4( 0.0009765625, 0.00390625 ,-0.0009765625,-0.00390625 );  


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


vec3 texture2d (sampler2D OGL2Texture, vec2 texcoord) {

    vec4  edr, edr_left, edr_up; bvec4 px; // px = pixel, edr = edge detection rule
    vec4  interp_restriction_lv1, interp_restriction_lv2_left, interp_restriction_lv2_up;
    bvec4 nc; // new_color
    vec4  fx, fx_left, fx_up; // inequations of straight lines.
    
    vec2 fp  = fract(texcoord*OGLSize);
    vec2 TexCoord_0 = texcoord-fp*OGLInvSize;

    vec3 A  = texture2D(OGL2Texture, TexCoord_0 + xy.zw ).xyz;
    vec3 B  = texture2D(OGL2Texture, TexCoord_0     -dy ).xyz;
    vec3 C  = texture2D(OGL2Texture, TexCoord_0 + xy.xw ).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 + xy.zy ).xyz;
    vec3 H  = texture2D(OGL2Texture, TexCoord_0     +dy ).xyz;
    vec3 I  = texture2D(OGL2Texture, TexCoord_0 + xy.xy ).xyz;
    vec3 A1 = texture2D(OGL2Texture, TexCoord_0 + wz.zw ).xyz;
    vec3 C1 = texture2D(OGL2Texture, TexCoord_0 + wz.xw ).xyz;
    vec3 A0 = texture2D(OGL2Texture, TexCoord_0 + zw.zw ).xyz;
    vec3 G0 = texture2D(OGL2Texture, TexCoord_0 + zw.zy ).xyz;
    vec3 C4 = texture2D(OGL2Texture, TexCoord_0 + zw.xw ).xyz;
    vec3 I4 = texture2D(OGL2Texture, TexCoord_0 + zw.xy ).xyz;
    vec3 G5 = texture2D(OGL2Texture, TexCoord_0 + wz.zy ).xyz;
    vec3 I5 = texture2D(OGL2Texture, TexCoord_0 + wz.xy ).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  = b.yzwx;
    vec4 e  = vec4(dot(E,rgbw));
    vec4 f  = b.wxyz;
    vec4 g  = c.zwxy;
    vec4 h  = b.zwxy;
    vec4 i  = c.wxyz;
    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 = h5.yzwx;
    
    vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 );
    vec4 Bo = vec4( 1.0,  1.0, -1.0,-1.0 );
    vec4 Co = vec4( 1.5,  0.5, -0.5, 0.5 );
    vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 );
    vec4 Bx = vec4( 0.5,  2.0, -0.5,-2.0 );
    vec4 Cx = vec4( 1.0,  1.0, -0.5, 0.0 );
    vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 );
    vec4 By = vec4( 2.0,  0.5, -2.0,-0.5 );
    vec4 Cy = vec4( 2.0,  0.0, -1.0, 0.5 );
    
    // These inequations define the line below which interpolation occurs.
    fx      = vec4(greaterThan(Ao*fp.y+Bo*fp.x,Co));
    fx_left = vec4(greaterThan(Ax*fp.y+Bx*fp.x,Cx)); 
    fx_up   = vec4(greaterThan(Ay*fp.y+By*fp.x,Cy)); 

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

    edr      = vec4(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 = vec4(lessThanEqual(coef*df(f,g),df(h,c)))*interp_restriction_lv2_left; 
    edr_up   = vec4(greaterThanEqual(df(f,g),coef*df(h,c)))*interp_restriction_lv2_up;
    
    nc = bvec4 (edr*(max(max(fx, edr_left*fx_left), edr_up*fx_up)));

    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;

    return res;    



void main()
{
    vec3 dt=vec3(1.0,1.0,1.0);

    vec3 u,d,r,l; float m1,m2;

    vec3 c10 = texture2d(OGL2Texture, gl_TexCoord[1].xy).xyz;
    vec3 c12 = texture2d(OGL2Texture, gl_TexCoord[1].xz).xyz;
    vec3 c14 = texture2d(OGL2Texture, gl_TexCoord[1].xw).xyz;
    vec3 c30 = texture2d(OGL2Texture, gl_TexCoord[2].xy).xyz;
    vec3 c32 = texture2d(OGL2Texture, gl_TexCoord[2].xz).xyz;
    vec3 c34 = texture2d(OGL2Texture, gl_TexCoord[2].xw).xyz;
    vec3 c01 = texture2d(OGL2Texture, gl_TexCoord[3].yx).xyz;
    vec3 c21 = texture2d(OGL2Texture, gl_TexCoord[3].zx).xyz;
    vec3 c41 = texture2d(OGL2Texture, gl_TexCoord[3].wx).xyz;
    vec3 c03 = texture2d(OGL2Texture, gl_TexCoord[4].yx).xyz;
    vec3 c23 = texture2d(OGL2Texture, gl_TexCoord[4].zx).xyz;
    vec3 c43 = texture2d(OGL2Texture, gl_TexCoord[4].wx).xyz;

    m1=dot(abs(c10-c32),dt)+0.001;
    m2=dot(abs(c30-c12),dt)+0.001;
    u=(m2*(c10+c32)+m1*(c30+c12))/(m1+m2);

    m1=dot(abs(c14-c32),dt)+0.001;
    m2=dot(abs(c34-c12),dt)+0.001;
    d=(m2*(c14+c32)+m1*(c34+c12))/(m1+m2);

    m1=dot(abs(c01-c23),dt)+0.001;
    m2=dot(abs(c21-c03),dt)+0.001;
    l=(m2*(c01+c23)+m1*(c21+c03))/(m1+m2);

    m1=dot(abs(c21-c43),dt)+0.001;
    m2=dot(abs(c41-c23),dt)+0.001;
    r=(m2*(c21+c43)+m1*(c41+c23))/(m1+m2);

    vec3 c11 = 0.125*(u+d+r+l);
    c11=RGBtoYIQ*c11;
    c11=vec3(pow(c11.x,natural),c11.yz*natural);
    c11=YIQtoRGB*c11;

    gl_FragColor.xyz = c11;
}


gpuPeteOGL2.slv
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:
 
/*
   Copyright (C) 2014 guest(r) - guest.r@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.
*/

uniform vec4 OGL2Param;

void main()
{

    float offset = 0.0 + OGL2Param.z*0.25;    
    float x = offset/4096.0; float y = offset/2048.0;
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    gl_TexCoord[0] = gl_MultiTexCoord0;
    gl_TexCoord[1] = gl_TexCoord[0].xyyy + vec4(-x,-2.0*y,0.0,2.0*y);
    gl_TexCoord[2] = gl_TexCoord[0].xyyy + vec4( x,-2.0*y,0.0,2.0*y);
    gl_TexCoord[3] = gl_TexCoord[0].yxxx + vec4(-y,-2.0*x,0.0,2.0*x);
    gl_TexCoord[4] = gl_TexCoord[0].yxxx + vec4( y,-2.0*x,0.0,2.0*x);
}


Hope it is a fine example of how to combine shaders.




Renato84 



...

Status:Offline
Date registered: 16.11.2014
Post:3
Send Message
...   Created on 16.11.2014 - 06:53Jump to top Quote this post Report this post Edit Delete


I am playing Fire Emblem 4 on Snes9X and I found out, after many hours of tests, that the combination of 2xBRZ + NTSC filter would give me the sweetest results.

I intend on dedicatedly playing Suikoden 2 after finishing FE4. Would someone, please, point me a way to enable that combination of shaders (2xBRZ + NTSC or even 2xBRZ + Natural2) on epsxe/pcsx?

Ps. I don´t want 5xBR, it messes up bad the original. 2xBRZ is a fantastic middle ground.




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!



blank