title: Can I generate a random number inside a pixel shader?
body: <p>I'm trying to write a very simple shader that adds random sparkle to applicable objects. The way I'd like to do this is by adding a random shade of white (R = G = B) to the pixel value within the pixel shader. </p>
  
  <p>It seems that <code>noise()</code> doesn't work the way I hope it does:</p>
  
  <pre><code>float multiplier = noise(float3(Input.Position[0], Input.Position[1], time));
  </code></pre>
  
  <p>It gives me "error X4532: cannot map expression to pixel shader instruction set" referring to the call to <code>noise()</code>.</p>
  
  <p>Since I don't know of a way to retain a number between calls to the shader, I don't think I can just write a simple random number producing function based on a seed passed in before rendering.</p>
  
  <p>Is there a way to produce a random number from inside a pixel shader? If there is a way, how?</p>