位置: 编程技术 - 正文

每天30分钟看Shader--(1)HLSL固有函数 【Intrinsic Functions (DirectX HLSL)】(每天看30分钟手机可以吗)

编辑:rootadmin
Intrinsic Functions (DirectX HLSL)

推荐整理分享每天30分钟看Shader--(1)HLSL固有函数 【Intrinsic Functions (DirectX HLSL)】(每天看30分钟手机可以吗),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:每天看30分钟书,每天看30分钟电视影响视力吗,每天看30分钟电视影响视力吗,坚持每天看书30分钟,每天看30分钟电视影响视力吗,每天看30分钟电视影响视力吗,每天30分钟看电脑影响视力吗,每天看30分钟书,内容如对您有帮助,希望把文章链接给更多的朋友!

The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a link to a reference page that has more detail about the input argument and return type.

NameSyntaxDescriptionabsabs(x)Absolute value (per component).acosacos(x)Returns the arccosine of each component of x.allall(x)Test if all components of x are nonzero.anyany(x)Test if any component of x is nonzero.asfloatasfloat(x)Convert the input type to a float.asinasin(x)Returns the arcsine of each component of x.asintasint(x)Convert the input type to an integer.asuintasuint(x)Convert the input type to an unsigned integer.atanatan(x)Returns the arctangent of x.atan2atan2(y, x)Returns the arctangent of of two values (x,y).ceilceil(x)Returns the smallest integer which is greater than or equal to x.clampclamp(x, min, max)Clamps x to the range [min, max].clipclip(x)Discards the current pixel, if any component of x is less than zero.coscos(x)Returns the cosine of x.coshcosh(x)Returns the hyperbolic cosine of x.crosscross(x, y)Returns the cross product of two 3D vectors.D3DCOLORtoUBYTE4D3DCOLORtoUBYTE4(x)Swizzles and scales components of the 4D vector x to compensate for the lack of UBYTE4 support in some hardware.ddxddx(x)Returns the partial derivative of x with respect to the screen-space x-coordinate.ddyddy(x)Returns the partial derivative of x with respect to the screen-space y-coordinate.degreesdegrees(x)Converts x from radians to degrees.determinantdeterminant(m)Returns the determinant of the square matrix m.distancedistance(x, y)Returns the distance between two points.dotdot(x, y)Returns the dot product of two vectors.expexp(x)Returns the base-e exponent.exp2exp2(x)Base 2 exponent (per component).faceforwardfaceforward(n, i, ng)Returns -n * sign(•(i, ng)).floorfloor(x)Returns the greatest integer which is less than or equal to x.fmodfmod(x, y)Returns the floating point remainder of x/y.fracfrac(x)Returns the fractional part of x.frexpfrexp(x, exp)Returns the mantissa and exponent of x.fwidthfwidth(x)Returns abs(ddx(x)) &#; abs(ddy(x))GetRenderTargetSampleCountGetRenderTargetSampleCount()Returns the number of render-target samples.GetRenderTargetSamplePositionGetRenderTargetSamplePosition(x)Returns a sample position (x,y) for a given sample index.isfiniteisfinite(x)Returns true if x is finite, false otherwise.isinfisinf(x)Returns true if x is &#;INF or -INF, false otherwise.isnanisnan(x)Returns true if x is NAN or QNAN, false otherwise.ldexpldexp(x, exp)Returns x * 2explengthlength(v)Returns the length of the vector v.lerplerp(x, y, s)Returns x &#; s(y - x).litlit(n • l, n • h, m)Returns a lighting vector (ambient, diffuse, specular, 1)loglog(x)Returns the base-e logarithm of x.loglog(x)Returns the base- logarithm of x.log2log2(x)Returns the base-2 logarithm of x.maxmax(x, y)Selects the greater of x and y.minmin(x, y)Selects the lesser of x and y.modfmodf(x, out ip)Splits the value x into fractional and integer parts.mulmul(x, y)Performs matrix multiplication using x and y.noisenoise(x)Generates a random value using the Perlin-noise algorithm.normalizenormalize(x)Returns a normalized vector.powpow(x, y)Returns xy.radiansradians(x)Converts x from degrees to radians.reflectreflect(i, n)Returns a reflection vector.refractrefract(i, n, R)Returns the refraction vector.roundround(x)Rounds x to the nearest integerrsqrtrsqrt(x)Returns 1 / sqrt(x)saturatesaturate(x)Clamps x to the range [0, 1]signsign(x)Computes the sign of x.sinsin(x)Returns the sine of xsincossincos(x, out s, out c)Returns the sine and cosine of x.sinhsinh(x)Returns the hyperbolic sine of xsmoothstepsmoothstep(min, max, x)Returns a smooth Hermite interpolation between 0 and 1.sqrtsqrt(x)Square root (per component)stepstep(a, x)Returns (x >= a) ? 1 : 0tantan(x)Returns the tangent of xtanhtanh(x)Returns the hyperbolic tangent of xtex1Dtex1D(s, t)1D texture lookup.tex1Dbiastex1Dbias(s, t)1D texture lookup with bias.tex1Dgradtex1Dgrad(s, t, ddx, ddy)1D texture lookup with a gradient.tex1Dlodtex1Dlod(s, t)1D texture lookup with LOD.tex1Dprojtex1Dproj(s, t)1D texture lookup with projective divide.tex2Dtex2D(s, t)2D texture lookup.tex2Dbiastex2Dbias(s, t)2D texture lookup with bias.tex2Dgradtex2Dgrad(s, t, ddx, ddy)2D texture lookup with a gradient.tex2Dlodtex2Dlod(s, t)2D texture lookup with LOD.tex2Dprojtex2Dproj(s, t)2D texture lookup with projective divide.tex3Dtex3D(s, t)3D texture lookup.tex3Dbiastex3Dbias(s, t)3D texture lookup with bias.tex3Dgradtex3Dgrad(s, t, ddx, ddy)3D texture lookup with a gradient.tex3Dlodtex3Dlod(s, t)3D texture lookup with LOD.tex3Dprojtex3Dproj(s, t)3D texture lookup with projective divide.texCUBEtexCUBE(s, t)Cube texture lookup.texCUBEbiastexCUBEbias(s, t)Cube texture lookup with bias.texCUBEgradtexCUBEgrad(s, t, ddx, ddy)Cube texture lookup with a gradient.texCUBElodtex3Dlod(s, t)Cube texture lookup with LOD.texCUBEprojtexCUBEproj(s, t)Cube texture lookup with projective divide.transposetranspose(m)Returns the transpose of the matrix m.trunctrunc(x)Truncates floating-point value(s) to integer value(s)

