?/TD>
Microsoft DirectX 9.0

sincos (Pixel Shader)


Computes sine and cosine, in radians. The x-component of result contains cos(x). The y component contains sin(x). The src1 register needs to have a replicate swizzle to indicate which channel is used.

Syntax

sincos dst, src0, src1, src2

where

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
sincosxxxxx

Source register rules:

These values are defined in the following macros: D3DSINCOSCONST1 and D3DSINCOSCONST2.

Destination register rules:

The maximum absolute error is 0.002.

This is a macro instruction, which takes eight instruction slots.

If application wants to compute sincos for an arbitrary angle, then the angle could be mapped to the range -Pi to +Pi by using the following macro (r0.x holds the original angle).

def c0, Pi, 0.5f, 2*Pi, 1/(2*Pi)
mad r0.x, r.x, c0.w, c0.y
frc r0.x, r0.x
mad r0.x, r0.x, c0.z, -c0.x

Instruction Information

Minimum operating systemWindows 98

Related Topics



© 2002 Microsoft Corporation. All rights reserved.