Skip to content

Latest commit

 

History

History
75 lines (41 loc) · 1.36 KB

frc---vs.md

File metadata and controls

75 lines (41 loc) · 1.36 KB
title description ms.assetid ms.topic ms.date topic_type api_name api_type api_location
frc - vs
Returns the fractional portion of each input component. | frc - vs
6b6a4475-b665-4de0-9423-88ea8103e606
reference
05/31/2018
apiref

frc - vs

Returns the fractional portion of each input component.

Syntax

frc dst, src

 

where

  • dst is the destination register.
  • src is a source register.

Remarks

Vertex shader versions 1_1 2_0 2_x 2_sw 3_0 3_sw
frc x x x x x x

 

The following code fragment shows conceptually how the instruction operates.

dest.x = src.x - (float)floor(src.x);
dest.y = src.y - (float)floor(src.y);
dest.z = src.z - (float)floor(src.z);
dest.w = src.w - (float)floor(src.w);

The floor function converts the argument passed in to the greatest integer that is less than (or equal to) the argument. This is converted to a float and then subtracted fom the original value. The resulting fractional value ranges from 0.0 through 1.0.

For version 1_1, the allowable write masks are .y and .xy (.x is not allowed).

Related topics

Vertex Shader Instructions