View unanswered posts | View active topics It is currently Fri May 24, 2019 1:21 pm



This topic is locked, you cannot edit posts or make further replies.  [ 158 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next
The unofficial BSNES pixel shader thread 
Author Message
has wat u liek
User avatar

Joined: Tue Sep 11, 2007 2:54 pm
Posts: 559
Location: Banland.
Reply with quote
Post 
Wow....never was expecting this when people code shaders. :shock:
And I mean that in a good way.


Sat Oct 04, 2008 1:47 pm
Profile
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
// MAGICAL FUNTIME
texture tex1;
texture tex2;
float2 rcpres;
float Timer;
sampler s0 = sampler_state { texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );
   return Color;
   return Colrx;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );
   // FIRST ITERATION
   Color += tex2D( s0, Tex.xy+float2(0,0.0050) )/4;
   Color += tex2D( s0, Tex.xy-float2(0,0.0050) )/4;   
   Color += tex2D( s0, Tex.xy+float2(0.0050,0) )/4;   
   Color += tex2D( s0, Tex.xy-float2(0.0050,0) )/4;
   Color += tex2D( s0, Tex.xy+float2(0.0025,0.0025) )/6;
   Color += tex2D( s0, Tex.xy-float2(0.0025,0.0025) )/6;   
   Color += tex2D( s0, Tex.xy+float2(-0.0025,0.0025) )/6;   
   Color += tex2D( s0, Tex.xy-float2(-0.0025,0.0025) )/6;
   // SECOND ITERATION
   Color += tex2D( s0, Tex.xy+float2(0,0.0100) )/8;
   Color += tex2D( s0, Tex.xy-float2(0,0.0100) )/8;   
   Color += tex2D( s0, Tex.xy+float2(0.0100,0) )/8;   
   Color += tex2D( s0, Tex.xy-float2(0.0100,0) )/8;
   Color += tex2D( s0, Tex.xy+float2(0.0050,0.0050) )/12;
   Color += tex2D( s0, Tex.xy-float2(0.0050,0.0050) )/12;   
   Color += tex2D( s0, Tex.xy+float2(-0.0050,0.0050) )/12;   
   Color += tex2D( s0, Tex.xy-float2(-0.0050,0.0050) )/12;   
   // COLOR ROTARY (OPTIONAL SHENANIGANS)
   Colrx.rgb += sin(float3(Timer,Timer*2,Timer*4)*10)/4;
   // FINAL PRODUCT   
   return Color/2 + Colrx/4;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p0 { PixelShader = compile ps_2_0 Pass1(); }
}


Am I banned yet?


