| Author | Topics » Book an abo for this thread |  |
LargeCoke

Status:Offline Date registered: 27.06.2005 Post:2 Send Message | Created on 27.06.2005 - 15:29 |  |
Before I get goin' here, I'd like to say while I am extremely interested in programmable shaders, emulation, and most importantly, visual tech, I don't have the inclination to learn how to utlize or execute any of these beyond a setup program or copy/paste. 
Lots of talent in here, and not to exclude anyone, but Guest (the registered Guest and ShadX have been working like mad men. Kudos to everyone. You are (to me) making the PSX emu scene all the more interesting.
One thing that is disappointing, however, are the abundance of blurs/smoothing. Given, any of these projects are for the author's edification, if nothing else, and I don't mean to suggest I am not grateful for sharing. So let's not jump to conclusions and assume I am suggesting no one pursue programming blur shaders that are executed in a different manner from any other shader. In fact, I encourage it. Learning how something works and applying it is great!
It is a little discouraging on the other hand. There are so many fun things that can be accomplished via programmable shaders. This is where you guys can get really creative! ShadX had a really fun pencil shader! I can't remember the author (or the name of the shader) but there was another fun shader that sort of casued everything look look like it was from Tron, or made from colored/crumpled wire. Very fun stuff!
Ultimately, as neat as these shaders are they aren't entirely functional. I do understand it would be near impossible to program a shader that should produce a general stylized apearance and produce a playable experience with each and every game, but how about some game specific filters? No, I will not make requests, because you're the folks making them, but I will shoot out some ideas so I don't sound critical.
Story book shader: Could be an extremely simple multi-texture layer that is comprised of two or three targa files which the shader will interpolate between and then blend. Think Wild Arms 3 for PS2. Sans the comic shading, it could be a neat filter for some RPGs, or even some comical 2D platformers. Really depends on the end user and whether or not the 'paper' which the filter emulates seems to be fitting of the themes. Could even use the shader to manipulate colors, if you wanted to go to that extreme. Maybe give everything a pastel/water color apearance. If nothing else, scale the intensity, or apply multiple multiple texture interpolations with each shader level such that each can produce different 'paper'. One game may look better on cleaner, less gritty paper, while another may seem far more fitting on a few coarse paper.
Motion Blur. Why not?! Every racing game should have a good motion blur. Even if it's just a good ol' frame buffer hack. I suppose this works contrary to my complaint with so many blurs, but... in my defense, I think of this as a "stylized" blur. But seriously, motion blur is one of those rough effects to emulate in real-time graphics. HDR lighting(?) makes it possible, but that by itself is process intensive. An example of possible execution would be a star burst distorion. Pixels torward the center of the screen can retain most, if not all of their integrity, while pixels further and further away become interpolated with their adjacent pixels more and more the closer they are to the edge of the screen. Pixels in the very corner could feasibly be interpolated with the next 8-20. Who knows, but it could be a fun project for the programmer. 
Old movie 'filters'. Not black and white, mind you. Just highly unsaturated. Why stop there, however? Throw in some pops and blemishes during the process. Dust, scratches, even cue markers every 30 minutes or so (those dots that pop up in the top corners). Probably won't have any application beyond nostalgia, but isn't that a big motivator for emulation? 
Anyway, I am not the programmer, but I thought I would throw out a couple of ideas incase anyone was getting a little spent on what to do with their talents. Everyone IS doing a fantastic job around here, and I really appreciate so much code being shared! I guess "job" isn't the correct word, since most of you are probably doing this out of love, but you get the idea, right? 
Keep it up. It's efforts like these which keeping me coming back to replay all my old favorites time and time again... that and bordom, but you are the kinda folks who make reliving those experiences new and exciting again. 
|
|
|
guest  Real addict
  

Status:Offline Date registered: 30.07.2004 Post:856 Send Message | Created on 27.06.2005 - 17:43 |  |
Aye!
There is something in your words. Writing a shader isn't just about improoving the gameplay experience for dedicated gamers, but it is also to achieve an artistic experience in realtime and motion otherwise seen only in photoshop or an art galery (or with the third eye )
I will repost the dark aura shader since it comes into this cathegory of "artistic" shaders. (The original had some bugs and is a bit lost somewhere in the pages of this board.)
Dark Aura Shader:
vertex file
uniform vec4 OGL2Param; uniform vec4 OGL2Size; void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[1] = gl_TexCoord[0]; gl_TexCoord[2] = gl_TexCoord[0]; gl_TexCoord[4] = gl_TexCoord[0]; gl_TexCoord[5] = gl_TexCoord[0]; gl_TexCoord[1].y-=OGL2Param.y; gl_TexCoord[2].y+=OGL2Param.y; gl_TexCoord[4].x-=OGL2Param.x; gl_TexCoord[5].x+=OGL2Param.x; }
fragment file
// Dark aura shader // Play only with games with hero in center  // by guest(r)
uniform vec4 OGL2Param; uniform vec4 OGL2Size; uniform sampler2D OGL2Texture; void main() {
// write your screen resolution here vec2 res = vec2(1154.0, 864.0); // current screen resolution
vec2 dxdy1 = vec2( OGL2Param.x,OGL2Param.y); vec2 dxdy2 = vec2(-OGL2Param.x,OGL2Param.y);
vec2 c = gl_FragCoord.xy; float p = res.x*0.5; float q = res.y*0.5; float d = (c.x-p)*(c.x-p) + (c.y-q)*(c.y-q); // distance from center d = sqrt(d);
float a = (OGL2Param.z+1.0)*0.1; float k = 0.5 - d/(1.2*p) + a;
vec3 ct = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz; vec3 lxuy = texture2D(OGL2Texture, gl_TexCoord[0].xy - dxdy1).xyz; vec3 uy = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz; vec3 rxuy = texture2D(OGL2Texture, gl_TexCoord[0].xy - dxdy2).xyz; vec3 lx = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz; vec3 rx = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz; vec3 lxdy = texture2D(OGL2Texture, gl_TexCoord[0].xy + dxdy2).xyz; vec3 dy = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz; vec3 rxdy = texture2D(OGL2Texture, gl_TexCoord[0].xy + dxdy1).xyz;
gl_FragColor.xyz = (1.0 + 3.0*k)*ct - k*(lx + rx + uy + dy + 0.5*(lxuy + rxuy + lxdy + rxdy)) + (1.0+2.0*a) *(ct-0.7*lxuy);
}
PS: and thanks for the suggestions. In fact i was really waiting for some inspiration how to use the new aditional texturing unit options. 
PPS: With some shaders of mine (MultipowerSE, The Definite Shader...) you can actualy change the brightnes, saturation and contrast (like on the color TV - so there is allready an ole movie shader if you want to customize it in this way ). And that even when ingame. Just press ESC, change the values in the fragment file, save the file and continue to play. 
I also taught of writing shaders for specific games but the truth is you don't need so manny. (some shaders are customizable).
Personaly i would recommend to use following shaders for playing games. (this may also be of interest for other readers).
1. Emboss shader (also look under GLSL texture lookup topic for a nice variation ) 2. Scale2x shader 3. Gaussian blur shader (3x3 for slower, 5x5 for faster adapters) 4. SuperScaler or SuperSAL shader. 5. Multipower(SE), Diferential contrast, Definite shader.
Some ARB shaders from <luigi> and ShadX may work faster so it is a good thing to use them. There are also some median shaders and on and on.
PPPS: If using shaders under 5. don't forget to read the guide. 
[Dieser Beitrag wurde am 27.06.2005 - 20:48 von guest aktualisiert]
|
LargeCoke

