Converts a floating-point, 4D vector set by a D3DCOLOR to a UBYTE4.


This function swizzles and scales components of the x parameter. Use this function to compensate for the lack of UBYTE4 support in some hardware.


Item Description
[in] The floating-point vector4 to convert.

Return Value

The UBYTE4 representation of the x parameter.

Type Description

Name Template Type Component Type Size
x vector float 4
ret vector integer 4

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 2 (DirectX HLSL) and higher shader models yes
Shader Model 1 (DirectX HLSL) vs_1_1

See also

Intrinsic Functions (DirectX HLSL)