表 3-1 HLSL内置函数

函数名 用法

abs 计算输入&#;的绝对&#;。

acos 返回输入&#;反余弦&#;。

all 测试非0&#;。

any 测试输入&#;中的任何非零&#;。

asin 返回输入&#;的反正弦&#;。

atan 返回输入&#;的反正切&#;。

atan2 返回y/x的反正切&#;。

ceil 返回大于或等于输入&#;的最小整数。

clamp 把输入&#;限制在[min, max]范围内。

clip 如果输入向量中的任何元素小于0,则丢弃当前像素。

cos 返回输入&#;的余弦。

cosh 返回输入&#;的双曲余弦。

cross 返回两个3D向量的叉积。

ddx 返回关于屏幕坐标x轴的偏导数。

ddy 返回关于屏幕坐标y轴的偏导数。

degrees 弧度到角度的转换

determinant 返回输入矩阵的&#;。

distance 返回两个输入点间的距离。

dot 返回两个向量的点积。

exp 返回以e为底数,输入&#;为指数的指数函数&#;。

exp2 返回以2为底数,输入&#;为指数的指数函数&#;。

faceforward 检测多边形是否位于正面。

floor 返回小于等于x的最大整数。

fmod 返回a / b的浮点余数。

frac 返回输入&#;的小数部分。

frexp 返回输入&#;的尾数和指数