Wed Oct 08, 2008 8:50 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
// THIS FILTER IS POINTLESS AND ANNOYING.
texture tex1;
texture tex2;
float2 rcpres;
float Timer;
sampler s0 = sampler_state { texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );
   return Color;
   return Colrx;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );   
   // UP, DOWN, LEFT, RIGHT
   Color += tex2D( s0, Tex.xy+sin(float2(Timer*20,0))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(Timer*20,0))/200 )/4;   
   Color += tex2D( s0, Tex.xy+sin(float2(0,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(0,Timer*20))/200 )/4;     
   // DIAGONALWAYS
   Color += tex2D( s0, Tex.xy+sin(float2(Timer*20,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(Timer*20,Timer*20))/200 )/4;   
   Color += tex2D( s0, Tex.xy+sin(float2(-Timer*20,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(-Timer*20,Timer*20))/200 )/4;   
   // IT'S LIKE THAT ELEVATOR FROM WILLY WONKA, EXCEPT NOT.
   if (Color.r < 0.3){
   Color.r = 0;
   }if (Color.r > 0.7){
   Color.r = 1;
   }
   if (Color.g < 0.3){
   Color.g = 0;
   }if (Color.g > 0.7){
   Color.g = 1;
   }
   if (Color.b < 0.3){
   Color.b = 0;
   }if (Color.b > 0.7){
   Color.b = 1;
   }   
   return lerp(Color/2,Colrx,Colrx);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p0 { PixelShader = compile ps_2_0 Pass1(); }
}


Gonna make some vids sooner or later I guess OR NEVER.


Wed Oct 08, 2008 11:04 am
Profile YIM WWW
ZSNES Shake Shake Prinny
User avatar

Joined: Wed Jul 28, 2004 4:15 pm
Posts: 5615
Location: PAL50, dood !
Reply with quote
Post 
gllt wrote:
Am I banned yet?

Dude, you've produced more functional code than jargon ever has. That's not the way to get banned.

_________________
皆黙って俺について来い!!
Code:
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54


Wed Oct 08, 2008 7:40 pm
Profile
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
grinvader wrote:
gllt wrote:
Am I banned yet?

Dude, you've produced more functional code than jargon ever has. That's not the way to get banned.


Who is she?

EDIT; SURPRISE, ...LETS BAG THESE UP!
http://www.savefile.com/files/1829086


Thu Oct 09, 2008 4:07 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Image

Code:
texture tex1;
texture tex2;
float2 rcpres;
float Timer;
sampler s0 = sampler_state { texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );
   return Color;
   return Colrx;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );   
   Color += tex2D( s0, Tex.xy+sin(float2(Timer*20,0))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(Timer*20,0))/200 )/4;   
   Color += tex2D( s0, Tex.xy+sin(float2(0,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(0,Timer*20))/200 )/4;     
   Color += tex2D( s0, Tex.xy+sin(float2(Timer*20,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(Timer*20,Timer*20))/200 )/4;   
   Color += tex2D( s0, Tex.xy+sin(float2(-Timer*20,Timer*20))/200 )/4;
   Color += tex2D( s0, Tex.xy-sin(float2(-Timer*20,Timer*20))/200 )/4;   
   if (Color.r < 0.3){
   Color.r = 0;
   }if (Color.r > 0.7){
   Color.r = 1;
   }
   if (Color.g < 0.3){
   Color.g = 0;
   }if (Color.g > 0.7){
   Color.g = 1;
   }
   if (Color.b < 0.3){
   Color.b = 0;
   }if (Color.b > 0.7){
   Color.b = 1;
   }   
   return lerp(Color/2%Colrx*2,Colrx/2+Color*2,Colrx)/2;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p0 { PixelShader = compile ps_2_0 Pass1(); }
}


I LIKE THIS but it's just not special enough.
Someone give me inspiration! NOW.


Thu Oct 09, 2008 5:42 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
http://i34.tinypic.com/140djjs.png
http://www.savefile.com/files/1829269

I'm impressed with myself. Are you? :V

EDIT; UPDATED VERSION ff

http://www.savefile.com/files/1829291


Last edited by gllt on Thu Oct 09, 2008 7:29 am, edited 1 time in total.



Thu Oct 09, 2008 7:09 am
Profile YIM WWW
Inmate
User avatar

Joined: Mon Dec 06, 2004 7:47 am
Posts: 1751
Location: WA
Reply with quote
Post 
i do like that one

_________________
Image


Thu Oct 09, 2008 7:12 am
Profile
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Final version, just modified it and changed the defaults. Too lazy to savefile it.

Code:
texture tex1;
texture tex2;
float2 rcpres;
float Timer;
sampler s0 = sampler_state { texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );
   return Color;
   return Colrx;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Color = tex2D( s0, Tex.xy );
   float4 Colrx = tex2D( s1, Tex.xy );   
   
   //* FIRST PASS
   Color += tex2D( s0, Tex.xy+float2(0,0.0050) )/4;
   Color += tex2D( s0, Tex.xy-float2(0,0.0050) )/4;   
   Color += tex2D( s0, Tex.xy+float2(0.0050,0) )/4;   
   Color += tex2D( s0, Tex.xy-float2(0.0050,0) )/4;
   Color += tex2D( s0, Tex.xy+float2(0.0025,0.0025) )/6;
   Color += tex2D( s0, Tex.xy-float2(0.0025,0.0025) )/6;   
   Color += tex2D( s0, Tex.xy+float2(-0.0025,0.0025) )/6;   
   Color += tex2D( s0, Tex.xy-float2(-0.0025,0.0025) )/6;
   //*/ UNCOMMENT ME AND REMOVE THE FIRST SLASH ABOVE TO AVOID THIS PASS.
   
   //* SECOND PASS
   Color += tex2D( s0, Tex.xy+float2(0,0.0100) )/8;
   Color += tex2D( s0, Tex.xy-float2(0,0.0100) )/8;   
   Color += tex2D( s0, Tex.xy+float2(0.0100,0) )/8;   
   Color += tex2D( s0, Tex.xy-float2(0.0100,0) )/8;
   Color += tex2D( s0, Tex.xy+float2(0.0050,0.0050) )/12;
   Color += tex2D( s0, Tex.xy-float2(0.0050,0.0050) )/12;   
   Color += tex2D( s0, Tex.xy+float2(-0.0050,0.0050) )/12;   
   Color += tex2D( s0, Tex.xy-float2(-0.0050,0.0050) )/12; 
   //*/ UNCOMMENT ME AND REMOVE THE FIRST SLASH ABOVE TO AVOID THIS PASS.
   
   // TRY OTHER SETTINGS BELOW. SIMPLY COMMENT OUT THE ACTIVE AND UNCOMMENT THE ONE YOU LIKE.
   Color.rgb -= smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   //Color.rgb += smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   //Color.rgb /= smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   //Color.rgb *= smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   //Color.rgb %= smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   //Color.rgb = smoothstep(0.3,0.6,dot(Color.g/2+Color.r,Color.b/2+Color.r)%Color.r);
   
   // TRY OTHER SETTINGS BELOW. SIMPLY COMMENT OUT THE ACTIVE AND UNCOMMENT THE ONE YOU LIKE.
   //return Color/4 + Colrx;
   return lerp(Color/4 + Colrx,Color,Color)*Colrx;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p0 { PixelShader = compile ps_2_0 Pass1(); }
}


