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 23.11.2004 - 13:45Jump to top Quote this post Report this post Edit Delete


.slv

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
varying vec2 TCoord;

void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

TCoord = gl_MultiTexCoord0.xy;

}

.slf

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
uniform sampler2D OGL2Texture;
varying vec2 TCoord;

void main()
{
float offsetx = 1.0/OGL2Size.x;
float offsety = 1.0/OGL2Size.y;
float param = OGL2Param.z;
float tmp;
vec3 togray;


togray.x = 0.10000000;
togray.y = 0.19666667;
togray.z = 0.03666667;

vec4 c = texture2D(OGL2Texture, TCoord); //center
vec4 bl = texture2D(OGL2Texture, TCoord + vec2(-offsetx,-offsety)); //bottom-left
vec4 l = texture2D(OGL2Texture, TCoord + vec2(-offsetx, 0.0)); //left
vec4 tl = texture2D(OGL2Texture, TCoord + vec2(-offsetx, offsety)); //top-left
vec4 t = texture2D(OGL2Texture, TCoord + vec2( 0.0, offsety)); //top
vec4 tr = texture2D(OGL2Texture, TCoord + vec2( offsetx, offsety)); //top-right
vec4 r = texture2D(OGL2Texture, TCoord + vec2( offsetx, 0.0)); //right
vec4 br = texture2D(OGL2Texture, TCoord + vec2( offsetx, offsety)); //bottom-right
vec4 b = texture2D(OGL2Texture, TCoord + vec2( 0.0,-offsety)); //bottom

vec4 border = (bl - c) + (l - c) + (tl - c) + (t - c) + (tr - c) + (r - c) + (br - c) + (b - c);

tmp = (border.x * togray.x + border.y * togray.y + border.z * togray.z);

if ( tmp >= (0.4 - 0.1 * param))

gl_FragColor = (c + bl + l + tl + t + tr + r + br + b)/9.0;
}




<ShadX>
unregistried

...   Created on 25.11.2004 - 13:58Jump to top Quote this post Report this post Edit Delete


Hi Guest
for example:
if ( tmp >= (0.3 - 0.1 * param))...
have you tried this?
what do you think about?
Bye




<ShadX>
unregistried

...   Created on 25.11.2004 - 15:50Jump to top Quote this post Report this post Edit Delete


correction...

.slf

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;
uniform sampler2D OGL2Texture;
varying vec2 TCoord;

void main()
{
float offsetx = 1.0/OGL2Size.x;
float offsety = 1.0/OGL2Size.y;
float param = OGL2Param.z;
float tmp;
vec3 togray;


togray.x = 0.30;
togray.y = 0.59;
togray.z = 0.11;

vec4 c = texture2D(OGL2Texture, TCoord); //center
vec4 bl = texture2D(OGL2Texture, TCoord + vec2(-offsetx,-offsety)); //bottom-left
vec4 l = texture2D(OGL2Texture, TCoord + vec2(-offsetx, 0.0)); //left
vec4 tl = texture2D(OGL2Texture, TCoord + vec2(-offsetx, offsety)); //top-left
vec4 t = texture2D(OGL2Texture, TCoord + vec2( 0.0, offsety)); //top
vec4 tr = texture2D(OGL2Texture, TCoord + vec2( offsetx, offsety)); //top-right
vec4 r = texture2D(OGL2Texture, TCoord + vec2( offsetx, 0.0)); //right
vec4 br = texture2D(OGL2Texture, TCoord + vec2( offsetx, offsety)); //bottom-right
vec4 b = texture2D(OGL2Texture, TCoord + vec2( 0.0,-offsety)); //bottom

vec4 border = (bl - c) + (l - c) + (tl - c) + (t - c) + (tr - c) + (r - c) + (br - c) + (b - c);

tmp = (border.x * togray.x + border.y * togray.y + border.z * togray.z);

if ( tmp >= (0.4 - 0.1 * param)) // or (tmp >= 0.3 - 0.1 * param)

gl_FragColor = (c + bl + l + tl + t + tr + r + br + b)/9.0;
}




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

...

Status:Offline
Date registered: 30.07.2004
Post:856
Send Message
...   Created on 30.07.2005 - 11:15Jump to top Quote this post Report this post Edit Delete


There are manny nice shaders on this board which are not yet fully optimised.

I, on my behalf, am thinking about making a revision and add better texel maping and so.

With swizzling or diagonal-coord-sharing speedups up to 30% can be achieved.

PS: Perhaps Pete could help you out to delete the "obsolete" shaders of the ShadX(nr).




Superman 
Strong supporter
......

...

Status:Offline
Date registered: 25.06.2005
Post:24
Send Message
...   Created on 15.08.2005 - 18:35Jump to top Quote this post Report this post Edit Delete


I like it



[Dieser Beitrag wurde am 15.08.2005 - 18:41 von Superman aktualisiert]





Similarly threads:
Topics Created by Replies Boardname
Simple blur GLSLang program 2 pete_bernert
3x3 Gaussian blur shader guest 1 pete_bernert
Radial blur shader from SimoneT ShadX 0 pete_bernert
Edge directed blur Evolution ShadX 2 pete_bernert
Chris Edge Enhancement Shader maruke 11 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:
edge directed blur
blank