Microsoft DirectX 8.1 (pixel shader versions 1.2 and 1.3) |
texreg2rgb
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.
texreg2rgb dest, src
Registers
Argument | Description | Registers | Version | |||
---|---|---|---|---|---|---|
vn | cn | tn | rn | |||
dest | Destination register | x | 1.2, 1.3 | |||
src | Source register | x | 1.2, 1.3 |
Remarks
This instruction is useful for color-space remapping operations. It supports two-dimensional (2-D) and three-dimensional (3-D) coordinates. It can be used just like the texreg2ar or texreg2gb to remap 2-D data. However, this instruction also supports 3-D data so it can be used with cube maps and 3-D 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)RGB = TextureSample(stage m)RGB using t(n)RGB as coordinates.