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

Homepage Members Register Login Search Old board


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


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

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

...

Status:Offline
Date registered: 30.07.2004
Post:856
Send Message
...   Created on 27.10.2007 - 12:08Jump to top Quote this post Report this post Edit Delete


Guess my but* would be kicked if i let this one out. :P

fragment file:

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:
 

/*
  2xSaL Smart shader 

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

           - License: GNU-GPL 
 
*/


uniform sampler2D OGL2Texture;

const vec3 dt = vec3(1.4,1.4,1.4);

void main()
{
    // Calculating texel coordinates
    
    vec2 size     = vec2(2048.0,1024.0);
    vec2 inv_size = vec2(1.0/2048.0, 1.0/1024.0);

    vec2 OGL2Pos = gl_TexCoord[0].xy*size;
    vec2 fp  = fract(OGL2Pos);
    vec2 dx  = vec2(inv_size.x,0.0);
    vec2 dy  = vec2(0.0,inv_size.y);
    vec2 g1  = vec2( inv_size.x,inv_size.y);
    vec2 g2  = vec2(-inv_size.x,inv_size.y);

    vec2 pC4 = floor(OGL2Pos)*inv_size;
   

    // Reading the texels

    vec3 C0 = texture2D(OGL2Texture,pC4-g1).xyz; 
    vec3 C1 = texture2D(OGL2Texture,pC4-dy).xyz;
    vec3 C2 = texture2D(OGL2Texture,pC4-g2).xyz;
    vec3 C3 = texture2D(OGL2Texture,pC4-dx).xyz;
    vec3 C4 = texture2D(OGL2Texture,pC4   ).xyz;
    vec3 C5 = texture2D(OGL2Texture,pC4+dx).xyz;
    vec3 C6 = texture2D(OGL2Texture,pC4+g2).xyz;
    vec3 C7 = texture2D(OGL2Texture,pC4+dy).xyz;
    vec3 C8 = texture2D(OGL2Texture,pC4+g1).xyz;

    vec3 ul,ur,dl,dr; float m1,m2;

    m1=dot(abs(C0-C4),dt)+0.001;
    m2=dot(abs(C1-C3),dt)+0.001;
    ul=(m2*(C0+C4)+m1*(C1+C3))/(m1+m2);

    m1=dot(abs(C1-C5),dt)+0.001;
    m2=dot(abs(C2-C4),dt)+0.001;
    ur=(m2*(C1+C5)+m1*(C2+C4))/(m1+m2);

    m1=dot(abs(C3-C7),dt)+0.001;
    m2=dot(abs(C6-C4),dt)+0.001;
    dl=(m2*(C3+C7)+m1*(C6+C4))/(m1+m2);

    m1=dot(abs(C4-C8),dt)+0.001;
    m2=dot(abs(C5-C7),dt)+0.001;
    dr=(m2*(C4+C8)+m1*(C5+C7))/(m1+m2);
    
    gl_FragColor.xyz = 0.5*((dr*fp.x+dl*(1-fp.x))*fp.y+(ur*fp.x+ul*(1-fp.x))*(1-fp.y));
}


vertex file:
Code:
1:
2:
3:
4:
5:
6:
7:
8:
 

void main()

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


[Dieser Beitrag wurde am 28.10.2007 - 22:50 von guest aktualisiert]




GreenImp ...
Strong supporter
......



Status:Offline
Date registered: 18.10.2005
Post:22
Send Message
...   Created on 27.10.2007 - 23:45Jump to top Quote this post Report this post Edit Delete


2xSaL Smart looks awesome on Final Fantasy 7:


Off to a Halloween weekend party.

Cheers!





Signature
-GreenImp

http://greenimp.epsxe.com/GreenImp-ePSXeDoc.html

OS: Windows XP professional (SP2) CPU: AMD Atholon XP 2800+ (Barton) Graphics Card: Leadtek GeForce A7600 GT THD (256 DDR3 - AGP) Memory: 1 GB DDR Corsair value Sound Card: Sound Blaster Live! value Mobo: ASUS A7N8X-E Deluxe (nForce 2 Ultra 400)

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

