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

Z 
Strong supporter
......

...

Status:Offline
Date registered: 03.08.2005
Post:72
Send Message
...   Created on 09.04.2006 - 14:29Jump to top Quote this post Report this post Edit Delete


I wonder if the shaders on this board and ATI's Smart-Shader-Feature are somewhat similar.

As you probably already know ATI Smart Shader allows to use custom made shaders saved in a .pss-file.
(Here are some details:
http://www.driverheaven.net/smartshader/
)

Now is it possible to convert some of the shaders on this board into a smart shader-file which then can be used in all kind of 3D games, not only in Pete's OGL2-Plugin?

I'd love to see a Smart Shader to change color saturation and brightness, but so far I found nothing on the net.


By the way, guest's Cartoon shader is great IMO. Unfortunately most of ShadX shaders don't work on my card.




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



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


Z schrieb

    ...Now is it possible to convert some of the shaders on this board into a smart shader-file which then can be used in all kind of 3D games, not only in Pete's OGL2-Plugin?


Yes, it's possible, but only for shaders written in ARB asm (not GLSL). Unfortunately I don't have an ATI card for test it...
Bye
P.S.: If you like, I can write a pss file and you could test it...

[Dieser Beitrag wurde am 10.04.2006 - 14:51 von ShadX aktualisiert]




Z 
Strong supporter
......

...

Status:Offline
Date registered: 03.08.2005
Post:72
Send Message
...   Created on 14.04.2006 - 14:51Jump to top Quote this post Report this post Edit Delete


I found a working color-Smart-Shader.
The .pss-file looks like this:



shader colorNegativePixelShader =
"!!ARBfp1.0
#This is what comments look like.
#PARAM scale = {0.5, 0.5, 0.5, 0.5};
PARAM c0 ={ 2.000000, 6.000000, 0.250, 4.000000};
PARAM c1 ={ -0.250, -1.000000, -2.000000, 1.000000};
PARAM c2 ={ -3.000000, 0.000000, 0.000000, -4.000000};
#TEMP pixel;
TEMP r0;
TEMP r1;
TEMP r2;
TEMP r3;
TEMP r4;
TEMP r5;
TEMP r6;
TEMP r7;
TEMP r8;
TEMP r9;
TEMP r10;
TEMP r11;
TEMP r12;


#OUTPUT oColor = result.color;

# Color negative was originally intended to set every color to 1-color. We
# found that in practice, though, most apps are rather dark, so they get
# all washed-out looking with a real negative. Instead, we make every color
# 0.5 - color. That produced nice results, but, of course it's easy to tweak
# by setting the scale above if that's what you want.
ATTRIB Tex0 = fragment.texcoord[0];
#PARAM c0 ={ 2.000000, 6.000000, 1.250, 4.000000};
#PARAM c1 ={ -1.250, -1.000000, -2.000000, 1.000000};
#PARAM c2 ={ -3.000000, 0.000000, 0.000000, -4.000000};
OUTPUT Output0 = result.color;
TEX r0, Tex0, texture[ 0], 2D;
ADD r0.w , r0.xxxx , -r0.yyyy ;
CMP r7.w , r0.wwww , r0.xxxx , r0.yyyy;
MIN r4.w , r0.zzzz , r7.wwww ;
CMP r6.w , r0.wwww , r0.yyyy , r0.xxxx;
MAX r8.z , r6.wwww , r0.zzzz ;
ADD r3.w , r0.yyyy , -r0.zzzz ;
ADD r10.w , -r4.wwww , r8.zzzz ;
RCP r5.w , r10.w ;
ADD r2.w , r0.zzzz , -r0.xxxx ;
MAD r4.w , r2.wwww , r5.wwww , c0.xxxx ;
MUL r11.w , r3.wwww , r5.wwww ;
MAD r0.w , r0.wwww , r5.wwww , c0.wwww ;
ADD r1.w , r0.yyyy , -r8.zzzz ;
ADD r3.w , r0.xxxx , -r8.zzzz ;
ABS r7.w , r1.wwww ;
CMP r9.w , -r7.wwww , r0.wwww , r4.wwww ;
ABS r0.w , r3.wwww ;
CMP r11.w , -r0.wwww , r9.wwww , r11.wwww ;
ADD r1.w , r11.wwww , c0.yyyy ;
CMP r3.w , r11.wwww , r1.wwww , r11.wwww ;
FRC r5.w , r3.wwww ;
ADD r2.w , r3.wwww , -r5.wwww ;
ADD r4.w , r3.wwww , -r2.wwww ;
ABS r0.w , r2.wwww ;
ADD r11.w , -r4.wwww , c1.wwww ;
RCP r1.w , r8.z ;
MUL r10.w , r10.wwww , r1.wwww ;
MUL r3.w , r10.wwww , c0.zzzz ;
MUL r5.w , r10.wwww , c1.xxxx ;
MAD r1.w , r4.wwww , -r3.wwww , c1.wwww ;
MAD r6.w , r11.wwww , -r3.wwww , c1.wwww ;
MUL r8.x , r8.zzzz , r6.wwww ;
MUL r8.w , r1.wwww , r8.zzzz ;
ADD r10.w , r2.wwww , c2.wwww ;
ABS r7.w , r10.wwww ;
ADD r5.w , r5.wwww , c1.wwww ;
MUL r8.y , r5.wwww , r8.zzzz ;
CMP r2.x , -r7.wwww , r8.zzzz , r8.xxxx;
CMP r2.y , -r7.wwww , r8.yyyy , r8.yyyy ;
CMP r2.z , -r7.wwww , r8.wwww , r8.zzzz ;
ADD r4.w , r2.wwww , c2.xxxx ;
ABS r11.w , r4.wwww ;
MOV r1.xyz , r2 ;
CMP r2.x , -r11.wwww , r1.xxxx ,r8.yyyy;
CMP r2.y , -r11.wwww , r1.yyyy, r8.wwww;
CMP r2.z , -r11.wwww , r1.zzzz, r8.zzzz ;
ADD r10.w , r2.wwww , c1.zzzz ;
ADD r2.w , r2.wwww , c1.yyyy ;
ABS r7.w , r10.wwww ;
CMP r0.xyz , -r7.wwww , r2 , r8.yzxw;
ABS r4.w , r2.wwww ;
CMP r0.xyz , -r4.wwww , r0 ,r8.wzyx;
CMP r11.xyz , -r0.wwww , r0 ,r8.zxyw;
MOV r11.w , c2.yyyy ;
MOV Output0 , r11 ;

