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

Homepage Members Register Login Search Old board


Neuer Thread ...
More : [1] [2]


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

<Luigi>
unregistried

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


I have written a shader that emulate (?) a "2 sample 5 tap quincunx multi-sampling"
If someone who try it:

antialias.vp (rename as gpuPeteOGL2.vp)

!!ARBvp1.0

OPTION ARB_position_invariant;

# program.env[1].x/y will give the plugin's "effect level" offset (I suggest to only use 1-Minimum)

PARAM filterOffset = program.env[1];

ATTRIB sample = vertex.texcoord[ 0 ];

MOV result.texcoord[ 0 ].x, sample.x;
MOV result.texcoord[ 0 ].y, sample.y;
ADD result.texcoord[ 1 ].x, sample.x, filterOffset.x;
MOV result.texcoord[ 1 ].y, sample.y;
MOV result.texcoord[ 2 ].x, sample.x;
ADD result.texcoord[ 2 ].y, sample.y, -filterOffset.y;
ADD result.texcoord[ 3 ].x, sample.x, filterOffset.x;
ADD result.texcoord[ 3 ].y, sample.y, -filterOffset.y;

END

antialias.fp (rename as gpuPeteOGL2.fp)

!!ARBfp1.0

TEMP color0, color1, color2, color3;

PARAM divEight = { 0.125, 0.125, 0.125, 0.0 };
PARAM mulFive = { 5.0, 5.0 , 5.0 , 0.0 };


TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;

MUL color0, color0, mulFive;

ADD color0, color0, color1;
ADD color0, color0, color2;
ADD color0, color0, color3;

MUL result.color, color0, divEight;

END

or,if you prefer (should be faster):

!!ARBfp1.0

TEMP color0, color1, color2, color3, color4;

PARAM divEight = { 0.125, 0.125, 0.125, 0.0 };


TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;

ADD color4, color0, color0;
ADD color4, color4, color4;
ADD color4, color4, color0;
ADD color4, color4, color1;
ADD color4, color4, color2;
ADD color4, color4, color3;

MUL result.color, color4, divEight;

END

Ciao.




<Luigi>
unregistried

...   Created on 21.09.2004 - 16:06Jump to top Quote this post Report this post Edit Delete


New variation: "4 sample 9 tap box multi-sampling"!
(it can smoke your graphic card)

antialias.vp is the same

antialias.fp (rename as gpuPeteOGL2.fp)

!!ARBfp1.0

TEMP color0, color1, color2, color3;

PARAM divSixteen = { 0.0625, 0.0625, 0.0625, 0.0 };
PARAM mulNine = { 9.0, 9.0 , 9.0 , 0.0 };
PARAM mulThree = { 3.0, 3.0 , 3.0 , 0.0 };

TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;

MUL color0, color0, mulNine;
MUL color1, color1, mulThree;
MUL color2, color2, mulThree;

ADD color0, color0, color1;
ADD color0, color0, color2;
ADD color0, color0, color3;

MUL result.color, color0, divSixteen;

END

or,if you prefer (should be faster):

!!ARBfp1.0

TEMP color0, color1, color2, color3;
TEMP color4, color5;
PARAM divSixteen = { 0.0625, 0.0625, 0.0625, 0.0 };


TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;

ADD color4, color0, color0;
ADD color4, color4, color4;
ADD color4, color4, color4;
ADD color4, color4, color0;
ADD color5, color2, color3;
ADD color5, color5, color5;
ADD color5, color2, color3;
ADD color4, color4, color5;
ADD color4, color4, color3;

MUL result.color, color4, divSixteen;

END




<Luigi>
unregistried

...   Created on 21.09.2004 - 18:23Jump to top Quote this post Report this post Edit Delete


And, at last, my implementation:

antialias.vp (rename as gpuPeteOGL2.vp)

!!ARBvp1.0

OPTION ARB_position_invariant;

# program.env[1].x/y will give the plugin's "effect level" offset (I suggest to only use 1-Minimum)

PARAM filterOffset = program.env[1];

ATTRIB sample = vertex.texcoord[ 0 ];

MOV result.texcoord[ 0 ].x, sample.x;
MOV result.texcoord[ 0 ].y, sample.y;
ADD result.texcoord[ 1 ].x, sample.x, -filterOffset.x;
ADD result.texcoord[ 1 ].y, sample.y, -filterOffset.y;
ADD result.texcoord[ 2 ].x, sample.x, filterOffset.x;
ADD result.texcoord[ 2 ].y, sample.y, -filterOffset.y;
ADD result.texcoord[ 3 ].x, sample.x, -filterOffset.x;
ADD result.texcoord[ 3 ].y, sample.y, filterOffset.y;
ADD result.texcoord[ 4 ].x, sample.x, filterOffset.x;
ADD result.texcoord[ 4 ].y, sample.y, filterOffset.y;


END

antialias.fp (rename as gpuPeteOGL2.fp)

!!ARBfp1.0

TEMP color0, color1, color2, color3, color4, colorT;

PARAM divEight = { 0.125, 0.125, 0.125, 0.0 };

TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;
TEX color4, fragment.texcoord[ 4 ], texture[ 0 ], 2D;

ADD color0, color0, color0;
ADD color0, color0, color0;
ADD color2, color1, color2;
ADD color3, color3, color4;
ADD colorT, color2, color3;
ADD colorT, colorT, color0;


MUL result.color, colorT, divEight;

END


Ciao.




<Luigi>
unregistried

...   Created on 21.09.2004 - 18:24Jump to top Quote this post Report this post Edit Delete


And, at last, my implementation:

antialias.vp (rename as gpuPeteOGL2.vp)

