Emuforums.com

Go Back   Emuforums.com > PSX Emulation > PSX Plugin Questions & Troubleshooting
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

WON'T YOU JOIN US?
You are not a registered member and
are viewing this site as a guest.
Registration is simple and FREE.
Join this CrowdGather community today.
Registration offers the following perks:

» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging

join

Reply
 
Thread Tools Display Modes
Old March 22nd, 2012, 17:35   #381
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
New 5xBR v3.7a GLSL and ARB (for NVIDIA cards only)...
Big speedup... and no code obfuscation (so Guest.r can copy without problems)!
Remember to disable "Screen filtering" and set "Internal X/Y resolution to 0:low"
Ciao.
Attached Files
File Type: zip 5xBR v3.7a NVIDIA.zip (4.6 KB, 259 views)
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old March 22nd, 2012, 19:02   #382
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
Are you planning "b" and "c" versions?
Hyllian is offline   Reply With Quote
Old March 22nd, 2012, 21:16   #383
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
Are you planning "b" and "c" versions?
Yes, but I think the "a" version is enough good for most PSX games (and gamers). I'm working on a version that permit the use of the internal screen filtering. When I think is ready I sent you a PM.
Ciao.
P.S.: have you tested my "vertex calculation" trick?
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old March 22nd, 2012, 21:58   #384
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
Quote:
Originally Posted by SimoneT View Post
Yes, but I think the "a" version is enough good for most PSX games (and gamers). I'm working on a version that permit the use of the internal screen filtering. When I think is ready I sent you a PM.
Ciao.
Ok. Does the 'internal screen filtering' work over textures?

Quote:
Originally Posted by SimoneT View Post
P.S.: have you tested my "vertex calculation" trick?
Not yet. But I've passed my eyes a bit over it. It seems you know some clever shader tricks.

I'll try to translate to Cg later and see what happens.
Hyllian is offline   Reply With Quote
Old March 23rd, 2012, 02:30   #385
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
That I4 texture lookup should be "xw" instead "xy", or Am I mistaken?
Hyllian is offline   Reply With Quote
Old March 23rd, 2012, 09:59   #386
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
That I4 texture lookup should be "xw" instead "xy", or Am I mistaken?
You are right!
Ciao.
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old March 23rd, 2012, 13:44   #387
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
SimoneT, why don't you use variables instead assuming resolution of 1024x512?

I'll use something like this in my code (not tested yet):

Code:
	half2 ps = half2(1.0/IN.texture_size.x, 1.0/IN.texture_size.y);
	half dx  = ps.x;
	half dy  = ps.y;

//    A1 B1 C1
// A0  A  B  C C4
// D0  D  E  F F4
// G0  G  H  I I4
//    G5 H5 I5

	OUT.texCoord = texCoord;
	OUT.t1 = texCoord.xxxy + half4( -dx, 0, dx,-2.0*dy); // A1 B1 C1
	OUT.t2 = texCoord.xxxy + half4( -dx, 0, dx,    -dy); //  A  B  C 
	OUT.t3 = texCoord.xxxy + half4( -dx, 0, dx,      0); //  D  E  F 
	OUT.t4 = texCoord.xxxy + half4( -dx, 0, dx,     dy); //  G  H  I 
	OUT.t5 = texCoord.xxxy + half4( -dx, 0, dx, 2.0*dy); // G5 H5 I5
	OUT.t6 = texCoord.xyyy + half4(-2.0*dx,-dy, 0,  dy); // A0 D0 G0
	OUT.t7 = texCoord.xyyy + half4( 2.0*dx,-dy, 0,  dy); // C4 F4 I4
Hyllian is offline   Reply With Quote
Old March 23rd, 2012, 14:44   #388
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
SimoneT, why don't you use variables instead assuming resolution of 1024x512?

I'll use something like this in my code (not tested yet):

Code:
	half2 ps = half2(1.0/IN.texture_size.x, 1.0/IN.texture_size.y);
	half dx  = ps.x;
	half dy  = ps.y;

