Arithmetic instructions
Direct3D 8 - Pixel Shader - Arithmetic instructions (Microsoft) (Source 2)
Last edited 2026-01-27
This section contains reference information for the pixel shader version ps.1.x instructions.
There are several types of pixel shader instructions, as shown in the following table.
1¹ for Instruction slots means:
- The number 1 indicates that the instruction occupies 1 instruction slot in the pixel shader limit.
- The number ¹ means that in different versions of the pixel shader, the number of instructions may vary.
The meaning of colors in the Type column:
|
Color |
Description |
|
Green |
The instruction works in Fusion. |
|
Yellow |
The instruction has not been confirmed to work in Fusion. |
|
Red |
The instruction does not work in Fusion. |
Arithmetic instructions
|
Type |
Instruction |
Description |
Instruction slots |
ps.1.0 |
ps.1.1 |
ps.1.2 |
ps.1.3 |
ps.1.4 |
Note |
|
asm |
Add two vectors |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Assigns the sum of two values to the target. |
|
|
asm |
Apply a fake bump environment-map transform |
2 |
No |
No |
No |
No |
Yes |
Used to modify texCoords based on two texture. |
|
|
asm |
Compare source to 0 |
1¹ |
No |
No |
Yes |
Yes |
Yes |
An IF/ELSE condition that checks whether the given number is greater or eqaul than 0 and assigns the appropriate color. |
|
|
asm |
Compare source to 0.5 |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
An IF/ELSE condition that checks whether the given number is greater than 0.5 and assigns the appropriate color. |
|
|
asm |
Three-component dot product |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Multiplies vectors (red with red, green with green, blue with blue) and adds them all together, returning the sum. |
|
|
asm |
Four-component dot product |
1¹ |
No |
No |
Yes |
Yes |
Yes |
Multiplies vectors (red with red, green with green, blue with blue, alpha with alpha) and adds them all together, returning the sum. |
|
|
asm |
Linear interpolate |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Returns linear interpolate value between x and y, depending on t. |
|
|
asm |
Multiply and add |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Uses multiplication and addition in one instruction slot. |
|
|
asm |
Move |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Assigns the given value to the target. |
|
|
asm |
Multiply |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Assigns the multiplication of two values to a target. |
|
|
asm |
No operation |
0 |
Yes |
Yes |
Yes |
Yes |
Yes |
This instruction does nothing. |
|
|
asm |
Subtract |
1 |
Yes |
Yes |
Yes |
Yes |
Yes |
Assigns the difference of two values to the target. |
Created with the Personal Edition of HelpNDoc: iPhone web sites made easy