Invert

DirectX8

Invert
 
Microsoft Directx 8.1 (pixel shader versions 1.0, 1.1, 1.2, 1.3, 1.4)

Invert

1 - source register

Performs a (1 - value) calculation for each channel of the specified register.

Register

Source register. For more about register types, see Registers.

Remarks

The contents of the register are not changed. The modifier is applied only to the data read from the register. The invert operation is applied to all four color channels (RGBA).

This modifier can be used only with arithmetic instructions. In addition, this modifier cannot be combined with the other source register modifiers.

Example

This example uses inversion to generate the complement of register r1.

mul r0, r0, 1-r1    ; Multiply by (1.0 – r1).