//    A1 B1 C1
// A0  A  B  C C4
// D0  D  E  F F4
// G0  G  H  I I4
//    G5 H5 I5

	OUT.texCoord = texCoord;
	OUT.t1 = texCoord.xxxy + half4( -dx, 0, dx,-2.0*dy); // A1 B1 C1
	OUT.t2 = texCoord.xxxy + half4( -dx, 0, dx,    -dy); //  A  B  C 
	OUT.t3 = texCoord.xxxy + half4( -dx, 0, dx,      0); //  D  E  F 
	OUT.t4 = texCoord.xxxy + half4( -dx, 0, dx,     dy); //  G  H  I 
	OUT.t5 = texCoord.xxxy + half4( -dx, 0, dx, 2.0*dy); // G5 H5 I5
	OUT.t6 = texCoord.xyyy + half4(-2.0*dx,-dy, 0,  dy); // A0 D0 G0
	OUT.t7 = texCoord.xyyy + half4( 2.0*dx,-dy, 0,  dy); // C4 F4 I4
Your code is right. 1024x512 is the psx buffer resolution at low X/Y, used as a input texture (pbuffer) by the Pete OGL2 plugin. If you have a fixed input resolution, is better that you force it into your vertex program.
...and x+x is little bit faster than 2.0*x...
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old March 23rd, 2012, 15:11   #389
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
Quote:
Originally Posted by SimoneT View Post
...and x+x is little bit faster than 2.0*x...
Ok, tks. And I've seen you used x*x instead abs(x) on the d function. Is it always faster?
Hyllian is offline   Reply With Quote
Old March 23rd, 2012, 15:24   #390
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
Ok, tks. And I've seen you used x*x instead abs(x) on the d function. Is it always faster?
Yes, is a little bit faster. Please use PM if you can, is better to no fill this tread with personal conversations...
Ciao.
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old April 2nd, 2012, 06:46   #391
RyuRanX
Registered User
 
RyuRanX's Avatar
 
Join Date: Apr 2007
Location: Brazil
Posts: 51
Can someone port bsnes' CRT shaders to the openGL2 plugin format? I love the way it looks with the curvature and all.

__________________
Avatar! Saiba que Britannia entrou em uma nova era de iluminismo! Saiba que a hora finalmente chegou para que o verdadeiro Senhor de Britannia clame Seu lugar à frente do Seu povo! Sobre minha guia, Britannia florescerá, e todos festejarão e prestarão homenagens ao seu novo... Guardião! Saiba que você também deverá se ajoelhar diante de mim, Avatar. Você também brevemente tomará consciência da minha autoridade - pois eu serei seu companheiro... seu provisor... e seu mestre!


Core2Duo E4600 - 2,4ghz - 2GB DDR2 800mhz - Zogis GEforce 9800GT 512mb - Windows XP SP3
RyuRanX is offline   Reply With Quote
Old April 2nd, 2012, 14:09   #392
KrossX
クロッスエクス
 
KrossX's Avatar
 
Join Date: Mar 2006
Location: Argentina
Posts: 3,649
I tried, but the curve didn't work. It kept flickering. =S
__________________

KrossX is offline   Reply With Quote
Old April 4th, 2012, 11:20   #393
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Small update. In my system, the ARB(fp/vp) version is a little bit faster than the GLSL(slf/slv). Ciao.
Attached Files
File Type: zip 5xBR v3.7a NVIDIA rev2.zip (4.7 KB, 213 views)
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old April 4th, 2012, 14:49   #394
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
SimoneT, I've seen you changed this code:

Code:
	half3 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;
By this:

