   shaders and vars
  Hy.I'm not understand at all the logic of shaders , i have this question:Is possible for the shader set values in var that can be used for other pixel?Ad es(val is a var):start pixel 0 if ( pixelcolor == red)   val = 1else   val = 2start pixel 1 if (v == 1) do sometinghselse do something elsethanks.   
  Assuming D3D9: No, because shaders are executed in parallel - some cards process an 8x8 block if pixels at once for instance.D3D10: I'm not sure, but I'd guess the same applies.   ;  None of the shader stages have shared memory that can be accessed by more than one execution thread of a shader.However, compute shader for sm 5.0 does have shared memory that can be accessed by a group of threads.  The trouble here is that you don't have control over the order of execution of a pixel or a thread, meaning pixel 2 could execute and complete before pixel 1, and visa-versa. What are you trying to do and what shader model are you restricted to?   