...

Status:Offline
Date registered: 30.07.2004
Post:856
Send Message
...   Created on 28.10.2007 - 22:54Jump to top Quote this post Report this post Edit Delete


The shader looked like it had some bugs, but it turned out that altering the "color dif" dot variable (from (1.0,1.0,1.0) to something else) fixed it. At least on some Ati HW.

PS:

Yup mr. Greenimp, i had especially FF7 in mind. Was a long way to go.

[Dieser Beitrag wurde am 08.11.2007 - 17:41 von guest aktualisiert]




VerGreeneyes 
Strong supporter
......

...

Status:Offline
Date registered: 26.04.2007
Post:89
Send Message
...   Created on 14.11.2007 - 13:52Jump to top Quote this post Report this post Edit Delete


Hi guys, finally had some time to spend on this stuff again, and recently I found out about ARB assembly! To practice, I converted this filter to this other language, and it turned out about 7.6% faster on my rig after I was done optimising it. If you're interested, have a look

vertex file (gpuPeteOGL2.vp):

Code:
1:
2:
3:
4:
5:
 
!!ARBvp1.0
OPTION ARB_position_invariant;
MOV result.texcoord,vertex.texcoord;
END
fragment file (gpuPeteOGL2.fp):
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:
 
!!ARBfp1.0

# 2xSaL Smart shader 
# - Copyright (C) 2007 guest(r) - guest.r@gmail.com
# - License: GNU-GPL

PARAM dt={1.4,1.4,1.4,0.001};
PARAM size={2048.,1024.};
PARAM g1={ .00048828125,.0009765625};
PARAM g2={-.00048828125,.0009765625};
TEMP temp,fp,C0,C1,C2,C3,C4,C5,C6,C7,C8,m;
MOV C4,fragment.texcoord;
MUL fp,C4,size;
FRC fp,fp;
SUB C0,C4,g1;
SUB C1,C4,g1.zyzz;
SUB C2,C4,g2;
SUB C3,C4,g1.xzzz;
ADD C5,C4,g1.xzzz;
ADD C6,C4,g2;
ADD C7,C4,g1.zyzz;
ADD C8,C4,g1;
TEX C0,C0,texture,2D;
TEX C1,C1,texture,2D;
TEX C2,C2,texture,2D;
TEX C3,C3,texture,2D;
TEX C5,C5,texture,2D;
TEX C6,C6,texture,2D;
TEX C7,C7,texture,2D;
TEX C8,C8,texture,2D;
TEX C4,C4,texture,2D;

SUB temp,C0,C4;
ABS temp,temp;
DPH m.x,temp,dt;
SUB temp,C1,C3;
ABS temp,temp;
DPH m.y,temp,dt;
ADD m.z,m.x,m.y;
ADD temp,C0,C4;
ADD C0,C1,C3;
MUL C0,C0,m.x;
MAD C0,temp,m.y,C0;
RCP temp,m.z;
MUL C0,C0,temp;

SUB temp,C1,C5;
ABS temp,temp;
DPH m.x,temp,dt;
SUB temp,C2,C4;
ABS temp,temp;
DPH m.y,temp,dt;
ADD m.z,m.x,m.y;
ADD temp,C1,C5;
ADD C1,C2,C4;
MUL C1,C1,m.x;
MAD C1,temp,m.y,C1;
RCP temp,m.z;
MUL C1,C1,temp;

SUB temp,C3,C7;
ABS temp,temp;
DPH m.x,temp,dt;
SUB temp,C4,C6;
ABS temp,temp;
DPH m.y,temp,dt;
ADD m.z,m.x,m.y;
ADD temp,C3,C7;
ADD C2,C4,C6;
MUL C2,C2,m.x;
MAD C2,temp,m.y,C2;
RCP temp,m.z;
MUL C2,C2,temp;

SUB temp,C4,C8;
ABS temp,temp;
DPH m.x,temp,dt;
SUB temp,C5,C7;
ABS temp,temp;
DPH m.y,temp,dt;
ADD m.z,m.x,m.y;
ADD temp,C4,C8;
ADD C3,C5,C7;
MUL C3,C3,m.x;
MAD C3,temp,m.y,C3;
RCP temp,m.z;
MUL C3,C3,temp;

