Pages: [1]   Go Down
  Print  
Author Topic: MinFilter = NONE;  (Read 2823 times)
February 13, 2013, 07:19:35 pm
Does use of..

MinFilter = NONE;  
MagFilter = NONE;  
MipFilter = NONE;


..guarantee that a sampled texel in a pixel shader will never be interpolated?

e.g.
if texture (passed in to shader) is known to have (at [u=0,v=32]) values of:
R=0.14  
G=0.763  
B=0.92  
A=0.5

..would the exact values for that texel be read unaltered by the shader using:
float4 tex = tex2D(texSampler, float2(0,32)) ?

The retrieved vaues do appear to be the same, but I don't know if that
is to be expected or merely coincidence

If it isn't guaranteed, is there a way to force the shader to read raw texel values ?

Note:
the values contained in the texture are purely for LookupTable purposes only
(never for rendering) so the accuracy is important.
February 13, 2013, 07:45:12 pm
I don't think filtering type have anything to do with pixel value. It just blend pixels or not based on its type (Something like lerp). So if you want to get only the pixel value (without blending with its neighbor pixel) perhaps none or point will give you the correct per pixel value.

ali-rahimi.net
February 13, 2013, 09:46:50 pm
Ok, I'll assume that the filterOptions in the shader are telling DirextX how to render the texels, but before the shader values are sent down the pipeline for treatment.

If this is true then my texture values outside the shader should always be exactly the same as the texels inside the shader.

If they aren't (and my implementation does not behave as I would expect ) then I'll know something
is wrong with the assumption.
February 13, 2013, 10:09:08 pm
Setting those sampler states to NONE indeed disables all filtering, but it doesn't disable mipmaps. (It just disables filtering across mipmaps.) To disable mipmaps you can use tex2Dlod(sampler, float4(uv, 0, 0)).

Note that a uv coordinate of 32 is outside the 0 to 1 range. So it would be clamped to 1 or wrapped to 0.

Also note that this is filtering of texture inputs. It is not about filtering the rendered results. Just how the texture based input is filtered.
February 15, 2013, 06:28:12 pm
Thanks.

I attempted to toggle the mipLevel dynamically (for debugging purposes) by passing it in
as a CHANNELVALUE0, but it has no effect.

   float4 tex = tex2Dlod(TexSampler, float4(uv, 0, g_mipLevel)

Is this by ShaderModel design (i.e. fixed into the compilation and unchangeable) ?
Pages: [1]   Go Down
  Print  
 
Jump to: