Using the Texture2D.Sample function, how does the pixel shader infer the mipmap level to use? Or does it use mipmap level 0? I am using the ps_4_0 shader model. And replacing Sample, with SampleLevel(state, pos, 0.0), does that give same results? In what cases does it give same results?
struct PS_INPUT
{
float4 pos : SV_POSITION;
float3 tex : TEXCOORD0; // texture coordinate
};
struct PS_OUTPUT
{
float4 color : SV_Target0;
};
Texture2D tex;
SamplerState state {
Filter = MIN_MAG_LINEAR_MIP_POINT;
AddressU = CLAMP;
AddressV = CLAMP;
};
PS_OUTPUT main(PS_INPUT input) : SV_Target
{
PS_OUTPUT output;
output.color = tex.Sample(state, input.pos);
return output;
}