?/TD>
Microsoft DirectX 9.0

texldl (Pixel Shader)


Sample a texture with a particular sampler. The particular mipmap level (LOD) being sampled has to be specified as the 4th component of the texture coordinate.

Syntax

texldl dst, src0, src1

Where:

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
texldlxx

texldl (Pixel Shader) looks up the texture set at the sampler stage referenced by src1. The LOD is selected from src0.w. This value can be negative in which case the LOD selected is the zero'th one (biggest map) with the MAGFILTER. Since src0.w is a floating point value, the fractional value is used to interpolate (if MIPFILTER is LINEAR) between two mip levels. Sampler states MIPMAPLODBIAS and MAXMIPLEVEL are honored. For more information about sampler states, see D3DSAMPLERSTATETYPE.

If a shader program samples from a sampler that does not have a texture set, then 0001 is obtained in the destination register.

The following rough algorithm has been provided for reference, that the reference device follows.

LOD = src0.w + LODBIAS;
if (LOD <= 0 )
{
   LOD = 0;
   Filter = MagFilter;
   tex = Lookup( MAX(MAXMIPLEVEL, LOD), Filter );
}
else
{
   Filter = MinFilter;
   LOD = MAX( MAXMIPLEVEL, LOD);
   tex = Lookup( Floor(LOD), Filter );
   if( MipFilter == LINEAR )
   {
      tex1 = Lookup( Ceil(LOD), Filter );                        
      tex = (1 - frac(src0.w))*tex + frac(src0.w)*tex1;
   }
}

Restrictions:

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.