I use DarkShader to make the shaders, it shows where the errors are and how to fix them, which is really awesome.
To merge the bleachbypass and gasmask shaders all I'd need to do is copy over the texture samplers
texture Normalmap : DIFFUSE
<
string ResourceName = "";
>;
sampler NormalmapSamp = sampler_state
{
Texture = <Normalmap>;
MinFilter = Linear; MagFilter = Linear; MipFilter = Linear;
AddressU = Wrap; AddressV = Wrap;
};
texture Dirtmap : DIFFUSE
<
string ResourceName = "";
>;
sampler DirtmapSamp = sampler_state
{
Texture = <Dirtmap>;
MinFilter = Linear; MagFilter = Linear; MipFilter = Linear;
AddressU = Wrap; AddressV = Wrap;
};
and then copy over the displasment, overlay and vignetting code.
float2 displace = Tex;
//float timer = time*.1;
float timer = 1; //no movement
//displace.x -= timer; //left to right refraction
//displace.y -= timer; //downward refraction
displace = displace-timer;
float refractscale = .05;
float4 Normalmap = (tex2D(NormalmapSamp,displace.xy)*2-1) ;
float2 displaceUV = Normalmap * refractscale;
// sample the source
float4 cTextureScreen = tex2D( frameSamp, Tex.xy + displaceUV);
float4 dirtmap = tex2D( DirtmapSamp, Tex.xy + displaceUV);
//vignette
float2 vpos = (Tex.xy - float2(.5,.5)) * 2 ;
//vpos.x = vpos.x * -1.5 - 0; //can also scale and shift horizontally
float dist = (dot(vpos, vpos)) ;
dist = 1-0.3 * dist;
return float4(0.8*cTextureScreen.xyz*dirtmap.xyz+(0.25*dirtmap.xyz*cTextureScreen.xyz), cTextureScreen.a) ;
And edit it so that it works.
I'll try to make it, it shouldn't be too hard.