Thu Oct 09, 2008 7:49 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
I post too much and feel guilty about it.

Anyway, BEHOLD. EIGHT WEIGHT BLUR. Unfortunately, that much math requires PS 3.0 so comment out all but three or so of the blur passes and then edit the division of Color to match. (Three passes is 8*3, or 24. So Color/24.)

EDIT; Updates. Changed weight numbers. Now can induce a bloom-like effect too I guess. I dunno, it might just really be bloom. :V

Code:
// WHAT A WASTE OF TIME.
texture tex1;
float2 rcpres;
//float Timer;
float4 End;
sampler s0 = sampler_state { texture = <tex1>; };

#define NUM 8

float2 Weights[NUM] = {
 0.0020, 0,
 -0.0020, 0,
 0, 0.0020,
 0, -0.0020,
 0.0015, 0.0015,
 -0.0015, -0.0015,
 -0.0015, 0.0015,
 0.0015, -0.0015
};

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = 0;   
   for (int i = 0; i < NUM; ++i ){
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ Weights[i] );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*2) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*3) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*4) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*5) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*6) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*7) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*8) );
   }
   End = Color/64;
   return End;

   // Bloom-ish!
   // End = Color/16;
   // return Base * End;

   // Bloom-like!
   // End = Color/64;
   // return Base + End;

   // MY NAME IS LINKFAN001 AND I PLAY TP, LIKE, ALL THE TIME.
   // End = Color;
   // return (Base * End/16) + End/64;
}

///*
Technique T0
{
    pass p0 { PixelShader = compile ps_3_0 Pass0(); }
    pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}
//*/

/* 2.0 Pass instead?
Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}
*/



EDIT; PIX. OOT with Hi-Res texture pack and LINKFAN001 bloom.

Image


Thu Oct 09, 2008 11:37 am
Profile YIM WWW
Reply with quote
Post 
Hope you don't mind me moving this over to the general discussion thread, as it's not really related to bsnes development.

I don't mind if you continue posting here, of course.


Thu Oct 09, 2008 5:11 pm
ZSNES Shake Shake Prinny
User avatar

Joined: Wed Jul 28, 2004 4:15 pm
Posts: 5615
Location: PAL50, dood !
Reply with quote
Post 
did i hear someone say zelda bloom ?

