texdp3tex

DirectX8

Microsoft DirectX 8.1 (pixel shader versions 1.2 and 1.3)

texdp3tex

Performs a three-component dot product and uses the result to do a 1-D texture lookup.

texdp3tex dest, src

Registers

Argument Description RegistersVersion
vn cn tn rn
dest Destination register x 1.2, 1.3
src Source register x 1.2, 1.3

Remarks

Texture registers must use the following sequence.

tex       t(n)        // Define tn as a standard 3-vector (tn must be 
                      // defined in some way before texdp3tex uses it).
texdp3tex t(m), t(n)  // where m > n.                  
                      // Perform a three-component dot product between t(n) and 
                      // the texture coordinate set m. Use the scalar result to
                      // do a 1-D texture lookup at texturestage m and place
                      // the result in t(m).

Here is more detail about how the dot product and texture lookup are done.

// The texdp3tex instruction performs a three-component dot product.
u' = TextureCoordinates(stage m)UVW • t(n)RGB   

// The result is used to sample the texture at texture stage m by performing
// a 1-D lookup.
t(m)RGBA = TextureSample(stage m)RGBA using (u',0,0) as coordinates.