texldl - vs
Microsoft DirectX 9.0 SDK Update (October 2004)

texldl - vs


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

Syntax

texldl dst, src0, src1

Where:

Remarks

Vertex shader versions1_12_02_x2_sw3_03_sw
texldlxx

texldl 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 "zeroth one" (biggest map) with the MAGFILTER. Because 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, 0001 is obtained in the destination register.

This is an approximation to the reference device algorithm.

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:



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.