<ShadX> unregistried
| Created on 20.01.2005 - 11:00 |  |
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  Real addict
  

Status:Offline Date registered: 20.01.2005 Post:267 Send Message | Created on 20.01.2005 - 15:23 |  |
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); } }
|