_________________
皆黙って俺について来い!!
Code:
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54


Thu Oct 09, 2008 6:49 pm
Profile
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
byuu wrote:
Hope you don't mind me moving this over to the general discussion thread, as it's not really related to bsnes development.

I don't mind if you continue posting here, of course.


I KNOW IM SO SORRY I FELT THE SAME WAY <3

ty

Will work more today :V


Thu Oct 09, 2008 10:31 pm
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
// WHAT A WASTE OF TIME.
texture tex1;
float2 rcpres;
//float Timer;
float4 End;
sampler s0 = sampler_state { texture = <tex1>; };

#define NUM 8
#define MUL 8

float2 Weights[NUM] = {
 0.0020, 0,
 -0.0020, 0,
 0, 0.0020,
 0, -0.0020,
 0.0015, 0.0015,
 -0.0015, -0.0015,
 -0.0015, 0.0015,
 0.0015, -0.0015
};

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = 0;   
   for (int i = 0; i < NUM; ++i){
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*1) );   
   Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*2) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*3) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*4) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*5) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*6) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*7) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i)+ (Weights[i]*8) );
   }
   End = Color;
   Base.rgb = (Base.r + Base.g + Base.b)/3.0f;
   return End/32 - Base;
}

///*
Technique T0
{
    pass p0 { PixelShader = compile ps_3_0 Pass0(); }
    pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}
//*/

/* 2.0 Pass instead?
Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}
*/


NESS IS RUNNING AERO THEME, BUT HOW COULD EARTHBOUND BE ANY SLOWER.



http://i37.tinypic.com/kd8mmh.png

EDIT;
Alternative weights;

Code:
float2 Weights[NUM] = {
 0.00200, 0,
 -0.00200, 0,
 0, 0.00200,
 0, -0.00200,
 0.00175, 0.00175,
 -0.00175, -0.00175,
 -0.00175, 0.00175,
 0.00175, -0.00175
};


Fri Oct 10, 2008 2:49 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
// WHAT A WASTE OF GPU.
texture tex1;
float2 rcpres;
//float Timer;
float4 End;
sampler s0 = sampler_state { texture = <tex1>; };

#define NUM 16

float2 Weights[NUM] = {
  0.00200, 0,
  -0.00200, 0,
  0, 0.00200,
  0, -0.00200,
  0.001625, 0.001625,
  -0.001625, -0.001625,
  -0.001625, 0.001625,
  0.001625, -0.001625,
  0.00200, 0.001625,
  0.001625, 0.00200,
  -0.00200,-0.001625,
  -0.001625,-0.00200,
  0.00200,-0.001625,
  -0.00200,0.001625,
  0.001625,-0.00200,
  -0.001625,0.00200
};

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = 0;   
   for (int i = 0; i < NUM; ++i){
    Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*1*2) );   
    Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*2*2) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*3*2) );
    Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*4*2) );
    //Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*5*2) );
    //Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*6*2) );
    //Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*7*2) );
    //Color += tex2D( s0, Tex.xy + (0.0001 * i) + (Weights[i]*8*2) );
   }
   End = Color;
   return ((Base * End/32) + End/64);
   //return ((Base * End/64) + End/128);
}

///*
Technique T0
{
    pass p0 { PixelShader = compile ps_3_0 Pass0(); }
    pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}
//*/

/* 2.0 Pass instead?
Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}
*/


Sat Oct 11, 2008 2:55 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
http://www.si-gamer.net/gulikoza/src/scale2x.fx
Gonna try and convert this if it's possible.

Code:
//uncomment lines for different version

texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define MID1 0.40
#define MID2 0.60
#define LOW 0
#define HIGH 1

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   
   //Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   

   if (Lay0.r < 0.25){
   Lay0.r = LOW;
   }if (Lay0.r > 0.25 && Lay0.r < 0.50){
   Lay0.r = MID1;
   }if (Lay0.r > 0.50 && Lay0.r < 0.75){
   Lay0.r = MID2;
   }if (Lay0.r > 0.75){
   Lay0.r = HIGH;
   };
   
   if (Lay0.g < 0.25){
   Lay0.g = LOW;
   }if (Lay0.g > 0.25 && Lay0.g < 0.50){
   Lay0.g = MID1;
   }if (Lay0.g > 0.50 && Lay0.g < 0.75){
   Lay0.g = MID2;
   }if (Lay0.g > 0.75){
   Lay0.g = HIGH;
   };
   
   if (Lay0.b < 0.25){
   Lay0.b = LOW;
   }if (Lay0.b > 0.25 && Lay0.b < 0.50){
   Lay0.b = MID1;
   }if (Lay0.b > 0.50 && Lay0.b < 0.75){
   Lay0.b = MID2;
   }if (Lay0.b > 0.75){
   Lay0.b = HIGH;
   };
   
   //Base.rgb -= (Base.r + Base.g + Base.b)/3.0f;
     
   return (Lay0);
   //return (Base/3 + Lay0);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


Also this...!


Tue Oct 14, 2008 3:56 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define MID1 0.50
#define MID2 0.60
#define LOW 0
#define HIGH 1

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   
   //  Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   if (Lay0.r < 0.25){
   Lay0.r = LOW;
   }if (Lay0.r > 0.25 && Lay0.r < 0.50){
   Lay0.r = MID1;
   }if (Lay0.r > 0.50 && Lay0.r < 0.75){
   Lay0.r = MID2;
   }if (Lay0.r > 0.75){
   Lay0.r = HIGH;
   };
   
   if (Lay0.g < 0.25){
   Lay0.g = LOW;
   }if (Lay0.g > 0.25 && Lay0.g < 0.50){
   Lay0.g = lerp(MID1,HIGH,MID1);
   }if (Lay0.g > 0.50 && Lay0.g < 0.75){
   Lay0.g = lerp(MID2,LOW,MID2);
   }if (Lay0.g > 0.75){
   Lay0.g = HIGH;
   };
   
   if (Lay0.b < 0.25){
   Lay0.b = LOW;
   }if (Lay0.b > 0.25 && Lay0.b < 0.50){
   Lay0.b = MID1;
   }if (Lay0.b > 0.50 && Lay0.b < 0.75){
   Lay0.b = MID2;
   }if (Lay0.b > 0.75){
   Lay0.b = HIGH;
   };
   
   // Base.rgb -= (Base.r + Base.g + Base.b)/3.0f;
   Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   return (Lay0);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}



Image

Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define MID1 0.50
#define MID2 0.60
#define LOW 0
#define HIGH 1

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   
   //  Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   if (Lay0.r < 0.25){
   Lay0.r = LOW;
   }if (Lay0.r > 0.25 && Lay0.r < 0.50){
   Lay0.r = lerp(MID1,HIGH,MID1);
   }if (Lay0.r > 0.50 && Lay0.r < 0.75){
   Lay0.r = lerp(MID2,LOW,MID2);
   }if (Lay0.r > 0.75){
   Lay0.r = HIGH;
   };
   
   if (Lay0.g < 0.25){
   Lay0.g = LOW;
   }if (Lay0.g > 0.25 && Lay0.g < 0.50){
   Lay0.g = lerp(MID1,HIGH,MID1);
   }if (Lay0.g > 0.50 && Lay0.g < 0.75){
   Lay0.g = lerp(MID2,LOW,MID2);
   }if (Lay0.g > 0.75){
   Lay0.g = HIGH;
   };
   
   if (Lay0.b < 0.25){
   Lay0.b = LOW;
   }if (Lay0.b > 0.25 && Lay0.b < 0.50){
   Lay0.b = lerp(MID1,HIGH,MID1);
   }if (Lay0.b > 0.50 && Lay0.b < 0.75){
   Lay0.b = lerp(MID2,LOW,MID2);
   }if (Lay0.b > 0.75){
   Lay0.b = HIGH;
   };
   
   Base.rgb -= (Base.r + Base.g + Base.b)/3.0f;
   Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   return (Lay0 + Base/3);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


Image


