My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Examples  
Examples of shaders
Phase-Implementation, Featured
Updated Aug 18, 2011 by godisgovernment

No effect:

uniform samplerRECT samp0 : register(s0);

void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
  float4 c0 = texRECT(samp0, uv0).rgba;
  ocol0 = float4(c0.r, c0.g, c0.b, c0.a);
}

Greenish:

uniform samplerRECT samp0 : register(s0);

void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
  float4 c0 = texRECT(samp0, uv0).rgba;
  ocol0 = float4(c0.r*0.8, c0.g*1.4, c0.b*0.8, c0.a);
}

Mirror image:

uniform samplerRECT samp0 : register(s0);

void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
  float4 c0 = texRECT(samp0, float2(1278-uv0[0], uv0[1]));
  ocol0 = float4(c0.r, c0.g, c0.b, c0.a);
}

Horizontal blur:

uniform samplerRECT samp0 : register(s0);

void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
  float4 c0 = float4(0, 0, 0, 0);
  c0 += texRECT(samp0, uv0+float2( 3, 0)).rgba;
  c0 += texRECT(samp0, uv0+float2( 2, 0)).rgba*2;
  c0 += texRECT(samp0, uv0+float2( 1, 0)).rgba*4;
  c0 += texRECT(samp0, uv0+float2(-1, 0)).rgba*4;
  c0 += texRECT(samp0, uv0+float2(-2, 0)).rgba*2;
  c0 += texRECT(samp0, uv0+float2(-3, 0)).rgba;
  c0 = c0/14;
  ocol0 = float4(c0.r, c0.g, c0.b, c0.a);
}

Sign in to add a comment
Powered by Google Project Hosting