HLSL 函数 备用

在网上看到有人贴的,自己该了改,有的翻译按自己的习惯写的,(其实原来的帖子没什么问题,已经非常好了)就是做成表格的好看些。留作备忘

abs(x)绝对值 (每组件).Absolute value (per component).
acos(x)返回x每个组件的acos值.Returns the arccosine of each component of x.
all(x)测试x的所有组件是否都是非零.Test if all components of x are nonzero. 
any(x)测试x的任一组件是否是非零.Test if any component of x is nonzero. 
asfloat(x)将输入值转换为一个浮点值.Convert the input type to a float. 
asin(x)返回x每个组件的asin值.the arcsine of each component of x. 
asint(x)将输入值转换为一个整形值.Convert the input type to an integer. 
asuint(x)将输入值转换为一个无符号整形值.Convert the input type to an unsigned integer. 
atan(x)返回x的atan值.Returns the arctangent of x. 
atan2(y, x)返回x,y这两个值的atan值.Returns the arctangent of of two values (x,y). 
ceil(x)返回大于等于x的最小整数Returns the smallest integer which is greater than or equal to x. 
clamp(x, min, max)把输入值限制在[min, max]范围内。Clamps x to the range [min, max]. 
clip(x)如果输入向量中的任何元素小于0,则丢弃当前像素Discards the current pixel, if any component of x is less than zero. 
cos(x)返回输入值的余弦Returns the cosine of x. 
cosh(x)返回输入值的双曲余弦Returns the hyperbolic cosine of x. 
cross(x, y)返回两个3D向量的叉积Returns the cross product of two 3D vectors. 
D3DCOLORtoUBYTE4(x)混合和缩放4D向量x用于补偿一些对UBYTE4支持的硬件Swizzles and scales components of the 4D vector x to compensate for the lack of UBYTE4 support in some hardware. 
ddx(x)返回关于屏幕坐标x轴的偏导数Returns the partial derivative of x with respect to the screen-space x-coordinate. 
ddy(x)返回关于屏幕坐标y轴的偏导数Returns the partial derivative of x with respect to the screen-space y-coordinate. 
degrees(x)弧度到角度的转换Converts x from radians to degrees. 
determinant(m)返回输入矩阵的值Returns the determinant of the square matrix m. 
distance(x, y)返回两点间的距离Returns the distance between two points. 
dot(x, y)返回两个向量的点积Returns the dot product of two vectors. 
exp(x)返回以e为底数,输入值为指数的指数函数值Returns the base-e exponent. 
exp2(x)返回以2为底数,输入值为指数的指数函数值Base 2 exponent (per component). 
faceforward(n, i, ng)检测多边形是否位于正面Returns -n * sign(●(i, ng)). 
floor(x)返回小于等于x的最大整数Returns the greatest integer which is less than or equal to x. 
fmod(x, y)返回x / y的浮点余数Returns the floating point remainder of x/y. 
frac(x)返回输入值的小数部分Returns the fractional part of x. 
frexp(x, exp)返回输入值的尾数和指数Returns the mantissa and exponent of x. 
fwidth(x)返回 abs ( ddx (x) + abs ( ddy(x))。Returns abs(ddx(x)) + abs(ddy(x)) 
GetRenderTargetSampleCount()返回RT的个数Returns the number of render-target samples. 
GetRenderTargetSamplePosition(x)返回关于给定采样索引的一个采样点(x,y)Returns a sample position (x,y) for a given sample index. 
isfinite(x)如果输入值为有限值则返回true,否则返回falseReturns true if x is finite, false otherwise. 
isinf(x)如何输入值为无限的则返回trueReturns true if x is +INF or -INF, false otherwise. 
isnan(x)如果输入值为NAN或QNAN则返回trueReturns true if x is NAN or QNAN, false otherwise. 
ldexp(x, exp)frexp的逆运算,返回 x * 2 ^ expReturns x * 2exp 
length(v)返回输入向量的长度(length/len)Returns the length of the vector v. 
lerp(x, y, s)对输入值进行插值计算Returns x + s(y - x). 
lit(n ● l, n ● h, m)返回光照向量(环境光,漫反射光,镜面高光,1)。Returns a lighting vector (ambient, diffuse, specular, 1) 
log(x)返回以e为底的对数Returns the base-e logarithm of x. 
log10(x)返回以10为底的对数Returns the base-10 logarithm of x. 
log2(x)返回以2为底的对数Returns the base-2 logarithm of x. 
max(x, y)返回两个输入值中较大的一个Selects the greater of x and y. 
min(x, y)返回两个输入值中较小的一个Selects the lesser of x and y. 
modf(x, out ip)把输入值分解为整数和小数部分Splits the value x into fractional and integer parts. 
mul(x, y)返回输入矩阵相乘的积Performs matrix multiplication using x and y. 
noise(x)使用柏林噪声算法生成一个随机值Generates a random value using the Perlin-noise algorithm. 
normalize(x)返回规范化的向量,定义为 x / length(x)。Returns a normalized vector. 
pow(x, y)返回输入值x的指定y次幂Returns xy. 
radians(x)角度到弧度的转换Converts x from degrees to radians. 
reflect(i, n)返回入射光线i对表面法线n的反射光线Returns a reflection vector. 
refract(i, n, R)返回在入射光线i,表面法线n,折射率为eta下的折射光线vReturns the refraction vector. 
round(x)返回最接近于输入值的整数Rounds x to the nearest integer 
rsqrt(x)返回输入值平方根的倒数Returns 1 / sqrt(x) 
saturate(x)把输入值限制到[0, 1]之间Clamps x to the range [0, 1] 
sign(x)计算输入值的符号Computes the sign of x. 
sin(x)计算输入值的正弦值Returns the sine of x 
sincos(x, out s, out c)返回输入值的正弦和余弦值Returns the sine and cosine of x. 
sinh(x)返回x的双曲正弦Returns the hyperbolic sine of x 
smoothstep(min, max, x)返回一个在输入值之间平稳变化的插值Returns a smooth Hermite interpolation between 0 and 1. 
sqrt(x)返回输入值的平方根Square root (per component) 
step(a, x)返回(x >= a)? 1 : 0Returns (x >= a) ● 1 : 0 
tan(x)返回输入值的正切值Returns the tangent of x 
tanh(x)返回输入值的双曲线切Returns the hyperbolic tangent of x 
tex1D(s, t)1D纹理寻址1D texture lookup. 
tex1Dbias(s, t)1D纹理寻址(支持bias)1D texture lookup with bias. 
tex1Dgrad(s, t, ddx, ddy)1D纹理偏移寻址1D texture lookup with a gradient. 
tex1Dlod(s, t)1D纹理寻址(支持LOD)1D texture lookup with LOD. 
tex1Dproj(s, t)1D纹理寻址(使用透视分离)1D texture lookup with projective divide. 
tex2D(s, t) 2D2D纹理寻址2D texture lookup. 
tex2Dbias(s, t)2D纹理寻址(支持bias)2D texture lookup with bias. 
tex2Dgrad(s, t, ddx, ddy)2D纹理偏移寻址2D texture lookup with a gradient. 
tex2Dlod(s, t)2D2D纹理寻址(支持LOD)2D Texture lookup with LOD. 
tex2Dproj(s, t)2D2D纹理寻址(使用透视分离)2D texture lookup with projective divide. 
tex3D(s, t)3D3D纹理寻址3D texture lookup. 
tex3Dbias(s, t)3D纹理寻址(支持bias)3D texture lookup with bias. 
tex3Dgrad(s, t, ddx, ddy)3D纹理偏移寻址3D texture lookup with a gradient. 
tex3Dlod(s, t)3D纹理寻址(支持LOD)3D texture lookup with LOD. 
tex3Dproj(s, t)3D纹理寻址(使用透视分离)3D texture lookup with projective divide. 
texCUBE(s, t)立方体纹理寻址Cube texture lookup. 
texCUBEbias(s, t)立方体纹理寻址(支持bias)Cube texture lookup with bias. 
texCUBEgrad(s, t, ddx, ddy)立方体纹理偏移寻址Cube texture lookup with a gradient. 
tex3Dlod(s, t)立方体纹理偏移寻址(支持LOD)Cube texture lookup with LOD. 
texCUBEproj(s, t)立方体纹理寻址(使用透视分离)Cube texture lookup with projective divide. 
transpose(m)返回输入矩阵的转置Returns the transpose of the matrix m. 
trunc(x)截取浮点值到整数值Truncates floating-point value(s) to integer value(s) 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值