Emuforums.com

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


Reply
 
LinkBack Thread Tools Display Modes
Old April 2nd, 2007   #81 (permalink)
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 107
Quote:
Originally Posted by guest.r View Post
In fact, such a shader could be made under PS 3.0 conditions.
The patterns should be well re-defined and analysed.
Even an arbitrary Sai(SuperSai, SuperEagle) could be made. Why not.
But the process of making would require much intelectual work.
The direct port is not an adequate option.
Example of guest.r intellectual work:
take the ShadX-Maruke shader, modify few lines of code (not the algorithm, of course), present it as "guest.r AA" shader under GPL... interesting!
SimoneT is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old April 2nd, 2007   #82 (permalink)
guest.r
 
guest.r's Avatar
 
Join Date: Mar 2006
Location: EU
Posts: 221
How the shaders were posted (chronological).



11.9.2005:

// BQ2X shader
// by guest(r)

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
uniform sampler2D OGL2Texture;
varying float y;

void main()
{
vec2 d1 = vec2( OGL2Param.x,y);
vec2 d2 = vec2(-OGL2Param.x,y);
vec2 c0 = gl_TexCoord[0].xy - d1;
vec2 c1 = gl_TexCoord[0].xy - d2;
vec2 c2 = gl_TexCoord[0].xy + d2;
vec2 c3 = gl_TexCoord[0].xy + d1;

vec3 c00 = texture2D(OGL2Texture, c0).xyz;
vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
vec3 c20 = texture2D(OGL2Texture, c1).xyz;
vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
vec3 c02 = texture2D(OGL2Texture, c2).xyz;
vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
vec3 c22 = texture2D(OGL2Texture, c3).xyz;

vec3 dottie = vec3(1.0,1.0,1.0);
vec3 L = (c00+c01+c02)/3.0;
vec3 R = (c20+c21+c22)/3.0;
vec3 U = (c00+c10+c20)/3.0;
vec3 D = (c02+c12+c22)/3.0;

float wl = dot(abs(L-c11),dottie);
float wr = dot(abs(R-c11),dottie);
float wu = dot(abs(U-c11),dottie);
float wd = dot(abs(D-c11),dottie);

gl_FragColor.xyz = (wr*L+wl*R+wd*U+wu*D)/(wl+wr+wu+wd);
}

The remains of the thread the shader was posted in:

Experimental 2x GLSL shader - Pete`s Messageboard Forum

It looked nice with buggy catalyst 5.7.
Nowdays it produces black texels on zero-difference texel surroundings.

Anyhow...on 11.9.2005 i started some research to continue the promising SuperSal and the potentialy good SuperScaler...


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


ShadX Last Shader: (posted by ShadX)

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

void main()
{
vec4 offsety;

offsety=vec4(0.0,OGL2Param.y,0.0,0.0);

vec4 texel[9];
texel[0] = texture2DProj(OGL2Texture,gl_TexCoord[0]);
texel[1] = texture2DProj(OGL2Texture,gl_TexCoord[1]);
texel[2] = texture2DProj(OGL2Texture,gl_TexCoord[2]);
texel[3] = texture2DProj(OGL2Texture,gl_TexCoord[3]);
texel[4] = texture2DProj(OGL2Texture,gl_TexCoord[4]);
texel[5] = texture2DProj(OGL2Texture,gl_TexCoord[1] + offsety);
texel[6] = texture2DProj(OGL2Texture,gl_TexCoord[2] - offsety);
texel[7] = texture2DProj(OGL2Texture,gl_TexCoord[1] - offsety);
texel[8] = texture2DProj(OGL2Texture,gl_TexCoord[2] + offsety);

float diff[4];
diff[0] = dot(texel[1] - texel[2],texel[1] - texel[2]);
diff[1] = dot(texel[3] - texel[4],texel[3] - texel[4]);
diff[2] = dot(texel[5] - texel[6],texel[5] - texel[6]);
diff[3] = dot(texel[7] - texel[8],texel[7] - texel[8]);

float min;
min = min(diff[0],diff[1]);
min = min( min,diff[2]);
min = min( min,diff[3]);

if (min == diff[0])
gl_FragColor = (texel[0]+texel[1]+texel[2])/3.0;

else
if (min == diff[1])
gl_FragColor = (texel[0]+texel[3]+texel[4])/3.0;

else
if (min == diff[2])
gl_FragColor = (texel[0]+texel[5]+texel[6])/3.0;

else
/* if (min == diff[3]) */
gl_FragColor = (texel[0]+texel[7]+texel[8])/3.0;
}


2xGLSL shader:

// 2xGLSL shader 2.0
// by guest(r)

uniform sampler2D OGL2Texture;
uniform vec4 OGL2Param;
varying vec2 dg2;

void main()
{
vec2 c1 = gl_TexCoord[0].xy - dg2;
vec2 c2 = gl_TexCoord[0].xy + dg2;

vec3 c00 = texture2D(OGL2Texture, gl_TexCoord[5].xy).xyz;
vec3 c10 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
vec3 c20 = texture2D(OGL2Texture, c1).xyz;
vec3 c01 = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz;
vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
vec3 c21 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
vec3 c02 = texture2D(OGL2Texture, c2).xyz;
vec3 c12 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
vec3 c22 = texture2D(OGL2Texture, gl_TexCoord[6].xy).xyz;

vec3 dottie = vec3(1.0,1.0,1.0);

float d1=dot(abs(c00-c22),dottie);
float d2=dot(abs(c02-c20),dottie);
float hr=dot(abs(c01-c21),dottie);
float vt=dot(abs(c10-c12),dottie);

float d = abs(d1-d2);
float r = abs(hr-vt);
float w1 = step(d1,d2)*d;
float w2 = step(d2,d1)*d;
float w3 = step(hr,vt)*r;
float w4 = step(vt,hr)*r;

float ww = w1+w2+w3+w4;
float wx = ww+OGL2Param.x;

gl_FragColor.xyz = (w1*(c00+c22)+w2*(c20+c02)+w3*(c01+c21)+w4*(c10+c1 2)+wx*c11)/(2.0*ww+wx);
}



ShadX-Maruke new: (posted by ShadX)

uniform sampler2D OGL2Texture;
uniform vec4 OGL2Size;
void main(){
vec4 h;
vec3 c0,c1,c2,c3,c4,c5,c6,c7,c8;

c4 = texture2D(OGL2Texture,gl_TexCoord[0].xy).rgb;
c0 = texture2D(OGL2Texture,gl_TexCoord[0].zw).rgb;
c6 = texture2D(OGL2Texture,gl_TexCoord[1].xy).rgb;
c1 = texture2D(OGL2Texture,gl_TexCoord[2].xy).rgb;
c7 = texture2D(OGL2Texture,gl_TexCoord[3].xy).rgb;
c3 = texture2D(OGL2Texture,gl_TexCoord[4].xy).rgb;
c5 = texture2D(OGL2Texture,gl_TexCoord[5].xy).rgb;
c2 = texture2D(OGL2Texture,gl_TexCoord[6].xy).rgb;
c8 = texture2D(OGL2Texture,gl_TexCoord[7].xy).rgb;

h=vec4(dot(c1-c2,c1-c2),dot(c3-c4,c3-c4),dot(c5-c6,c5-c6),dot(c7-c8,c7-c8));
h=step(h,vec4(min(min(h.x,h.y),min(h.z,h.w))));
gl_FragColor.rgb=(c0+((c1+c2)*h.x+(c3+c4)*h.y+(c5+ c6)*h.z+(c7+c8)*h.w)/dot(h,h))*0.333;
}

I'm beginning to understand where the misunderstandings might root.

I corrected my shaders.

regards, guest.r

Last edited by guest.r; April 24th, 2007 at 09:29..
guest.r is offline   Reply With Quote
Old April 3rd, 2007   #83 (permalink)
ZSNES & ePSXe Beta Tester
 
GreenImp's Avatar
 
Join Date: Feb 2002
Posts: 85
I see a difference in each of their code approach. I thought Shad X & guest.r were net buddies sharing & learning from each other's code. Or am I wrong? I hope that's not the case the are both talented programmers in my eyes.

Anyway I have a question, and a screen shot for guest.r show how pretty his 4xGLSLHqFilter shader looks on Ogre Battle - Limited Edition. ;P

Out of curiosity. Why do you use x2048 y1024 on these floats...
float x = (OGL2Size.x/2048.0)*OGL2Param.x;
float y = (OGL2Size.y/1024.0)*OGL2Param.y;
...instead of a number that's a multiple of 320x240 like x2240 y1120, x2080 y1080, x1920 y960, ect. since you're targeting that screen dimension that's 640x480/1280x960 for your shaders?

When I've used:
float x = (OGL2Size.x/2240.0)*OGL2Param.x;
float y = (OGL2Size.y/1120.0)*OGL2Param.y;
...I use this on 4xGLSLHqFilter, this is the calculation in the screen shot, and x2080 y1080 on a few of your other shaders I got much better results when I have the the Shader level: "4: Maximum"

Sorry about the screen shot being 1280x720. It looks nice on my monitor, and I can run the refresh rate @ 120 Hz while keeping it a dimension that's a multiple of 320x240 since that's what Ogre Battle runs at. =P


Here's my settings on Pete's OpenGL2 if ya wanna know:

Plugin: Pete's OpenGL2 Driver 2.8
Author: Pete Bernert
Card vendor: NVIDIA Corporation
GFX card: GeForce 7600 GT/AGP/SSE/3DNOW!

Resolution/Color:
- 1280x720 Fullscreen - NO desktop changing
- Internal X resolution: 2
- Internal Y resolution: 2
- Keep psx aspect ratio:
- No render-to-texture: off

- Filtering: 2
- Hi-Res textures: 2
- TexWin pixel shader: off
- VRam size: 0 MBytes

Framerate:
- FPS limitation: on
- Frame skipping: off
- FPS limit: Auto

Compatibility:
- Offscreen drawing: 0
- Framebuffer effects: 0
- Framebuffer uploads: 0

Misc:
- Scanlines: on [-1]
- Mdec filter: on
- Screen filtering: on
- Shader effects: 5/4
- Flicker-fix border size: 0
- GF4/XP crash fix: off
- Game fixes: off [00000000]
Attached Images
File Type: jpg Ogre Battle - Limited Edition.jpg (289.6 KB, 1175 views)
__________________
-GreenImp

GreenImp's ePSXe Doc

OS: Windows XP professional (SP2) CPU: AMD Atholon 64 X2 Dual Core 4200+ Graphics Card: PNY GeForce 9800 GT XLR8 PE (1GB GDDR3 - PCI-E x16) Memory: 1 GB DDR2 Corsair Sound Card: Sound Blaster Live! value Mobo: ASUS M2N32-SLI Deluxe (NVIDIA nForce 590 SLI MCP)

Last edited by GreenImp; April 3rd, 2007 at 05:03..
GreenImp is offline   Reply With Quote
Old April 3rd, 2007   #84 (permalink)
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 107
Quote:
Originally Posted by GreenImp View Post
I see a difference in each of their code approach. I thought Shad X & guest.r were net buddies sharing & learning from each other's code. Or am I wrong?...
You are right, this is the reason why ShadX never put a license over its shaders.
Putting a license, even if it's a GPL license, means that the code has been written only by him, and this is wrong.
And this is also the reason why ShadX has deleted all its shaders from the Pete's forum.
Ciao
SimoneT is offline   Reply With Quote
Old April 3rd, 2007   #85 (permalink)
guest.r
 
guest.r's Avatar
 
Join Date: Mar 2006
Location: EU
Posts: 221
"Out of curiosity. Why do you use x2048 y1024 on these floats..."

The OGL2 texturesize is a multiple of (1024,512).
Though the aspect ratio must stay correct for the optimal effect.
If the aspect is altered, altering theese values might correct the effect, that's true.
I could have used like 0.125*(1/1024,1/512), 0.25*(1/1024,1/512)...
But the end effect with my current lines is the same.

Why GPL?
It's the most common custom to give a scaler (or a fullscreen filter) under the GPL if it's meant to be used with an emulator.

The author of the 2xSai engine, for example, observed "eagle" and his engine, wrote his own filter and then published his works under the GPL.

I like GPL because it's quite liberal and any interested coder may continue where a previous one finished.

About puting on limitations of what can and what can't be written or published:

Shaders are simple programs and there are some common tasks (convolution filters, resizers, AA, scalers, color adj....) in fullscreen postprocessing. Saying what one can and can't code would mean (legaly) to abnegate every single shader writer in certain communities - if he publishes something.

I would rather say one must stay legal, which is currently not to hard in EU.

"And this is also the reason why ShadX has deleted all its shaders from the Pete's forum."

If ShadX would decide to publish his shaders - and if he (re)codes the code by himself, that would IMO be legal in the EU - something like OpenOffice style.
guest.r is offline   Reply With Quote
Old April 3rd, 2007   #86 (permalink)
ZSNES & ePSXe Beta Tester
 
GreenImp's Avatar
 
Join Date: Feb 2002
Posts: 85
OK. I see. I'll mess around with the values again to see what other results I might get. Is there a good site or docs I can get for programming my own shader. Like to the very basics explaining the matrix/vector. I've attempted to make my one, but all I get is a black screen. I tried multiplying my output values too, just to get a gray or white screen, but had no luck. lol I have some programming knowledge, but I'm a bit clueless to how I'm effecting the matrix/vector let alone what exactly a matrix or vector is on a shader. I'm assuming the matrix is a grid & the vector is the section of the matrix. Or I'm a total noob & I'm way off on my assumption. =P
__________________
-GreenImp

GreenImp's ePSXe Doc

OS: Windows XP professional (SP2) CPU: AMD Atholon 64 X2 Dual Core 4200+ Graphics Card: PNY GeForce 9800 GT XLR8 PE (1GB GDDR3 - PCI-E x16) Memory: 1 GB DDR2 Corsair Sound Card: Sound Blaster Live! value Mobo: ASUS M2N32-SLI Deluxe (NVIDIA nForce 590 SLI MCP)
GreenImp is offline   Reply With Quote
Old April 3rd, 2007   #87 (permalink)
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 107
Quote:
Originally Posted by GreenImp View Post
OK. I see. I'll mess around with the values again to see what other results I might get. Is there a good site or docs I can get for programming my own shader. Like to the very basics explaining the matrix/vector. I've attempted to make my one, but all I get is a black screen. I tried multiplying my output values too, just to get a gray or white screen, but had no luck. lol I have some programming knowledge, but I'm a bit clueless to how I'm effecting the matrix/vector let alone what exactly a matrix or vector is on a shader. I'm assuming the matrix is a grid & the vector is the section of the matrix. Or I'm a total noob & I'm way off on my assumption. =P
Some links:

OpenGL Shading Language @ Lighthouse 3D - GLSL Tutorial

OpenGL Shading Language

NeHe Productions: OpenGL Article #21

GLSL Shaders - Introduction

Ciao.
SimoneT is offline   Reply With Quote
Old April 4th, 2007   #88 (permalink)
ZSNES & ePSXe Beta Tester
 
GreenImp's Avatar
 
Join Date: Feb 2002
Posts: 85
I hope you don't mind me picking at your guys brains some more. Got a few more questions.
So I take it OGL2Size OGL2Param & OGL2Texture are specific to Pete's GPU. What do they mean, and Are there any others? Also is there a way to see the value of those?

SimoneT - Thanx for the great links. Finally an explination of what some of the commands do, but at the same time I'm getting more confused by the moment. lol The one link with the PDFs you posted was all I could find googling. =P Hopefully I'll have some sort of shader here soon to post. =)


guest.r - Thanx for your responses, and great shaders. I'm glad you're still actively updating them.
After some more value tinkering I understand what I effected causing an interesting result in your 4xGLSLHqFilter - Full shader.

Here's the new tweaked values:
float x = (OGL2Size.x/2240.0)*OGL2Param.x;
float y = (OGL2Size.y/1240.0)*OGL2Param.y;

Everything lines up correctly now when the fullscreen filter is enabled in many different screen modes, and this allows Shader level: "4:Maximum" to produce a better quality image.

The down side is 1280x960 no longer lines up when the fullscreen filter is disabled, but if you want add a fullscreen filter friendly version of your shader then try it out & see if I'm crazy or not. ;P

Lata.
__________________
-GreenImp

GreenImp's ePSXe Doc

OS: Windows XP professional (SP2) CPU: AMD Atholon 64 X2 Dual Core 4200+ Graphics Card: PNY GeForce 9800 GT XLR8 PE (1GB GDDR3 - PCI-E x16) Memory: 1 GB DDR2 Corsair Sound Card: Sound Blaster Live! value Mobo: ASUS M2N32-SLI Deluxe (NVIDIA nForce 590 SLI MCP)
GreenImp is offline   Reply With Quote
Old April 4th, 2007   #89 (permalink)
guest.r
 
guest.r's Avatar
 
Join Date: Mar 2006
Location: EU
Posts: 221
Yep, GPL is nice.
It allows a programmer to tweak the code by himself without asking for permission.

Though it must be stated who made the changes and when they were made.

You can also produce/publish your own derivates of the shaders/pack.

regards, guest.r

Last edited by guest.r; April 11th, 2007 at 19:30..
guest.r is offline   Reply With Quote
Old April 12th, 2007   #90 (permalink)
Registered User
 
Join Date: Feb 2007
Location: NST
Posts: 2
a few bump mapping shaders with pseudo bloom lighting. Shader III at max in the screenshots 1 and 2. Shader I at max in castlevania shot
Attached Images
File Type: jpg noshader.jpg (155.4 KB, 1176 views)
File Type: jpg shader.jpg (220.1 KB, 1251 views)
File Type: jpg PSOGL2_001.jpg (156.0 KB, 1159 views)
File Type: jpg PSOGL2_002.jpg (110.3 KB, 1001 views)
File Type: jpg PSOGL2_003.jpg (125.7 KB, 921 views)
File Type: jpg PSOGL2_004.jpg (117.7 KB, 938 views)
Attached Files
File Type: zip BumpBloom.zip (5.0 KB, 551 views)

Last edited by Zodav; April 13th, 2007 at 20:20.. Reason: updated shader IV
Zodav is offline   Reply With Quote
Old April 13th, 2007   #91 (permalink)
Not so likeable!
 
SimoneT's Avatar
 
Join Date: Feb 2004
Location: Torino (Italy)
Posts: 107
Quote:
Originally Posted by Zodav View Post
a few bump mapping shaders with pseudo bloom lighting. Shader III at max in the screenshots 1 and 2. Shader I at max in castlevania shot
I like It!!!!!!
Good job Zodav!!!!
Ciao
SimoneT is offline   Reply With Quote
Old April 13th, 2007   #92 (permalink)
Registered User
 
Join Date: Feb 2007
Location: NST
Posts: 2
Quote:
Originally Posted by SimoneT View Post
I like It!!!!!!
Good job Zodav!!!!
Ciao
Thanks

and I've updated shader IV...
Zodav is offline   Reply With Quote
Old April 19th, 2007   #93 (permalink)
Registered User
 
Join Date: Apr 2007
Location: Neverland
Posts: 15
I can't find the Peter's OpenGL2Plugin configuration...
Can anyone help me?
Flying Doc is offline   Reply With Quote
Old April 19th, 2007   #94 (permalink)
.!. (^.^) .!.
 
darth sephiroth's Avatar
 
Join Date: Jan 2006
Location: You're looking at it right now.
Posts: 2,017
uuhhhh, did you try config->video?
__________________

"Going too far is going almost all the way around the world, then turn around to go back" - me
"He's not going too far, he's going around the world" - me
"They're looking for a factbook in the fiction section of the library." - me
"I find spam useless and fatally contradictive to its own existence." - me
darth sephiroth is offline   Reply With Quote
Old April 19th, 2007   #95 (permalink)
Registered User
 
Join Date: Apr 2007
Location: Neverland
Posts: 15
Yes now I did... i think I just overlooked it or something it's a bit stupid :P
But why does my screen turn black when I open a game??? It stays like that forever if I don't close the emulator...

( I am not sure if I have to open a new topic for my next question since there already is one but it's 4 years old...) but when I open an ISO in epsxe it just this black screen from my previous post while in AdriPSX it says: unsupported MIPS CPU instruction...

Last edited by Flying Doc; April 19th, 2007 at 19:24.. Reason: Automerged Doublepost
Flying Doc is offline   Reply With Quote
Old April 21st, 2007   #96 (permalink)
Registered User
 
Join Date: Mar 2007
Location: e
Posts: 2
whats the best shader to use for FFVII that doesn't cause the red,green,ect lines to appear on the enviorment
mistating is offline   Reply With Quote
Old April 29th, 2007   #97 (permalink)
Registered User
 
Join Date: Aug 2005
Location: Italy
Posts: 111
i think that the best shaders are cartoon shaders and bumpmap
what do you think?
djsolidsnake86 is offline   Reply With Quote
Old April 30th, 2007   #98 (permalink)
Registered User
 
Join Date: Apr 2007
Location: Spain
Posts: 37
Excuse me, but what the hellīs that code, guest?
Thank you
Mangetsu is offline   Reply With Quote
Old April 30th, 2007   #99 (permalink)
guest.r
 
guest.r's Avatar
 
Join Date: Mar 2006
Location: EU
Posts: 221
Quote:
Originally Posted by Mangetsu View Post
Excuse me, but what the hell´s that code, guest?
Thank you
I shared my WIP work for some time with the community. But people got confused what's WIP and whats an end product.

I posted some WIP works again to show the coding progress by myself and ShadX between 11.9.2005 and 25.9.2005.
Attached Files
File Type: zip SaI.zip (8.4 KB, 191 views)

Last edited by guest.r; May 1st, 2007 at 23:14..
guest.r is offline   Reply With Quote
Old May 1st, 2007   #100 (permalink)
Registered User
 
Join Date: Apr 2007
Location: Spain
Posts: 37
I want to know if there´s a .zip version of this Shader, please
2xSaI GLSL shader - Pete`s Messageboard Forum
Thank ya, Guest!

Last edited by Mangetsu; May 3rd, 2007 at 21:31..
Mangetsu is offline   Reply With Quote
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:37.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5