!!ARBvp1.0

OPTION ARB_position_invariant;

# program.env[1].x/y will give the plugin's "effect level" offset (I suggest to only use 1-Minimum)

PARAM filterOffset = program.env[1];

ATTRIB sample = vertex.texcoord[ 0 ];

MOV result.texcoord[ 0 ].x, sample.x;
MOV result.texcoord[ 0 ].y, sample.y;
ADD result.texcoord[ 1 ].x, sample.x, -filterOffset.x;
ADD result.texcoord[ 1 ].y, sample.y, -filterOffset.y;
ADD result.texcoord[ 2 ].x, sample.x, filterOffset.x;
ADD result.texcoord[ 2 ].y, sample.y, -filterOffset.y;
ADD result.texcoord[ 3 ].x, sample.x, -filterOffset.x;
ADD result.texcoord[ 3 ].y, sample.y, filterOffset.y;
ADD result.texcoord[ 4 ].x, sample.x, filterOffset.x;
ADD result.texcoord[ 4 ].y, sample.y, filterOffset.y;


END

antialias.fp (rename as gpuPeteOGL2.fp)

!!ARBfp1.0

TEMP color0, color1, color2, color3, color4, colorT;

PARAM divEight = { 0.125, 0.125, 0.125, 0.0 };

TEX color0, fragment.texcoord[ 0 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;
TEX color4, fragment.texcoord[ 4 ], texture[ 0 ], 2D;

ADD color0, color0, color0;
ADD color0, color0, color0;
ADD color2, color1, color2;
ADD color3, color3, color4;
ADD colorT, color2, color3;
ADD colorT, colorT, color0;


MUL result.color, colorT, divEight;

END


Ciao.




PeteBernert 
Admin
...............

...

Status:Offline
Date registered: 04.10.2003
Post:818
Send Message
...   Created on 26.09.2004 - 16:09Jump to top Quote this post Report this post Edit Delete


that's a small variation of my internal "Fullscreen smoothing" shader effect and the public available "simble blur" shader (available on my homepage).

Well, maybe somebody else likes your shader, so if you want I can put it on my homepage in the "OGL2 shaders" section, no problem




<Luigi>
unregistried

...   Created on 27.09.2004 - 11:39Jump to top Quote this post Report this post Edit Delete


Pete,
if you think they are good enough, put them without problems.
Ciao.




<Luigi>
unregistried

...   Created on 01.10.2004 - 19:04Jump to top Quote this post Report this post Edit Delete


Pete,
I have modified my implementation of "blur"
effect introducing a cut-off.
The vp code is the same.
Here the fp code:

!!ARBfp1.0

TEMP color0, color1, color2, color3, color4;
TEMP temp;

PARAM cutoff = {0.2, 0.2, 0.2, 0.0 };
PARAM divEight = { 0.125, 0.125, 0.125, 0.0 };

TEX color0, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color1, fragment.texcoord[ 1 ], texture[ 0 ], 2D;
TEX color2, fragment.texcoord[ 2 ], texture[ 0 ], 2D;
TEX color3, fragment.texcoord[ 3 ], texture[ 0 ], 2D;
TEX color4, fragment.texcoord[ 4 ], texture[ 0 ], 2D;

# remove the values higher than color0 + cut-off

MUL temp, color0, cutoff;
ADD temp, color0, temp;
MIN color1, color1, temp;
MIN color2, color2, temp;
MIN color3, color3, temp;
MIN color4, color4, temp;

# blend colors

ADD color0, color0, color0;
ADD color0, color0, color0;
ADD color1, color1, color2;
ADD Color3, Color3, color4;
ADD Color1, Color1, Color3;
ADD Color0, Color0, Color1;

# calculate result

MUL result.color, color0, divEight

END

Ciao.




<Luigi>
unregistried

...   Created on 18.10.2004 - 17:09Jump to top Quote this post Report this post Edit Delete


Pete,
no news?
In Italy no news, good news...




PeteBernert 
Admin
...............

...

Status:Offline
Date registered: 04.10.2003
Post:818
Send Message
...   Created on 21.10.2004 - 18:48Jump to top Quote this post Report this post Edit Delete


don't panic, I will upload your shaders soon

...

OK, I've uploaded your shader to my domain, in the GPU section.


[Dieser Beitrag wurde am 23.10.2004 - 11:31 von PeteBernert aktualisiert]




<Luigi>
unregistried

...   Created on 26.10.2004 - 18:49Jump to top Quote this post Report this post Edit Delete


Pete,
thanks a lot for your interest
Ciao.
P:S: i'm working on 5x5 convolution matrix filter that use all eight texture coordinate vertex attributes and 4D vectors (x,y,z,w coordinate) for store the voxels...




More : [1] [2]

Similarly threads:
Topics Created by Replies Boardname
Welchen Pixel Shader benütz ihr??? Tommy 14 mani
Natural Vision Shader + AA Shader v2.o = Best Shader for 2d !! zaykho 10 pete_bernert
Vertex TeamPirnok 5 teampirnok
PSX 3d games vertex shaking 3 pete_bernert
Attn Pete: OpenGL GPU Plugin, vertex buffer/primitive assembly bug Andon 11 pete_bernert
Neuer Thread ...

Onlinestatistics from 15.03.2010 - 16:14 Uhr
4 visitor(s) are online!
There is/are now 1 registered user and 3 visitor(s) in the forum en-route.
ClarkKent






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:
gpupeteogl2.vp | gpupeteogl2 | best pixel shaders for ogl2 | pixel shader anti-alias blend | vertex/pixel 1.x | epsx best pixel shader
blank