Code:
if ((nc.x && px.x) || (nc.y && !px.y)) 
{
	E = F;
} 
else
if ((nc.y && px.y) || (nc.z && !px.z)) 
{
	E = B;
} 
else
if ((nc.z && px.z) || (nc.w && !px.w)) 
{
	E = D;
} 
else
if ((nc.w && px.w) || (nc.x && !px.x)) 
{
	E = H;
}
This is wrong, because you changed priorities. I expect some small artifacts to appear now.
Hyllian is offline   Reply With Quote
Old April 4th, 2012, 17:09   #395
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
...this is wrong, because you changed priorities. I expect some small artifacts to appear now.
Here your code in c++ notation:
Code:
    if (nc.x) { // if nc.x begin
        if (px.x) { 
            TMP2 = F;
        } else {
            TMP2 = H;
        } 
        TMP1 = TMP2;
    } else {
        if (nc.y) { // if nc.y begin
            if (px.y) { 
                TMP4 = B;
            } else {
                TMP4 = F;
            } 
            TMP3 = TMP4;
        } else {
            if (nc.z) { // if nc.z begin
                if (px.z) { 
                    TMP6 = D;
                } else {
                    TMP6 = B;
                } 
                TMP5 = TMP6;
            } else {
                if (nc.w) { // if nc.w begin
                    if (px.w) { 
                        TMP8 = H;
                    } else {
                        TMP8 = D;
                    } 
                    TMP7 = TMP8;
                } else {
                    TMP7 = E;
                } // end if nc.w
                TMP5 = TMP7;
            } // end if nc.z
            TMP3 = TMP5;
        } // end if nc.y 
        TMP1 = TMP3;
    } // end if nc.x 
    gl_FragColor = TMP1;
My code is only an optimization, try all 16 cases of nc and px...
Ciao.
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif

Last edited by SimoneT; April 4th, 2012 at 17:20..
SimoneT is offline   Reply With Quote
Old April 4th, 2012, 20:50   #396
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
In my code, if (nc.x==1 && px.x==0) then it ALWAYS return H.

In your code, if (nc.x==1 && px.x==0), then it MAY return F, for example.
Hyllian is offline   Reply With Quote
Old April 5th, 2012, 09:55   #397
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
In my code, if (nc.x==1 && px.x==0) then it ALWAYS return H.

In your code, if (nc.x==1 && px.x==0), then it MAY return F, for example.
I have tested your assumption and... I discovered that my code, compared to yours, is able to better discriminate the ambiguities of the edges (see the screenshots). But, if you wants, I will rewrite the shader code as the original.
Ciao
P.S.: the original.jpg was at 128x64 scaled to 1280x640 (10x)
Attached Images
File Type: jpg Original.jpg (95.2 KB, 117 views)
File Type: jpg yourcode.jpg (136.2 KB, 118 views)
File Type: jpg mycode.jpg (136.2 KB, 117 views)
File Type: jpg Difference.jpg (5.7 KB, 68 views)
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif

Last edited by SimoneT; April 5th, 2012 at 10:18..
SimoneT is offline   Reply With Quote
Old April 5th, 2012, 10:28   #398
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
I don't know if we can assume it always happen based only in one example picture.

The fact I was trying to demonstrate is that those pieces of codes weren't equivalent anymore. We can test more and if it becomes clear your optimizations fix some defects, then I will incorporate to the cg codes. Improvements are always welcomed!
Hyllian is offline   Reply With Quote
Old April 5th, 2012, 10:40   #399
SimoneT
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 161
Quote:
Originally Posted by Hyllian View Post
I don't know if we can assume it always happen based only in one example picture.

The fact I was trying to demonstrate is that those pieces of codes weren't equivalent anymore. We can test more and if it becomes clear your optimizations fix some defects, then I will incorporate to the cg codes. Improvements are always welcomed!
Ok. I will test with more games and emulators (I have ported yours shader to bsnes but I haven't released it...) and i will post some more screenshots.
__________________
CPU: Intel CORE i5 M 560 @ 2.67 GHz
GPU: NVIDIA NVS 3100M
http://www.megghy.com/immagini/GIF/barre/barra%2021.gif
SimoneT is offline   Reply With Quote
Old April 5th, 2012, 10:47   #400
Hyllian
Registered User
 
Join Date: Apr 2001
Location: Brazil
Posts: 84
Quote:
Originally Posted by SimoneT View Post
Ok. I will test with more games and emulators (I have ported yours shader to bsnes but I haven't released it...) and i will post some more screenshots.
Great. This code is so tight I always expect artifacts when something is changed.


Bsnes? Someone else already made it in this thread: xml shader

Maybe you wanna contribute there.

EDIT: Your implementation seems a bit different from mine. This is what I'm getting with my Cg shader on PS3:
Attached Images
File Type: jpg SNES9x PS3_6.JPG (207.0 KB, 195 views)

Last edited by Hyllian; April 5th, 2012 at 13:13..
Hyllian is offline   Reply With Quote
Reply

Tags
epsxe, plugins, shaders

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 04:07.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.