texdp3tex - ps

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


texdp3tex dst, src



  • dst is the destination register.
  • src is a source register.


Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw


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 1D 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 1D lookup.

t(m)RGBA = TextureSample(stage m)RGBA using (u',0,0) as coordinates

Related topics

Pixel Shader Instructions