   shaders - pixel size
  I've gotten a hold of some shader code in an article I was reading about per pixel lighting. (I've made several posts with questions related to the article).In thier shader code there is a function called from the pixel shader. One of the varibales in that function is vPixelSize. Howeverm, they failed to show where this variable is declared and defined.Is there a way to get the pixel size from my pixel shader? I assume it is supposed to be a float2 from the way it is used.//--------------------------------------------------------------------------------------// Normal Vector Lookup//--------------------------------------------------------------------------------------float3 FetchNomalVector(float2 texCoord, uniform bool readFromTexture, uniform bool useSobelFilter){   // Precomputed look-up   if( readFromTexture )   { float3 normal = normalMap.Sample(samplerLinear, texCoord).rgb;  // Normal texture is stored in DXGI_FORMAT_R8G8B8_UNORM, so each component is in the range 0.0 to 1.0, // whereas the vector we want should be in the range -1.0 to 1.0. The multiply by 2 and subtract 1  // maps those vectors correctly return normalize( normal * 2.0f - 1.0f );   }   else   { // Sobel Filter if( useSobelFilter ) {    float2 o00 = texCoord + float2( -vPixelSize.x, -vPixelSize.y);    float2 o10 = texCoord + float2(0.0f, -vPixelSize.y);    float2 o20 = texCoord + float2(  vPixelSize.x, -vPixelSize.y);   float2 o01 = texCoord + float2( -vPixelSize.x, 0.0f);    float2 o21 = texCoord + float2(  vPixelSize.x, 0.0f);   float2 o02 = texCoord + float2( -vPixelSize.x,  vPixelSize.y);    float2 o12 = texCoord + float2(0.0f,  vPixelSize.y);    float2 o22 = texCoord + float2(  vPixelSize.x,  vPixelSize.y);   // Get eight samples surrounding the current pixel    float h00 = heightMap.Sample( samplerLinear, o00).r;    float h10 = heightMap.Sample( samplerLinear, o10).r;    float h20 = heightMap.Sample( samplerLinear, o20).r;   float h01 = heightMap.Sample( samplerLinear, o01).r;    float h21 = heightMap.Sample( samplerLinear, o21).r;   float h02 = heightMap.Sample( samplerLinear, o02).r;    float h12 = heightMap.Sample( samplerLinear, o12).r;    float h22 = heightMap.Sample( samplerLinear, o22).r;   // Evaluate the Sobel filters    float Gx = h00 - h20 + 2.0f * h01 - 2.0f * h21 + h02 - h22;    float Gy = h00 + 2.0f * h10 + h20 - h02 - 2.0f * h12 - h22;   // Generate the missing Z    float Gz = 0.5f * sqrt(1.0f - Gx * Gx - Gy * Gy);   return normalize( float3( 2.0f * Gx, 2.0f * Gy, Gz); }  // 3 Sample Evaluation else {    float o1 = float2(vPixelSize.x, 0.0f);    float o2 = float2(0.0f, vPixelSize.y);   float h0 = heightMap.Sample( samplerLinear, texCoord).r;    float h1 = heightMap.Sample( samplerLinear, texCoord + o1).r    float h2 = heightMap.Sample( samplerLinear, texCoord + 02).r   float3 v01 = float3( o1, h1 - h0);    float3 v02 = float3( o2, h2 - h0);   float n = cross(v01, v02);   // Can be useful to scale the Z component to tweak the amount bumps show up.    // Less than 1.0 will make them more apparent. Greater than 1.0 will smooth them out    n.z *= 0.5f;   return normalize(n);  }}
  Just took a quick look, but it seems like a 2d filter, so pixelsize is probably a float2 containing the width and height of a texel. In which case you would calculate it as 1.0/TextureWidth, 1.0/TextureHeight.