Status:Offline Date registered: 27.06.2005 Post:2 Send Message | Created on 27.06.2005 - 22:00 |  |
Wow. Thanks for all the suggestions. I had checked out the Emboss Shader. Very spiffy stuff. With some tinkering and FS smoothing on some Square games it almost had a neat effect of making everything 2D.
I was pretty intimidated by the Multipwer(SE) shader, but I'll give it another shot. 
Thanks again. If I come up with any other ideas I'll toss them out in this thread. Gotta warn ya that some may or may not be feasible, but it's all about getting the ideas flowing. Maybe it'll get some of the other folks here a completely different idea, which is perfectly fine by me. It's great seeing what everyone comes up with.
Keep it real. I'll be around.
|
ShadX  Real addict
  

Status:Offline Date registered: 20.01.2005 Post:266 Send Message | Created on 04.07.2005 - 15:22 |  |
My "artistic" GLSL Gray Emboss shader:
gpuPeteOGL2.slv
uniform vec4 OGL2Size; uniform vec4 OGL2Param;
void main() { vec4 dsdx = vec4(1.0/OGL2Size.x,0.0,0.0,0.0); vec4 dtdy = vec4(0.0,1.0/OGL2Size.y,0.0,0.0); gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[1] = gl_TexCoord[0] - dsdx; gl_TexCoord[2] = gl_TexCoord[1] + dtdy; gl_TexCoord[3] = gl_TexCoord[2] + dsdx; gl_TexCoord[4] = gl_TexCoord[0] + dsdx; gl_TexCoord[5] = gl_TexCoord[4] - dtdy; gl_TexCoord[6] = gl_TexCoord[5] - dsdx; }
gpuPeteOGL2.slf
uniform sampler2D OGL2Texture; uniform vec4 OGL2Size; uniform vec4 OGL2Param;
void main() { float param = OGL2Param.z; //increasing the shader level increases the effect... vec3 luma = vec3(0.21267,0.71516,0.0721);
float color[7]; color[0] = dot(texture2D(OGL2Texture, gl_TexCoord[0].st).rgb,luma); color[1] = dot(texture2D(OGL2Texture, gl_TexCoord[1].st).rgb,luma); color[2] = dot(texture2D(OGL2Texture, gl_TexCoord[2].st).rgb,luma); color[3] = dot(texture2D(OGL2Texture, gl_TexCoord[3].st).rgb,luma); color[4] = dot(texture2D(OGL2Texture, gl_TexCoord[4].st).rgb,luma); color[5] = dot(texture2D(OGL2Texture, gl_TexCoord[5].st).rgb,luma); color[6] = dot(texture2D(OGL2Texture, gl_TexCoord[6].st).rgb,luma);
float grayemb = param * color[4] + param * color[5] + param * color[6] - param * color[1] - param * color[2] - param * color[3] + color[0];
gl_FragColor = vec4(grayemb, grayemb, grayemb,1.0); }
[Dieser Beitrag wurde am 07.07.2005 - 11:59 von ShadX aktualisiert]
|
ShadX  Real addict
  