END ";

texture[0].source = backbuffer;
apply colorNegativePixelShader;




Unfortunately, it's really slow. Any way to make it faster?

ShadX it would be nice if you could convert some of your ARB shaders into a .pss-file, I'm curious to see if they work on my card that way. I will post the results here.
Maybe it's possible to convert GLSL-shaders to ARB and then into a smart shader file?




Z 
Strong supporter
......

...

Status:Offline
Date registered: 03.08.2005
Post:72
Send Message
...   Created on 14.04.2006 - 14:56Jump to top Quote this post Report this post Edit Delete


I forgot to say:
In the .pss-file I posted above, you can change the following values:

PARAM c0 ={ 2.000000, 6.000000, X.XXX, 4.000000};
PARAM c1 ={ -X.XXX, -1.000000, -2.000000, 1.000000};


In my example I chose

PARAM c0 ={ 2.000000, 6.000000, 0.250, 4.000000};
PARAM c1 ={ -0.250, -1.000000, -2.000000, 1.000000};

for testing reasons. Using values higher than 1.000 you get more saturated colors.




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



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


Z schrieb

    ...ShadX it would be nice if you could convert some of your ARB shaders into a .pss-file, I'm curious to see if they work on my card that way. I will post the results here.

Ok, have you some preference?
Z schrieb

    Maybe it's possible to convert GLSL-shaders to ARB and then into a smart shader file?

Yes, it's possible... but isn't very simple...
Bye




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



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


Try this color.pss:

shader colorPixelShader =
"!!ARBfp1.0

PARAM RGBtoY = { 0.299, 0.587, 0.114, 0 };
PARAM RGBtoI = { 0.596,-0.275,-0.321, 0 };
PARAM RGBtoQ = { 0.212,-0.523, 0.311, 0 };

PARAM YtoRGB = { 1, 0.95568806036115671171, 0.61985809445637075388, 0 };
PARAM ItoRGB = { 1,-0.27158179694405859326,-0.64687381613840131330, 0 };
PARAM QtoRGB = { 1,-1.1081773266826619523 , 1.7050645599191817149 , 0 };

PARAM luma = 0.05;#luminance from -x.x to x.x, use small value! (0.0 normal)
PARAM cont = 1.4 ;#contrast from 0.0 to x.x, don't use negative value! (1.0 normal)
PARAM satr = 1.2 ;#saturation from 0.0 (b/w) to x.x (1.0 normal)

OUTPUT oColor = result.color;

TEMP r1, r2, r3, r4;

TEX r1, fragment.texcoord[0], texture[0], 2D;

DP3 r2.x, RGBtoY, r1;
DP3 r2.y, RGBtoI, r1;
DP3 r2.z, RGBtoQ, r1;

POW r2.x, r2.x, cont.x;
ADD r2.x, r2.x, luma;
MUL r2.y, r2.y, satr;
MUL r2.z, r2.z, satr;

DP3 r1.x, YtoRGB, r2;
DP3 r1.y, ItoRGB, r2;
DP3 r1.z, QtoRGB, r2;

MOV oColor, r1;

END";

shader copyPixelShader =
"!!ARBfp1.0
OUTPUT oColor = result.color;
TEX oColor, fragment.texcoord[0], texture[0], 2D;
END";

surface temp = allocsurf(width, height);

texture[0].source = backbuffer;
destination temp;
apply colorPixelShader;

texture[0].source = temp;
destination backbuffer;
apply copyPixelShader;

[Dieser Beitrag wurde am 24.04.2006 - 11:29 von ShadX aktualisiert]





Similarly threads:
Topics Created by Replies Boardname
SMART ;-) Tolgakhan 0 tolgakhan1
Smart Dog.. KaZeEm 0 lc_crew
Get Smart SND 1 jamesbond
Smart Sango1991 3 drive
Smart Yuzuyu 35 drive
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:
.pss smart shaders | smart shader file .pss | color saturation shader glsl | smart shader .pss | saturation shader | shadx smart shader
blank