def - ps

Defines pixel shader floating-point constants.

Syntax

def dst, fVvalue1, fValue2, fValue3, fValue4

Where:

Remarks

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

There are two ways to set a floating-point constant in a pixel shader.

  1. Use def to define the constant directly inside a shader.
  2. Use the API to set a constant with IDirect3DDevice9::SetPixelShaderConstantF.

def defines a shader constant whose value is loaded any time a shader is set to a device. These are called immediate constants. Immediate constants take precedence over constants set by the API method.