内置函数和变量
http://blog.csdn.net/a6627651/article/details/50680360
Name | Syntax | Description |
---|---|---|
abs | abs(x) | Absolute value (per component). |
acos | acos(x) | Returns the arccosine of each component of x. |
all | all(x) | Test if all components of x are nonzero. |
any | any(x) | Test if any component of x is nonzero. |
asfloat | asfloat(x) | Convert the input type to a float. |
asin | asin(x) | Returns the arcsine of each component of x. |
asint | asint(x) | Convert the input type to an integer. |
asuint | asuint(x) | Convert the input type to an unsigned integer. |
atan | atan(x) | Returns the arctangent of x. |
atan2 | atan2(y, x) | Returns the arctangent of of two values (x,y). |
ceil | ceil(x) | Returns the smallest integer which is greater than or equal to x. |
clamp | clamp(x, min, max) | Clamps x to the range [min, max]. |
clip | clip(x) | Discards the current pixel, if any component of x is less than zero. |
cos | cos(x) | Returns the cosine of x. |
cosh | cosh(x) | Returns the hyperbolic cosine of x. |
cross | cross(x, y) | Returns the cross product of two 3D vectors. |
D3DCOLORtoUBYTE4 | D3DCOLORtoUBYTE4(x) | Swizzles and scales components of the 4D vector x to compensate for the lack of UBYTE4 support in some hardware. |
ddx | ddx(x) | Returns the partial derivative of x with respect to the screen-space x-coordinate. |
ddy | ddy(x) | Returns the partial derivative of x with respect to the screen-space y-coordinate. |
degrees | degrees(x) | Converts x from radians to degrees. |
determinant | determinant(m) | Returns the determinant of the square matrix m. |
distance | distance(x, y) | Returns the distance between two points. |
dot | dot(x, y) | Returns the dot product of two vectors. |
exp | exp(x) | Returns the base-e exponent. |
exp2 | exp2(x) | Base 2 exponent (per component). |
faceforward | faceforward(n, i, ng) | Returns -n * sign(•(i, ng)). |
floor | floor(x) | Returns the greatest integer which is less than or equal to x. |
fmod | fmod(x, y) | Returns the floating point remainder of x/y. |
frac | frac(x) | Returns the fractional part of x. |
frexp | frexp(x, exp) | Returns the mantissa and exponent of x. |
fwidth | fwidth(x) | Returns abs(ddx(x)) + abs(ddy(x)) |
GetRenderTargetSampleCount | GetRenderTargetSampleCount() | Returns the number of render-target samples. |
GetRenderTargetSamplePosition | GetRenderTargetSamplePosition(x) | Returns a sample position (x,y) for a given sample index. |
isfinite | isfinite(x) | Returns true if x is finite, false otherwise. |
isinf | isinf(x) | Returns true if x is |