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

Homepage Members Register Login Search Old board


Neuer Thread ...


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

<ShadX>
unregistried

...   Created on 20.01.2005 - 11:00Jump to top Quote this post Report this post Edit Delete


gpuPeteOGL2.slv

// blur + emboss GLSL shader
// by ShadX (nr)
// should work with all 3Dlabs Wildcat cards
// may work with nVidia 5x00, 6x00 and Ati Dx9.0+ cards
// looks good with fulscreen smoothing available in Pete's OGL2 plugin
// feel free to use or copy it
// Try different ShaderEffect levels to find the best suiting one

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;

void main()
{

vec4 ne = vec4(-OGL2Param.x,OGL2Param.y,0,0);
vec4 sw = vec4(OGL2Param.x,-OGL2Param.y,0,0);

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_TexCoord[0] + ne;
gl_TexCoord[2] = gl_TexCoord[0] + sw;

}

gpuPeteOGL2.slf

// blur + emboss GLSL shader
// by ShadX (nr)
// should work with all 3Dlabs Wildcat cards
// may work with nVidia 5x00, 6x00 and Ati Dx9.0+ cards
// looks good with fulscreen smoothing available in Pete's OGL2 plugin
// feel free to use or copy it
// Try different ShaderEffect levels to find the best suiting one

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

void main()
{

vec4 dx = vec4(OGL2Param.x,0,0,0);
vec4 dy = vec4(0,OGL2Param.x,0,0);

vec4 colA = texture2DProj(OGL2Texture, gl_TexCoord[1] + dy);
vec4 colB = texture2DProj(OGL2Texture, gl_TexCoord[1] - dx);
vec4 colC = texture2DProj(OGL2Texture, gl_TexCoord[1]);
vec4 colD = texture2DProj(OGL2Texture, gl_TexCoord[0] + dy);
vec4 colE = texture2DProj(OGL2Texture, gl_TexCoord[0] - dx);
vec4 colF = texture2DProj(OGL2Texture, gl_TexCoord[0]);
vec4 colG = texture2DProj(OGL2Texture, gl_TexCoord[0] + dx);
vec4 colH = texture2DProj(OGL2Texture, gl_TexCoord[0] - dy);
vec4 colJ = texture2DProj(OGL2Texture, gl_TexCoord[2]);
vec4 colK = texture2DProj(OGL2Texture, gl_TexCoord[2] + dx);
vec4 colL = texture2DProj(OGL2Texture, gl_TexCoord[2] - dy);

gl_FragColor = 0.2 * colA + 0.2 * colB + 0.2 * colC + colD + colE + 0.2 * colF - colJ - colK - colL;

}




<ShadX>
unregistried

...   Created on 20.01.2005 - 13:11Jump to top Quote this post Report this post Edit Delete


I must admit, Guest has better style than me.




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



Status:Offline
Date registered: 20.01.2005
Post:267
Send Message
...   Created on 20.01.2005 - 15:18Jump to top Quote this post Report this post Edit Delete


Guest, you are likeable...
Now i'm registered...
Bye




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



Status:Offline
Date registered: 20.01.2005
Post:267
Send Message
...   Created on 20.01.2005 - 15:23Jump to top Quote this post Report this post Edit Delete


Guest, only for you...

gpuPeteOGL2.slf

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

void main()
{

vec4 dx = vec4(OGL2Param.x,0,0,0);
vec4 dy = vec4(0,OGL2Param.x,0,0);
vec3 luma = vec3(0.21267,0.71516,0.0721);

float colA = dot((texture2DProj(OGL2Texture, gl_TexCoord[1] + dy).rgb),luma);
float colB = dot((texture2DProj(OGL2Texture, gl_TexCoord[1] - dx).rgb),luma);
float colC = dot((texture2DProj(OGL2Texture, gl_TexCoord[1]).rgb),luma);
vec3 colD = texture2DProj(OGL2Texture, gl_TexCoord[0] + dy).rgb;
vec3 colE = texture2DProj(OGL2Texture, gl_TexCoord[0] - dx).rgb;
vec3 colF = texture2DProj(OGL2Texture, gl_TexCoord[0]).rgb;
vec3 colG = texture2DProj(OGL2Texture, gl_TexCoord[0] + dx).rgb;
vec3 colH = texture2DProj(OGL2Texture, gl_TexCoord[0] - dy).rgb;
float colJ = dot((texture2DProj(OGL2Texture, gl_TexCoord[2]).rgb),luma);
float colK = dot((texture2DProj(OGL2Texture, gl_TexCoord[2] + dx).rgb),luma);
float colL = dot((texture2DProj(OGL2Texture, gl_TexCoord[2] - dy).rgb),luma);

float nw = 0.2 * (colA + colB + colC + dot(colD,luma) + dot(colE,luma));
float se = 0.2 * (dot(colG,luma) + dot(colH,luma) + colJ + colK + colL);

vec3 blur = 0.2 * (colD + colE + colF + colG + colH);

if (OGL2Param.z == 0.0)
{
gl_FragColor = vec4((vec3(nw,nw,nw) - vec3(se,se,se) + colF),1.0);
}
else
if (OGL2Param.z == 1.0)
{
gl_FragColor = vec4((vec3(se,se,se) - vec3(nw,nw,nw) + colF),1.0);
}
else
if (OGL2Param.z == 2.0)
{
gl_FragColor = vec4((vec3(nw,nw,nw) - vec3(se,se,se) + blur),1.0);
}
else
if (OGL2Param.z == 3.0)
{
gl_FragColor = vec4((vec3(se,se,se) - vec3(nw,nw,nw) + blur),1.0);
}
}





Similarly threads:
Topics Created by Replies Boardname
Experimental 2x GLSL shader guest 5 pete_bernert
SharpSmoother GLSL shader guest 3 pete_bernert
Cartoon GLSL shader guest 7 pete_bernert
hq2x GLSL shader ShadX 1 pete_bernert
Scale2x Plus GLSL shader guest 0 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:
glsl blur | blur glsl | glsl blur shader | blur shader glsl | texture2dproj | glsl shader blur | shader blur | blur shader
blank