Tue Oct 14, 2008 6:11 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define MID1 0.40
#define MID2 0.60
#define MID3 0.80
#define LOW 0
#define HIGH 1

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   
   //  Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   if (Lay0.r < 0.20){
   Lay0.r = LOW;
   }if (Lay0.r > 0.20 && Lay0.r < 0.40){
   Lay0.r = MID1;
   }if (Lay0.r > 0.40 && Lay0.r < 0.60){
   Lay0.r = MID2;
   }if (Lay0.r > 0.60 && Lay0.r < 0.80){
   Lay0.r = MID3;
   }if (Lay0.r > 0.80){
   Lay0.r = HIGH;
   };
   
   if (Lay0.g < 0.20){
   Lay0.g = LOW;
   }if (Lay0.g > 0.20 && Lay0.g < 0.40){
   Lay0.g = MID1;
   }if (Lay0.g > 0.40 && Lay0.g < 0.60){
   Lay0.g = MID2;
   }if (Lay0.g > 0.60 && Lay0.g < 0.80){
   Lay0.g = MID3;
   }if (Lay0.g > 0.80){
   Lay0.g = HIGH;
   };
   
   if (Lay0.b < 0.20){
   Lay0.b = LOW;
   }if (Lay0.b > 0.20 && Lay0.b < 0.40){
   Lay0.b = MID1;
   }if (Lay0.b > 0.40 && Lay0.b < 0.60){
   Lay0.b = MID2;
   }if (Lay0.b > 0.60 && Lay0.b < 0.80){
   Lay0.b = MID3;
   }if (Lay0.b > 0.80){
   Lay0.b = HIGH;
   };
   
   Base.rgb += tex2D( s0, Tex.xy + float2(0.0020,0) );
   Base.rgb += tex2D( s0, Tex.xy - float2(0.0020,0) );
   Base.rgb += tex2D( s0, Tex.xy + float2(0,0.0020) );
   Base.rgb += tex2D( s0, Tex.xy - float2(0,0.0020) );
   
   Base.rgb += tex2D( s0, Tex.xy + float2(0.0020,0.0020) );
   Base.rgb += tex2D( s0, Tex.xy - float2(0.0020,0.0020) );
   Base.rgb += tex2D( s0, Tex.xy + float2(-0.0020,0.0020) );
   Base.rgb += tex2D( s0, Tex.xy - float2(-0.0020,0.0020) );
   
   Base = lerp(Base/2,Base*2,Base/8);
   
   Base.rgb -= (Base.r + Base.g + Base.b)/3.0f;
   Lay0.rgb = (Lay0.r + Lay0.g + Lay0.b)/3.0f;   
   
   return (Lay0 + Base/3);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_3_0 Pass0(); }
    pass p1 { PixelShader = compile ps_3_0 Pass1(); }
}


B E A U T I F U L

post ss later.


Tue Oct 14, 2008 6:43 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define DIV0 3
#define DIV1 2

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   Lay0.rgb = round(Lay0.r + Lay0.g + Lay0.b)/DIV0;
   Base.r *= Lay0.r/DIV1;
   Base.g *= Lay0.g/DIV1;
   Base.b *= Lay0.b/DIV1;
   return Base + Lay0;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


Image

Image


Wed Oct 15, 2008 9:44 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

#define DIV0 3
#define DIV1 2
#define DIV2 6
#define MUL1 3

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   Lay0.rgb = round(Lay0.r + Lay0.g + Lay0.b)/DIV0;
   Base.r *= Lay0.r/DIV1;
   Base.g *= Lay0.g/DIV1;
   Base.b *= Lay0.b/DIV1;
   float4 Highlight = (Base.r + Base.g + Base.b)/1.5f + 0;
   float4 Color = Base.rgba - (Base.r + Base.g + Base.b)/3.0f + 0;
   return ((Color * Lay0) + Highlight * Color + Lay0/DIV2)*MUL1;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


too lazy to post sss fffdsdfsf

#define MUL1 6
return ((Color * Lay0) + Highlight * Color + Lay0/DIV2)*MUL1 + Color;

punchier ^


Wed Oct 15, 2008 10:19 am
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Lay0 = tex2D( s0, Tex.xy );
   Lay0.rgb = round(Lay0.r + Lay0.g + Lay0.b)/3 - (Lay0.r + Lay0.g + Lay0.b)/3;
   float4 Lax0 = Lay0.rgba - (Lay0.r + Lay0.g + Lay0.b)/3.0f + 0;
   return (Base + Lay0) - (Base * Lay0) + Lax0;
   //return (Base + Lay0);
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


