   Sampling artifact
  HelloI'm trying to sample a texture (256x1) and render the result to a 256x256 texture. The texture being sampled contains a permutation table (like the one used in Perlin Noise).I use point filtering and wrap mode for "texSampler". This is the pixel shader:Texture1D permTex;SamplerState texSampler;struct PS_INPUT{float4 pos : SV_Position;float2 texCoord : TEXCOORD;};float4 PSMain(PS_INPUT psIn) : SV_Target{float scale = 3.0f; // 2.0ffloat2 p = psIn.texCoord * scale;int2 pi = floor(p);float pxi = permTex.Sample(texSampler, pi.x / 255.0f).r;float res = permTex.Sample(texSampler, pxi).r;return float4(res.xxx, 1.0f);}When "scale" is 2.0 I get this result (two perfectly delimited stripes, wich is ok):When "scale" is 3.0 I get this:I was expecting to see three perfectly delimited stripes, but this is not the case.The problem here is that between two consecutive stripes there are two lines, enclosed by red ellipses in the picture above and I don't understand why they appear.I ran PIX for two positions (left of the first line and on the first line) and found that "pi.x" and "pxi" are the same, but the second "Sample" returns different results (apparently sampling the same "pxi" position returns different results as I saw in PIX). I noticed these artifacts (lines between stripes) appear only when "scale" is not a power of two number.I think this could be a precision problem but I'm not sure.Can anyone explain why this is happening ? (I tried this on DX9 and DX11 with the same results).Thanks   
I'm trying to sample a texture (256x1) This could be the source of your problems... textures should usually always be in multiples of 2. This is only a wild guess though ;[quote name='falex' timestamp='1303640354' post='4802248']I'm trying to sample a texture (256x1) This could be the source of your problems... textures should usually always be in multiples of 2. This is only a wild guess though [/quote]I tried sampling a 256x256 texture, but I got the same results (those lines between two stripes)   ;  NVIDIA?  Bet it's NVIDIA.Long story short - NVIDIA hardware can typically run shaders with 16-bit or 32-bit floating point precision.  If you're running 16-bit you'll get precision issues on a lot of per-pixel stuff.   ;  I found the cause of the problem. I had mipmapping enabled and it seems that a lower detail level was sampled at the border between two stripes (at texel boundaries where coordinates start to wrap). I replaced "Sample" with "SampleLevel" (with the most detailed mipmap level as parameter) and it worked fine.   