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

guest ...
Real addict
.........

...

Status:Offline
Date registered: 30.07.2004
Post:856
Send Message
...   Created on 06.05.2005 - 10:48Jump to top Quote this post Report this post Edit Delete


A bit faster.

vertex file:

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
varying vec2 dg2;
void main()

{
float z = 2.0*(OGL2Size.y/OGL2Size.x);
float x = OGL2Param.x;
float y = OGL2Param.y*z;
vec2 dg1 = vec2( OGL2Param.x,y);
dg2 = vec2(-OGL2Param.x,y);
vec2 dx = vec2(x,0.0);
vec2 dy = vec2(0.0,y);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1].xy = gl_TexCoord[0].xy - dy;
gl_TexCoord[2].xy = gl_TexCoord[0].xy + dy;
gl_TexCoord[3].xy = gl_TexCoord[0].xy - dx;
gl_TexCoord[4].xy = gl_TexCoord[0].xy + dx;
gl_TexCoord[5].xy = gl_TexCoord[0].xy - dg1;
gl_TexCoord[6].xy = gl_TexCoord[0].xy + dg1;
}

fragment file

// 3x3 Gaussian blur shader

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;


gl_FragColor.xyz = (c00+c20+c20+c22+2.0*(c10+c01+c21+c12)+4.0*c11)*0.0625;
}

[Dieser Beitrag wurde am 08.11.2005 - 13:51 von guest aktualisiert]




<Gundam>
unregistried

...   Created on 11.10.2005 - 19:12Jump to top Quote this post Report this post Edit Delete


test this:
!!ARBfp1.0

TEMP c11, c10, c21, c12, c01, t1, d, m, w;

PARAM dt = { 1.0, 1.0, 1.0, 1.0};
PARAM t = { 0.1, 0.1, 0.1, 0.1};
PARAM zero = {0.0, 0.0, 0.0, 0.0};

TEX c11, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX c10, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX c21, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX c12, fragment.texcoord[ 3 ], texture[ 0 ], 2D;
TEX c01, fragment.texcoord[ 4 ], texture[ 0 ], 2D;

# compute SaL rule application
SUB t1, c10, c11;
ABS t1, t1;
DP4 d.x, t1, dt;

SUB t1, c21, c11;
ABS t1, t1;
DP4 d.y, t2, dt;

SUB t1, c12, c11;
ABS t1, t1;
DP4 d.z, t3, dt;

SUB t1, c01, c11;
ABS t1, t1;
DP4 d.w, t1, dt;

# compute & apply weights

MAX m.x, d.x, d.z;
MAX m.y, d.y, d.w;

MAX w.x, m.y, d.z;
MAX w.y, m.x, d.w;
MAX w.z, m.y, d.x;
MAX w.w, m.x, d.y;

MUL t1, C11, t;
MAD t1, c10, w.xxxx, t1;
MAD t1, c21, w.yyyy, t1;
MAD t1, c12, w.zzzz, t1;
MAD t1, c01, w.wwww, t1;

DP4 w.x, w, dt;
ADD w.x, w.x, 0.1;
RCP w, w.x;

MUL result.color, t1, w;

END

Bye...





Similarly threads:
Topics Created by Replies Boardname
Radial blur shader from SimoneT ShadX 0 pete_bernert
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
SSX Blur Rafi 0 wii
Blur... footi 26 baroness_strange
Blur Edit 18 d_rocs
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:
3x3 gaussian | !!arbfp1.0 gaussian blur | shader gaussian blur | gaussian blur shader | arbfp1 gaussian blur | shader gaussian | arbfp1.0 gaussian blur | gaussian blur arbfp1.0
blank