title: Sample multiple textures and render to multiple textures in same pixel shader
body: <p>My overall goal is to be able to create a pixel shader that takes multiple textures as input, and renders to multiple targets.
  As well as via an initialise and finalise shader, through repeated runs of this shader i will get my result.</p>
  
  <p>I've created shaders with multiple input textures before, and shaders that render to multiple targets, but i've never combined the 2.</p>
  
  <p>What i belive is causing issues is my lack of full understanding of semantics, and how to properly set up input and output textures.</p>
  
  <p>I've seen several different ways of getting input textures and am getting confused as to how it should be set up.</p>
  
  <p>Below is the code for a shared struct that is output by the init and itterate shaders (the finalise shader simply outputs a colour):
  <pre>
  struct FRACTAL_OUTPUT
  {
      float4 IterationsAndControl : COLOR0;
      float4 Variables1And2 : COLOR1;
      float4 Variables3And4 : COLOR2;
  };
  </pre></p>
  
  <p>Below is the texture declarations for the itterate and finalise shaders (the init shader doesn't use any textures):
  <pre>
  Texture2D IterationsAndControl;
  sampler IterationsAndControlSampler : register(s4)
  {
      Texture = &lt;IterationsAndControl>;
  };</p>
  
  <p>Texture2D Variables1And2;
  sampler Variables1And2Sampler : register(s5)
  {
      Texture = &lt;IterationsAndControl>;
  };</p>
  
  <p>Texture2D Variables3And4;
  sampler Variables3And4Sampler : register(s6)
  {
      Texture = &lt;IterationsAndControl>;
  };
  </pre></p>
  
  <p>In c# XNA code, i set the render targets (by doing GraphicsDevice.SetRenderTargets() then set the texture parameters (by doing Effect.Parameter["TextureVariableName"].SetValue(), then draw a quad (via a sprite batch).</p>
  
  <p>Any help would be much appreciated, as i can't find any examples of doing something like this.</p>