fwidth 返回 abs ( ddx (x) &#; abs ( ddy(x))。

isfinite 如果输入&#;为有限&#;则返回true,否则返回false。

isinf 如何输入&#;为无限的则返回true。

每天30分钟看Shader--(1)HLSL固有函数 【Intrinsic Functions (DirectX HLSL)】(每天看30分钟手机可以吗)

isnan 如果输入&#;为NAN或QNAN则返回true。

ldexp frexp的逆运算,返回 x * 2 ^ exp。

len / lenth 返回输入向量的长度。

lerp 对输入&#;进行插&#;计算。

lit 返回光照向量(环境光,漫反射光,镜面高光,1)。

log 返回以e为底的对数。

log 返回以为底的对数。

log2 返回以2为底的对数。

max 返回两个输入&#;中较大的一个。

min 返回两个输入&#;中较小的一个。

modf 把输入&#;分解为整数和小数部分。

mul 返回输入矩阵相乘的积。

normalize 返回规范化的向量,定义为 x / length(x)。

pow 返回输入&#;的指定次幂。

radians 角度到弧度的转换。

reflect 返回入射光线i对表面法线n的反射光线。

refract 返回在入射光线i,表面法线n,折射率为eta下的折射光线v。

round 返回最接近于输入&#;的整数。

rsqrt 返回输入&#;平方根的倒数。

saturate 把输入&#;限制到[0, 1]之间。

sign 计算输入&#;的符号。

sin 计算输入&#;的正弦&#;。

sincos 返回输入&#;的正弦和余弦&#;。

sinh 返回x的双曲正弦。

smoothstep 返回一个在输入&#;之间平稳变化的插&#;。

sqrt 返回输入&#;的平方根。

step 返回(x >= a)? 1 : 0。

tan 返回输入&#;的正切&#;。

fanh 返回输入&#;的双曲线切线。

transpose 返回输入矩阵的转置。

tex1D* 1D纹理查询。

tex2D* 2D纹理查询。

tex3D* 3D纹理查询。

texCUBE* 立方纹理查询。Intrinsic Functions (DirectX HLSL)

The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a link to a reference page that has more detail about the input argument and return type.

NameDescriptionMinimum shader modelabsAbsolute value (per component).acosReturns the arccosine of each component of x.allTest if all components of x are nonzero.AllMemoryBarrierBlocks execution of all threads in a group until all memory accesses have been completed.5AllMemoryBarrierWithGroupSyncBlocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call.5anyTest if any component of x is nonzero.asdoubleReinterprets a cast value into a double.5asfloatConvert the input type to a float.4asinReturns the arcsine of each component of x.asintConvert the input type to an integer.4asuintReinterprets the bit pattern of a -bit type to a uint.5asuintConvert the input type to an unsigned integer.4atanReturns the arctangent of x.atan2Returns the arctangent of of two values (x,y).ceilReturns the smallest integer which is greater than or equal to x.clampClamps x to the range [min, max].clipDiscards the current pixel, if any component of x is less than zero.cosReturns the cosine of x.coshReturns the hyperbolic cosine of x.countbitsCounts the number of bits (per component) in the input integer.5crossReturns the cross product of two 3D vectors.D3DCOLORtoUBYTE4Swizzles and scales components of the 4D vector xto compensate for the lack of UBYTE4 support in some hardware.ddxReturns the partial derivative of x with respect to the screen-space x-coordinate.ddx_coarseComputes a low precision partial derivative with respect to the screen-space x-coordinate.5ddx_fineComputes a high precision partial derivative with respect to the screen-space x-coordinate.5ddyReturns the partial derivative of x with respect to the screen-space y-coordinate.ddy_coarseComputes a low precision partial derivative with respect to the screen-space y-coordinate.5ddy_fineComputes a high precision partial derivative with respect to the screen-space y-coordinate.5degreesConverts x from radians to degrees.determinantReturns the determinant of the square matrix m.DeviceMemoryBarrierBlocks execution of all threads in a group until all device memory accesses have been completed.5DeviceMemoryBarrierWithGroupSyncBlocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call.5distanceReturns the distance between two points.dotReturns the dot product of two vectors.1dstCalculates a distance vector.5EvaluateAttributeAtCentroidEvaluates at the pixel centroid.5EvaluateAttributeAtSampleEvaluates at the indexed sample location.5EvaluateAttributeSnappedEvaluates at the pixel centroid with an offset.5expReturns the base-e exponent.exp2Base 2 exponent (per component).ftofConverts the float stored in the low-half of the uint to a float.5ftofConverts an input into a float type.5faceforwardReturns -n * sign(dot(i, ng)).firstbithighGets the location of the first set bit starting from the highest order bit and working downward, per component.5firstbitlowReturns the location of the first set bit starting from the lowest order bit and working upward, per component.5floorReturns the greatest integer which is less than or equal to x.fmodReturns the floating point remainder of x/y.fracReturns the fractional part of x.frexpReturns the mantissa and exponent of x.fwidthReturns abs(ddx(x)) &#; abs(ddy(x))GetRenderTargetSampleCountReturns the number of render-target samples.4GetRenderTargetSamplePositionReturns a sample position (x,y) for a given sample index.4GroupMemoryBarrierBlocks execution of all threads in a group until all group shared accesses have been completed.5GroupMemoryBarrierWithGroupSyncBlocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call.5InterlockedAddPerforms a guaranteed atomic add of value to the dest resource variable.5InterlockedAndPerforms a guaranteed atomic and.5InterlockedCompareExchangeAtomically compares the input to the comparison value and exchanges the result.5InterlockedCompareStoreAtomically compares the input to the comparison value.5InterlockedExchangeAssigns value to dest and returns the original value.5InterlockedMaxPerforms a guaranteed atomic max.5InterlockedMinPerforms a guaranteed atomic min.5InterlockedOrPerforms a guaranteed atomic or.5InterlockedXorPerforms a guaranteed atomic xor.5isfiniteReturns true if x is finite, false otherwise.isinfReturns true if x is &#;INF or -INF, false otherwise.isnanReturns true if x is NAN or QNAN, false otherwise.ldexpReturns x * 2explengthReturns the length of the vector v.lerpReturns x &#; s(y - x).litReturns a lighting vector (ambient, diffuse, specular, 1)logReturns the base-e logarithm of x.logReturns the base- logarithm of x.log2Returns the base-2 logarithm of x.madPerforms an arithmetic multiply/add operation on three values.5maxSelects the greater of x and y.minSelects the lesser of x and y.modfSplits the value x into fractional and integer parts.mulPerforms matrix multiplication using x and y.1noiseGenerates a random value using the Perlin-noise algorithm.normalizeReturns a normalized vector.powReturns xy.Process2DQuadTessFactorsAvgGenerates the corrected tessellation factors for a quad patch.5Process2DQuadTessFactorsMaxGenerates the corrected tessellation factors for a quad patch.5Process2DQuadTessFactorsMinGenerates the corrected tessellation factors for a quad patch.5ProcessIsolineTessFactorsGenerates the rounded tessellation factors for an isoline.5ProcessQuadTessFactorsAvgGenerates the corrected tessellation factors for a quad patch.5ProcessQuadTessFactorsMaxGenerates the corrected tessellation factors for a quad patch.5ProcessQuadTessFactorsMinGenerates the corrected tessellation factors for a quad patch.5ProcessTriTessFactorsAvgGenerates the corrected tessellation factors for a tri patch.5ProcessTriTessFactorsMaxGenerates the corrected tessellation factors for a tri patch.5ProcessTriTessFactorsMinGenerates the corrected tessellation factors for a tri patch.5radiansConverts x from degrees to radians.1rcpCalculates a fast, approximate, per-component reciprocal.5reflectReturns a reflection vector.1refractReturns the refraction vector.reversebitsReverses the order of the bits, per component.5roundRounds x to the nearest integerrsqrtReturns 1 / sqrt(x)saturateClamps x to the range [0, 1]1signComputes the sign of x.sinReturns the sine of xsincosReturns the sine and cosine of x.sinhReturns the hyperbolic sine of xsmoothstepReturns a smooth Hermite interpolation between 0 and 1.sqrtSquare root (per component)stepReturns (x >= a) ? 1 : tanReturns the tangent of xtanhReturns the hyperbolic tangent of xtex1D(s, t)1D texture lookup.1tex1D(s, t, ddx, ddy)1D texture lookup.tex1Dbias1D texture lookup with bias.tex1Dgrad1D texture lookup with a gradient.tex1Dlod1D texture lookup with LOD.tex1Dproj1D texture lookup with projective divide.tex2D(s, t)2D texture lookup.tex2D(s, t, ddx, ddy)2D texture lookup.tex2Dbias2D texture lookup with bias.tex2Dgrad2D texture lookup with a gradient.tex2Dlod2D texture lookup with LOD.3tex2Dproj2D texture lookup with projective divide.tex3D(s, t)3D texture lookup.tex3D(s, t, ddx, ddy)3D texture lookup.tex3Dbias3D texture lookup with bias.tex3Dgrad3D texture lookup with a gradient.tex3Dlod3D texture lookup with LOD.tex3Dproj3D texture lookup with projective divide.texCUBE(s, t)Cube texture lookup.texCUBE(s, t, ddx, ddy)Cube texture lookup.texCUBEbiasCube texture lookup with bias.texCUBEgradCube texture lookup with a gradient.texCUBElodCube texture lookup with LOD.texCUBEprojCube texture lookup with projective divide.transposeReturns the transpose of the matrix m.1truncTruncates floating-point value(s) to integer value(s)

Unity3D之Editor扩展学习——四大名捕闹京东 Unity3D提供了强大的编辑器扩展机制,在项目开发中,如果可以将一些繁琐的工作放在编辑器扩展中进行,则会大大提高效率。本文对编辑器扩展进行了

UGUI问题总结 Image组件:动态改变SourceImage.1.gameObject.GetComponent().image.sprite=YourSprite;(YourSPrite的获取方法有我是在前面定义Spites数组,拉图片入去的.有更好的方法请告诉我

Unity中用触摸控制物体旋转和放大 usingUnityEngine;usingSystem.Collections;usingSystem.IO;publicclassScaleAndRotate:MonoBehaviour{privateToucholdTouch1;//上次触摸点1(手指1)privateToucholdTouch2;//上次触摸点2(手指2)voidSt

标签: 每天看30分钟手机可以吗

本文链接地址:https://www.jiuchutong.com/biancheng/372795.html 转载请保留说明!

上一篇:unity4.x升级到unity5.x材质丢失

下一篇:Unity3D之Editor扩展学习——四大名捕闹京东(unity 扩展编辑器)

  • 加班费要计入个人账户吗
  • 非税收入票据能否税前扣除
  • 进项税额转出期末有余额吗
  • 红字专用发票能作废吗
  • 公司汽车购置税怎么交
  • 项目部电缆属于固定资产吗
  • 一般纳税人变成小规模 在电子税务局哪里可以找到
  • 外地预交的附加税金在申报的时候怎么填
  • 给员工购买意外险进项税能不能抵扣
  • 跨年度费用报销违反什么规定
  • 公司收到银行转账会计分录
  • 营改增后销售租赁后的设备如何做税务处理?
  • 租赁植物费用
  • 代发工资开票内容
  • 转售水的税率
  • 医保卡划入账户金额
  • 城建税如何做会计分录
  • 预收账款在什么科目核算
  • 境外服务收入免税范围
  • 退休返聘人员被辞退未提前通知能要求多付一个月工资吗
  • 工程项目的业务流程
  • 小规模纳税人不用交增值税吗
  • 个人可以代公司缴税吗
  • 风险控制措施包括哪5个方面
  • 包工不包料都包括什么
  • 或有负债披露原则
  • 收款收据怎么写 样本
  • 利润分配未分配利润期末有余额吗
  • 员工意外伤害保险范围
  • 礼品应该计入会计分录
  • 政府扶持资金要交所得税吗
  • 补缴以前月份的个人所得税
  • 苹果电脑录屏带麦克风
  • 实际借款成本率
  • 布拉塞龙图片
  • php怎么输出文字
  • vue通过url访问单个页面
  • node js 安装
  • 猿创部落是干什么的
  • 专用发票跨月冲红给对方吗
  • 帝国cms使用手册
  • 企业所得税的计算公式三种
  • 金蝶软件如何建立新账套
  • 税款所属期止是怎么写
  • 偿还银行贷款利息计算
  • 应收账款余额百分比法怎么算
  • 使用权资产是什么意思
  • sql查看日志
  • 享受残疾人增值服务的是
  • 生产成本结转分录是什么
  • 跨区域预缴税款流程
  • 接待客人后的感受和过程
  • 期初金额是什么
  • 把公司设备操作坏了怎么担责
  • 农业银行多级账簿可以代发工资吗
  • 进项税额允许抵扣分录
  • 支票有效期过期了怎么办
  • sql语句优化总结
  • win7激活怎么关闭
  • win7出现蓝屏如何解决
  • asmb进程
  • windowsxp怎么打开设置
  • 笔记本电脑显示英特尔服务未在运行
  • 双系统其中一个系统无法开机
  • 电脑导航阻止怎么办
  • jquery动画库
  • IE6,IE7和firefox对DIV的支持区别
  • python语言中
  • perl读取文件内容到数组
  • cocos2dx4.0教程
  • Javascript获取元素的父元素
  • css样式不能制作体积更小下载更快的网页
  • 手游 unity
  • eclipse折叠代码块if else工具
  • python读取图片属性
  • 河北税务怎么看自己绑定的银行卡号
  • 税务人员服务态度恶劣怎么办
  • 样板房费用属于开发成本的什么明细科目
  • 矿山耕地占用税计入什么科目
  • 山东省国税局电话客服热线
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设