NO, I will never share the code MUHAHAHAHAHAHA!
...
ofc you can have it
this is the shadercode, assign it to a view material and set it to camera stage.
If you don't have the beta, you have to rewrite it to get it on a screen-aligned-quad
Code:
float4 vecViewPort; // contains viewport pixel size in zw components
float4 vecSkill1;
const float4 replaceColor1 = {0.5,0.5,0.5,1.0};
const float4 replaceColor2 = {1.0,0.0,0.0,1.0};
const float4 replaceColor3 = {0.0,1.0,0.0,1.0};
const float4 replaceColor4 = {0.0,0.0,1.0,1.0};
const float aberration = 0.1;
Texture TargetMap;
Texture mtlSkin1;
Texture mtlSkin2;
Texture mtlSkin3;
Texture mtlSkin4;
sampler2D smpSource = sampler_state { texture = <TargetMap>; };
sampler2D pattern1 = sampler_state { texture = <mtlSkin1>; AddressU=Wrap; AddressV=Wrap;};
sampler2D pattern2 = sampler_state { texture = <mtlSkin2>; AddressU=Wrap; AddressV=Wrap;};
sampler2D pattern3 = sampler_state { texture = <mtlSkin3>; AddressU=Wrap; AddressV=Wrap;};
sampler2D pattern4 = sampler_state { texture = <mtlSkin4>; AddressU=Wrap; AddressV=Wrap;};
float compare(float4 Color1,float4 Color2)
{
return(abs(Color1.r-Color2.r)+abs(Color1.g-Color2.g)+abs(Color1.b-Color2.b));
}
float4 replacePS(float2 Tex : TEXCOORD0 ) : COLOR0
{
float4 Color = tex2D(smpSource,Tex.xy-vecViewPort.zw);
if(compare(Color,replaceColor1)<aberration)
return tex2D(pattern1,Tex.xy*(vecViewPort.xy/vecSkill1.x));
else if(compare(Color,replaceColor2)<aberration)
return tex2D(pattern2,Tex.xy*(vecViewPort.xy/vecSkill1.y));
else if(compare(Color,replaceColor3)<aberration)
return tex2D(pattern3,Tex.xy*(vecViewPort.xy/vecSkill1.z));
else if(compare(Color,replaceColor4)<aberration)
return tex2D(pattern4,Tex.xy*(vecViewPort.xy/vecSkill1.w));
else
return Color;
}
technique replace {pass one{PixelShader = compile ps_2_0 replacePS();}}
technique fallback {pass one { }}