SUB m,1.0,fp;

MUL temp,C0,m.x;
MAD temp,C1,fp.x,temp;
MUL C8,temp,m.y;
MUL temp,C2,m.x;
MAD temp,C3,fp.x,temp;
MAD C8,temp,fp.y,C8;
MUL result.color,C8,0.5;
MOV result.color.a,C4.a;

END


(to use this, set the OGL2 plugin to "ARB program")

[Dieser Beitrag wurde am 15.11.2007 - 18:05 von VerGreeneyes aktualisiert]




batman 
Strong supporter
......



Status:Offline
Date registered: 20.09.2005
Post:37
Send Message
...   Created on 14.11.2007 - 22:18Jump to top Quote this post Report this post Edit Delete


Hey Ver!


mfg. batman

[Dieser Beitrag wurde am 15.11.2007 - 15:58 von batman aktualisiert]




VerGreeneyes 
Strong supporter
......

...

Status:Offline
Date registered: 26.04.2007
Post:89
Send Message
...   Created on 15.11.2007 - 00:26Jump to top Quote this post Report this post Edit Delete


I don't mind posting stuff at the ngemu forums, but checking my IP wouldn't do you any good. It's dynamic, my ISP assigns me a new one every few days.




batman 
Strong supporter
......



Status:Offline
Date registered: 20.09.2005
Post:37
Send Message
...   Created on 15.11.2007 - 08:22Jump to top Quote this post Report this post Edit Delete


"Read the quotes".

[Dieser Beitrag wurde am 15.11.2007 - 16:25 von batman aktualisiert]




ShadX ...
Real addict
.........



Status:Offline
Date registered: 20.01.2005
Post:266
Send Message
...   Created on 15.11.2007 - 12:19Jump to top Quote this post Report this post Edit Delete


batman schrieb

    You are braking some german law here.
    And finding out your ISP would limit the possible candidates if they are registered there also.
    If you keep your IP long enough there shouldnt be a problem to find a match.

Guest, errr... Batman, you are totally out of order! I think it's time to stop to drink or to smoke! Pete, please, ban this user...




VerGreeneyes 
Strong supporter
......

...

Status:Offline
Date registered: 26.04.2007
Post:89
Send Message
...   Created on 15.11.2007 - 12:59Jump to top Quote this post Report this post Edit Delete


batman schrieb

    You are braking some german law here.
    And finding out your ISP would limit the possible candidates if they are registered there also.
    If you keep your IP long enough there shouldnt be a problem to find a match.


Without getting involved in discussions of your integrity, what law am I breaking? My IP is kept for several days, I don't have any control over the lease time except to shorten it. Further, as I'm in Holland I doubt I have much to do with German law as long as Pete doesn't include my work in his plugin officially.




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

...

Status:Offline
Date registered: 30.07.2004
Post:856
Send Message
...   Created on 15.11.2007 - 16:11Jump to top Quote this post Report this post Edit Delete


In Germany, publishing some work that could be copyrighted without putting on some copyright counts as the author is putting his copyright on.




More : [1] [2]

Similarly threads:
Topics Created by Replies Boardname
Smart Texture Filtering GLSL shader (Copyright (c) 2004 Jaewon Jung) ShadX 7 pete_bernert
2xSaL shader guest 8 pete_bernert
Smart AA - BlooM GLSL shader + a nice variation guest 1 pete_bernert
Does anyone have a link to a Smart Texture Filtering shader? FM 1 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
Neuer Thread ...





Masthead

This forum is a free service of razyboard.com powered by:
Geizkragen Price Comparison. Top product in the price comparison: Krups Nespresso Essenza (XN2001)
Do you want a free forum in less than two minutes? Then click here!



Verwandte Suchbegriffe:
2xsal | 2xsal smart | 2xsal smart shader epsxe | jaewon jung shader | 2xsal smart shader | smart shader files | final fantasy vii shader ogl2 | bloom shader epsxe
blank