Status:Offline Date registered: 20.01.2005 Post:266 Send Message | Created on 04.07.2005 - 16:14 |  |
...and sepia shader:
gpuPeteOGL2.slv
uniform vec4 OGL2Size; uniform vec4 OGL2Param;
void main() { gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0; }
gpuPeteOGL2.slf
//Here is the RGB -> YIQ conversion: // //Y = 0.299*R + 0.587*G + 0.114*B //I = 0.596*R - 0.275*G - 0.321*B //Q = 0.212*R - 0.523*G + 0.311*B // //Here is the YIQ -> RGB conversion: // //R= Y + 0.956*I + 0.621*Q //G= Y - 0.272*I - 0.647*Q //B= Y - 1.105*I + 1.702*Q // // for sepia tone I = 0.2 and Q = 0.0;
uniform sampler2D OGL2Texture;
void main() {
vec3 color = texture2D(OGL2Texture, gl_TexCoord[0].st).rgb;
float Y = dot(vec3( 0.299, 0.587, 0.114),color); //float I = dot(vec3( 0.596,-0.275,-0.321),color); //float Q = dot(vec3( 0.212,-0.523, 0.311),color);
//vec3 ColorYIQ = vec3(Y,I,Q);
float R = Y + 0.1912; //Y + 0.956*I + 0.621*Q; float G = Y - 0.0544; //Y - 0.272*I - 0.647*Q; float B = Y - 0.2210; //Y - 1.105*I + 1.702*Q; gl_FragColor = vec4(R,G,B,0.0);
} Bye
|
ShadX  Real addict
  

Status:Offline Date registered: 20.01.2005 Post:266 Send Message | Created on 07.07.2005 - 12:48 |  |
...and sepia + emboss shader:
gpuPeteOGL2.slv
uniform vec4 OGL2Size; uniform vec4 OGL2Param;
void main() { vec4 dsdx = vec4(1.0/OGL2Size.x,0.0,0.0,0.0); vec4 dtdy = vec4(0.0,1.0/OGL2Size.y,0.0,0.0); gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[1] = gl_TexCoord[0] - dsdx; gl_TexCoord[2] = gl_TexCoord[1] + dtdy; gl_TexCoord[3] = gl_TexCoord[2] + dsdx; gl_TexCoord[4] = gl_TexCoord[0] + dsdx; gl_TexCoord[5] = gl_TexCoord[4] - dtdy; gl_TexCoord[6] = gl_TexCoord[5] - dsdx; }
gpuPeteOGL2.slf
uniform sampler2D OGL2Texture; uniform vec4 OGL2Size; uniform vec4 OGL2Param;
void main() { float param = OGL2Param.z; //increasing the shader level increases the effect... vec3 Y = vec3(0.299,0.587,0.114);
float color[7]; color[0] = dot(texture2D(OGL2Texture, gl_TexCoord[0].st).rgb,Y); color[1] = dot(texture2D(OGL2Texture, gl_TexCoord[1].st).rgb,Y); color[2] = dot(texture2D(OGL2Texture, gl_TexCoord[2].st).rgb,Y); color[3] = dot(texture2D(OGL2Texture, gl_TexCoord[3].st).rgb,Y); color[4] = dot(texture2D(OGL2Texture, gl_TexCoord[4].st).rgb,Y); color[5] = dot(texture2D(OGL2Texture, gl_TexCoord[5].st).rgb,Y); color[6] = dot(texture2D(OGL2Texture, gl_TexCoord[6].st).rgb,Y);
float sepiaemb = param * color[4] + param * color[5] + param * color[6] - param * color[1] - param * color[2] - param * color[3] + param * color[0];
gl_FragColor = vec4((sepiaemb + 0.1912),(sepiaemb - 0.0544),(sepiaemb - 0.2210),1.0); }
Bye
|