produces http://img241.imageshack.us/img241/5362/effectootzh3.png

that's old so I'm gonna work on some today

k


Sat Oct 25, 2008 3:30 pm
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = tex2D( s0, Tex.xy );
   if (Color.r > Color.g || Color.b > Color.r || Color.g > Color.b){
   Color.rb -= Color.gb;
   Color.gr *= Color.br;
   Color.rg += Color.gr;
   }else{
   Color.rgb -= (Color.r + Color.g + Color.b)/3;
   };
   return ((Base*16 * Color) + Base/8)*3;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


Um.

It makes.. things..

gold.

Image


Sat Oct 25, 2008 3:42 pm
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };
float4 Lay0;
float4 Lay1;
float4 End;

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = tex2D( s0, Tex.xy );
   if (Color.r < 0.50 || Color.b < 0.25){
   Color.g -= 0.75;
   }else{
   Color.rb += Color.g;
   };
   
   End = Color;
   return End;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


NEVER FEAR, PINK IS HERE.

edit

Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };
float4 Lay0;
float4 Lay1;
float4 End;

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = tex2D( s0, Tex.xy );
   if (Color.r < 0.3){
   Color.r = 0.3;
   }if (Color.r < 0.6 && Color.r > 0.3){
   Color.r = 0.6;
   }if (Color.r < 1.0 && Color.r > 0.6){
   Color.r = 1.0;
   }if (Color.g < 0.3){
   Color.g = 0.3;
   }if (Color.g < 0.6 && Color.g > 0.3){
   Color.g = 0.6;
   }if (Color.g < 1.0 && Color.g > 0.6){
   Color.g = 1.0;
   }if (Color.b < 0.3){
   Color.b = 0.3;
   }if (Color.b < 0.6 && Color.b > 0.3){
   Color.b = 0.6;
   }if (Color.b < 1.0 && Color.b > 0.6){
   Color.b = 1.0;
   }; 
   Color.rgb = smoothstep(0.3,1,Color.rgb);
   End = Color;
   return End + Base/3;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


same stuff different code, but I like this version the best. (this isn't pink its the color limitations)

// Color.rgb = smoothstep(0.3,1,Color.rgb) * Base; // ALTERNATE LINE


Sat Oct 25, 2008 4:00 pm
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Purple and Green

Image

Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };
float4 Lay0;
float4 Lay1;
float4 End;

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = tex2D( s0, Tex.xy );
   Color.r = lerp(Color.g,Color.b,Color.gb); 
   Color.g = lerp(Color.b,Color.r,Color.br);
   Color.b = lerp(Color.r,Color.g,Color.rg);   
   return Color;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


edit;

return Color + Base; makes a beautiful tint :OOO it's almost rustic or something


Sun Oct 26, 2008 3:32 pm
Profile YIM WWW
NO VOWELS >:[
User avatar

Joined: Sun Aug 31, 2008 12:59 pm
Posts: 753
Location: ALABAMA
Reply with quote
Post 
Code:
texture tex1;
float2 rcpres;
sampler s0 = sampler_state { texture = <tex1>; };

float4 Pass0( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   return Base;
}

float4 Pass1( in float2 Tex : TEXCOORD0 ) : COLOR0
{
   float4 Base = tex2D( s0, Tex.xy );
   float4 Color = tex2D( s0, Tex.xy );
   return (round(Base*8*Color) - round(Base)) * Base;
}

Technique T0
{
    pass p0 { PixelShader = compile ps_2_0 Pass0(); }
    pass p1 { PixelShader = compile ps_2_0 Pass1(); }
}


http://img135.imageshack.us/img135/8876/shadootex1tb2.png
http://img135.imageshack.us/img135/9421/shadootex2qm8.png
http://xs432.xs.to/xs432/08430/shadootex3632.png

ACCOMPLISHED GOAL


Sun Oct 26, 2008 3:56 pm
Profile YIM WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 158 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.