The Shader Code:
// Shader Variable
float colorIntensity;
texture backTexture;
// Texture Sampler
//sampler2D inputSampler : register(s0);
sampler2D inputSampler;
sampler2D backSampler : register(s1) = sampler_state
{
texture = <backTexture>;
};
// Pixel Shader
float4 SaturateShader(float2 texCoord1 : TEXCOORD0) : COLOR
{
// Get the pixel's color
float4 color1 = tex2D(inputSampler, texCoord1);
float4 color2 = tex2D(backSampler, texCoord1);
// Return the saturated color
//color3 = color2 + .1f;
//color3 = color;
return color2;
}
// Technique
technique SetSaturation
{
pass Pass0
{
pixelShader = compile ps_2_0 SaturateShader();
}
}
The code that sets the second texture:
namespace Light.Entities
{
class PostProcessEffect : PostProcessingEffectBase
{
private Texture2D backTexture;
private float intensity;
public PostProcessEffect(String shader, Texture2D newBackTexture)
: base(shader)
{
backTexture = newBackTexture;
}
public override void InitializeEffect()
{
base.InitializeEffect();
mEnabled = true;
}
public void setIntensity(float intensityValue)
{
intensity = intensityValue;
}
public void updateTexture(Texture2D newBackTexture)
{
mEffect.Parameters["backTexture"].SetValue(newBackTexture);
}
protected override void SetEffectParameters(FlatRedBall.Camera camera)
{
mEffect.Parameters["colorIntensity"].SetValue(intensity);
mEffect.Parameters["backTexture"].SetValue(backTexture);
}
}
}
Edit: Never mind, I solved my problem through sheer luck.