Hello friends,

How do I sample pixels around a pixel in a pixel shader loop? (thats alot of pixels lol)

For example, I want to be able to go through every pixel of an image, find out color values around it, do some stuff, and add this stuff to the final render target. For pixel 1, i want to see what color the pixel to the left/right/up/down of it is, and then change pixel 1 of the final camera render target, then move onto pixel 2. I think I've got the render chain down, I am just working on the final effect shader.

I am looking at the Blur PP from the wiki as a starting point but have a few questions:

Code:
float4 vecSkill1;

float2 samples[12]
=	{
		-0.326212, -0.405805,
		-0.840144, -0.073580,
		-0.695914,  0.457137,
		-0.203345,  0.620716,
		 0.962340, -0.194983,
		 0.473434, -0.480026,
		 0.519456,  0.767022,
		 0.185461, -0.893124,
		 0.507431,  0.064425,
		 0.896420,  0.412458,
		-0.321940, -0.932615,
		-0.791559, -0.597705
	};
	
texture TargetMap;

sampler postTex = sampler_state
{
   texture = (TargetMap);
   MinFilter = linear;
   MagFilter = linear;
   MipFilter = linear;
   AddressU = Clamp;
   AddressV = Clamp;
};

float4 Blur_PS(float2 texCoord: TEXCOORD0) : COLOR
{
	float4 color;

	color = tex2D(postTex, texCoord);

	for (int i = 0; i < 12; i++)
	{
		color += tex2D(postTex, texCoord + vecSkill1[0] * samples[i]);
	}

	return color / 13;
}

technique tech_00
{
	pass pass_00
	{
		VertexShader = null;
		PixelShader = compile ps_2_0 Blur_PS();
	}
}

technique fallback { pass one { } }



Questions:

1. float2 Samples[12]...why does this have a list of seemingly arbitrary numbers? What are these numbers used for? I dont see a rhyme or reason to these values. I see that its multiplied by vecskill, but why?

2. How come TexCoord isnt incremented? How does the blur apply to every pixel without iterating through them?