texreg2rgb - ps

Interprets the red, green, and blue (RGB) color components of the source register as texture address data in order to sample the texture at the stage corresponding to the destination register number. The result is stored in the destination register.

Syntax

texreg2rgb dst, src

 

where

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

Remarks

Pixel shader versions 1_1 1_2 1_3 1_4 2_0 2_x 2_sw 3_0 3_sw
texreg2rgb x x

 

This instruction is useful for color-space remapping operations. It supports two-dimensional (2D) and three-dimensional (3D) coordinates. It can be used just like the texreg2ar - ps or texreg2gb - ps to remap 2D data. However, this instruction also supports 3D data so it can be used with cube maps and 3D volume textures.

Here is an example of the sequence the instruction follows.

 
tex t(n)
texreg2rgb t(m), t(n)     where m > n

Here is more detail about how the remapping is accomplished.

// The first instruction loads the texture color (RGBA) into register tn tex tn // The second instruction remaps the color t(m)RGBA = TextureSample(stage m)RGBA using t(n)RGB as coordinates

Pixel Shader Instructions