CG 内置函数 和 HLSL 内置函数
CG 内置函数 英伟达官网链接:
http://http.developer.nvidia.com/Cg/index_stdlib.html
abs
acos
all
any
asin
atan2
atan
bitCount
bitfieldExtract
bitfieldInsert
bitfieldReverse
ceil
clamp
clip
cosh
cos
cross
ddx
ddy
degrees
determinant
distance
dot
exp2
exp
faceforward
findLSB
findMSB
floatToIntBits
floatToRawIntBits
floor
fmod
frac
frexp
fwidth
intBitsToFloat
inverse
isfinite
isinf
isnan
ldexp
length
lerp
lit
log10
log2
log
max
min
modf
mul
normalize
pack
pow
radians
reflect
refract
round
rsqrt
saturate
sign
sincos
sinh
sin
smoothstep
sqrt
step
tanh
tan
tex1DARRAYbias
tex1DARRAYcmpbias
tex1DARRAYcmplod
tex1DARRAYfetch
tex1DARRAYlod
tex1DARRAY
tex1DARRAYproj
tex1DARRAYsize
tex1Dbias
tex1Dcmpbias
tex1Dcmplod
tex1Dfetch
tex1Dlod
tex1D
tex1Dproj
tex1Dsize
tex2DARRAYbias
tex2DARRAYfetch
tex2DARRAYlod
tex2DARRAY
tex2DARRAYproj
tex2DARRAYsize
tex2Dbias
tex2Dcmpbias
tex2Dcmplod
tex2Dfetch
tex2Dlod
tex2DMSARRAYfetch
tex2DMSARRAYsize
tex2DMSfetch
tex2DMSsize
tex2D
tex2Dproj
tex2Dsize
tex3Dbias
tex3Dfetch
tex3Dlod
tex3D
tex3Dproj
tex3Dsize
texBUF
texBUFsize
texCUBEARRAYbias
texCUBEARRAYlod
texCUBEARRAY
texCUBEARRAYsize
texCUBEbias
texCUBElod
texCUBE
texCUBEproj
texCUBEsize
texRBUF
texRBUFsize
texRECTbias
texRECTfetch
texRECTlod
texRECT
texRECTproj
texRECTsize
transpose
trunc
unpack
HLSL 内置函数:https://msdn.microsoft.com/en-us/library/ff471376(v=vs.85).aspx
Intrinsic Functions
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.
| Name | Description | Minimum shader model |
|---|---|---|
| abort | Terminates the current draw or dispatch call being executed. | 4 |
| abs | Absolute value (per component). | 1¹ |
| acos | Returns the arccosine of each component of x. | 1¹ |
| all | Test if all components of x are nonzero. | 1¹ |
| AllMemoryBarrier | Blocks execution of all threads in a group until all memory accesses have been completed. | 5 |
| AllMemoryBarrierWithGroupSync | Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call. | 5 |
| any | Test if any component of x is nonzero. | 1¹ |
| asdouble | Reinterprets a cast value into a double. | 5 |
| asfloat | Convert the input type to a float. | 4 |
| asin | Returns the arcsine of each component of x. | 1¹ |
| asint | Convert the input type to an integer. | 4 |
| asuint | Reinterprets the bit pattern of a 64-bit type to a uint. | 5 |
| asuint | Convert the input type to an unsigned integer. | 4 |
| atan | Returns the arctangent of x. | 1¹ |
| atan2 | Returns the arctangent of of two values (x,y). | 1¹ |
| ceil | Returns the smallest integer which is greater than or equal to x. | 1¹ |
| CheckAccessFullyMapped | Determines whether all values from a Sample or Load operation accessed mapped tiles in a tiled resource. | 5 |
| clamp | Clamps x to the range [min, max]. | 1¹ |
| clip | Discards the current pixel, if any component of x is less than zero. | 1¹ |
| cos | Returns the cosine of x. | 1¹ |
| cosh | Returns the hyperbolic cosine of x. | 1¹ |
| countbits | Counts the number of bits (per component) in the input integer. | 5 |
| cross | Returns the cross product of two 3D vectors. | 1¹ |
| D3DCOLORtoUBYTE4 | Swizzles and scales components of the 4D vector xto compensate for the lack of UBYTE4 support in some hardware. | 1¹ |
| ddx | Returns the partial derivative of x with respect to the screen-space x-coordinate. | 2¹ |
| ddx_coarse | Computes a low precision partial derivative with respect to the screen-space x-coordinate. | 5 |
| ddx_fine | Computes a high precision partial derivative with respect to the screen-space x-coordinate. | 5 |
| ddy | Returns the partial derivative of x with respect to the screen-space y-coordinate. | 2¹ |
| ddy_coarse | Computes a low precision partial derivative with respect to the screen-space y-coordinate. | 5 |
| ddy_fine | Computes a high precision partial derivative with respect to the screen-space y-coordinate. | 5 |
| degrees | Converts x from radians to degrees. | 1¹ |
| determinant | Returns the determinant of the square matrix m. | 1¹ |
| DeviceMemoryBarrier | Blocks execution of all threads in a group until all device memory accesses have been completed. | 5 |
| DeviceMemoryBarrierWithGroupSync | Blocks 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. | 5 |
| distance | Returns the distance between two points. | 1¹ |
| dot | Returns the dot product of two vectors. | 1 |
| dst | Calculates a distance vector. | 5 |
| errorf | Submits an error message to the information queue. | 4 |
| EvaluateAttributeAtCentroid | Evaluates at the pixel centroid. | 5 |
| EvaluateAttributeAtSample | Evaluates at the indexed sample location. | 5 |
| EvaluateAttributeSnapped | Evaluates at the pixel centroid with an offset. | 5 |
| exp | Returns the base-e exponent. | 1¹ |
| exp2 | Base 2 exponent (per component). | 1¹ |
| f16tof32 | Converts the float16 stored in the low-half of the uint to a float. | 5 |
| f32tof16 | Converts an input into a float16 type. | 5 |
| faceforward | Returns -n * sign(dot(i, ng)). | 1¹ |
| firstbithigh | Gets the location of the first set bit starting from the highest order bit and working downward, per component. | 5 |
| firstbitlow | Returns the location of the first set bit starting from the lowest order bit and working upward, per component. | 5 |
| floor | Returns the greatest integer which is less than or equal to x. | 1¹ |
| fma | Returns the double-precision fused multiply-addition of a * b + c. | 5 |
| fmod | Returns the floating point remainder of x/y. | 1¹ |
| frac | Returns the fractional part of x. | 1¹ |
| frexp | Returns the mantissa and exponent of x. | 2¹ |
| fwidth | Returns abs(ddx(x)) + abs(ddy(x)) | 2¹ |
| GetRenderTargetSampleCount | Returns the number of render-target samples. | 4 |
| GetRenderTargetSamplePosition | Returns a sample position (x,y) for a given sample index. | 4 |
| GroupMemoryBarrier | Blocks execution of all threads in a group until all group shared accesses have been completed. | 5 |
| GroupMemoryBarrierWithGroupSync | Blocks 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. | 5 |
| InterlockedAdd | Performs a guaranteed atomic add of value to the dest resource variable. | 5 |
| InterlockedAnd | Performs a guaranteed atomic and. | 5 |
| InterlockedCompareExchange | Atomically compares the input to the comparison value and exchanges the result. | 5 |
| InterlockedCompareStore | Atomically compares the input to the comparison value. | 5 |
| InterlockedExchange | Assigns value to dest and returns the original value. | 5 |
| InterlockedMax | Performs a guaranteed atomic max. | 5 |
| InterlockedMin | Performs a guaranteed atomic min. | 5 |
| InterlockedOr | Performs a guaranteed atomic or. | 5 |
| InterlockedXor | Performs a guaranteed atomic xor. | 5 |
| isfinite | Returns true if x is finite, false otherwise. | 1¹ |
| isinf | Returns true if x is +INF or -INF, false otherwise. | 1¹ |
| isnan | Returns true if x is NAN or QNAN, false otherwise. | 1¹ |
| ldexp | Returns x * 2exp | 1¹ |
| length | Returns the length of the vector v. | 1¹ |
| lerp | Returns x + s(y - x). | 1¹ |
| lit | Returns a lighting vector (ambient, diffuse, specular, 1) | 1¹ |
| log | Returns the base-e logarithm of x. | 1¹ |
| log10 | Returns the base-10 logarithm of x. | 1¹ |
| log2 | Returns the base-2 logarithm of x. | 1¹ |
| mad | Performs an arithmetic multiply/add operation on three values. | 5 |
| max | Selects the greater of x and y. | 1¹ |
| min | Selects the lesser of x and y. | 1¹ |
| modf | Splits the value x into fractional and integer parts. | 1¹ |
| msad4 | Compares a 4-byte reference value and an 8-byte source value and accumulates a vector of 4 sums. | 5 |
| mul | Performs matrix multiplication using x and y. | 1 |
| noise | Generates a random value using the Perlin-noise algorithm. | 1¹ |
| normalize | Returns a normalized vector. | 1¹ |
| pow | Returns xy. | 1¹ |
| printf | Submits a custom shader message to the information queue. | 4 |
| Process2DQuadTessFactorsAvg | Generates the corrected tessellation factors for a quad patch. | 5 |
| Process2DQuadTessFactorsMax | Generates the corrected tessellation factors for a quad patch. | 5 |
| Process2DQuadTessFactorsMin | Generates the corrected tessellation factors for a quad patch. | 5 |
| ProcessIsolineTessFactors | Generates the rounded tessellation factors for an isoline. | 5 |
| ProcessQuadTessFactorsAvg | Generates the corrected tessellation factors for a quad patch. | 5 |
| ProcessQuadTessFactorsMax | Generates the corrected tessellation factors for a quad patch. | 5 |
| ProcessQuadTessFactorsMin | Generates the corrected tessellation factors for a quad patch. | 5 |
| ProcessTriTessFactorsAvg | Generates the corrected tessellation factors for a tri patch. | 5 |
| ProcessTriTessFactorsMax | Generates the corrected tessellation factors for a tri patch. | 5 |
| ProcessTriTessFactorsMin | Generates the corrected tessellation factors for a tri patch. | 5 |
| radians | Converts x from degrees to radians. | 1 |
| rcp | Calculates a fast, approximate, per-component reciprocal. | 5 |
| reflect | Returns a reflection vector. | 1 |
| refract | Returns the refraction vector. | 1¹ |
| reversebits | Reverses the order of the bits, per component. | 5 |
| round | Rounds x to the nearest integer | 1¹ |
| rsqrt | Returns 1 / sqrt(x) | 1¹ |
| saturate | Clamps x to the range [0, 1] | 1 |
| sign | Computes the sign of x. | 1¹ |
| sin | Returns the sine of x | 1¹ |
| sincos | Returns the sine and cosine of x. | 1¹ |
| sinh | Returns the hyperbolic sine of x | 1¹ |
| smoothstep | Returns a smooth Hermite interpolation between 0 and 1. | 1¹ |
| sqrt | Square root (per component) | 1¹ |
| step | Returns (x >= a) ? 1 : 0 | 1¹ |
| tan | Returns the tangent of x | 1¹ |
| tanh | Returns the hyperbolic tangent of x | 1¹ |
| tex1D(s, t) | 1D texture lookup. | 1 |
| tex1D(s, t, ddx, ddy) | 1D texture lookup. | 2¹ |
| tex1Dbias | 1D texture lookup with bias. | 2¹ |
| tex1Dgrad | 1D texture lookup with a gradient. | 2¹ |
| tex1Dlod | 1D texture lookup with LOD. | 3¹ |
| tex1Dproj | 1D texture lookup with projective divide. | 2¹ |
| tex2D(s, t) | 2D texture lookup. | 1¹ |
| tex2D(s, t, ddx, ddy) | 2D texture lookup. | 2¹ |
| tex2Dbias | 2D texture lookup with bias. | 2¹ |
| tex2Dgrad | 2D texture lookup with a gradient. | 2¹ |
| tex2Dlod | 2D texture lookup with LOD. | 3 |
| tex2Dproj | 2D texture lookup with projective divide. | 2¹ |
| tex3D(s, t) | 3D texture lookup. | 1¹ |
| tex3D(s, t, ddx, ddy) | 3D texture lookup. | 2¹ |
| tex3Dbias | 3D texture lookup with bias. | 2¹ |
| tex3Dgrad | 3D texture lookup with a gradient. | 2¹ |
| tex3Dlod | 3D texture lookup with LOD. | 3¹ |
| tex3Dproj | 3D texture lookup with projective divide. | 2¹ |
| texCUBE(s, t) | Cube texture lookup. | 1¹ |
| texCUBE(s, t, ddx, ddy) | Cube texture lookup. | 2¹ |
| texCUBEbias | Cube texture lookup with bias. | 2¹ |
| texCUBEgrad | Cube texture lookup with a gradient. | 2¹ |
| texCUBElod | Cube texture lookup with LOD. | 3¹ |
| texCUBEproj | Cube texture lookup with projective divide. | 2¹ |
| transpose | Returns the transpose of the matrix m. | 1 |
| trunc | Truncates floating-point value(s) to integer value(s) | 1 |
CG 内置函数 和 HLSL 内置函数的更多相关文章
- DirectX HLSL 内置函数
Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HL ...
- 文成小盆友python-num3 集合,函数,-- 部分内置函数
本接主要内容: set -- 集合数据类型 函数 自定义函数 部分内置函数 一.set 集合数据类型 set集合,是一个无序且不重复的元素集合 集合基本特性 无序 不重复 创建集合 #!/bin/en ...
- python 函数 装饰器 内置函数
函数 装饰器 内置函数 一.命名空间和作用域 二.装饰器 1.无参数 2.函数有参数 3.函数动态参数 4.装饰器参数 三.内置函数 salaries={ 'egon':3000, 'alex':10 ...
- Python第七天 函数 函数参数 函数里的变量 函数返回值 多类型传值 函数递归调用 匿名函数 内置函数
Python第七天 函数 函数参数 函数里的变量 函数返回值 多类型传值 函数递归调用 匿名函数 内置函数 目录 Pycharm使用技巧(转载) Python第一天 ...
- Python之函数的递归、匿名函数、内置函数
一.函数的递归 ''' 1 什么是函数递归 函数递归调用(是一种特殊的嵌套调用):在调用一个函数的过程中,又直接或间接地调用了该函数本身 递归必须要有两个明确的阶段: 递推:一层一层递归调用下去,强调 ...
- mysql 内置函数大全 mysql内置函数大全
mysql 内置函数大全 2013年01月15日 19:02:03 阅读数:4698 对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的最左面字符的ASCII代 ...
- php 内置的 html 格式化/美化tidy函数 -- 让你的HTML更美观
php 内置的 html 格式化/美化tidy函数 https://github.com/htacg/tidy-html5 # HTML 格式化 function beautify_html($htm ...
- 生成器的send方法、递推函数、匿名函数及常用内置函数
生成器的send方法 在使用yield方法创建生成器时,不仅可以使用next方法进行取值,还可以通过send方法向生成器的内部传值 什么是send方法? send方法相当于高级的next方法,send ...
- Python学习(七)——匿名函数、map函数、filter函数、reduce函数与其他内置函数
匿名函数 lambda x: x + 1 # lambda:定义匿名函数的关键字 # x:形参 # x+1:程序处理逻辑 fun = lambda x: x + 1 print(fun(5)) #6 ...
随机推荐
- 【codeforces 794A】Bank Robbery
[题目链接]:http://codeforces.com/contest/794/problem/A [题意] 每个位置上可能有物品(>=1)或是没物品 你一开始在某一个位置b; 然后你最左可以 ...
- Mysql学习总结(32)——MySQL分页技术详解
1.什么是数据分页:数据分页就是将很多条记录像书本一样分页,每页显示多少行记录: 2.为什么要数据分页:当我们进行sql语句查询时,假如数据有成千上万行记录,如果在同一个页面去显示,那这个页面得有多大 ...
- 8个超实用的Java测试工具和框架
Java入门 如果你才刚开始接触Java世界,那么要做的第一件事情是,安装JDK——Java Development Kit(Java开发工具包),它自带有Java Runtime Environme ...
- Navgationcontroller 的pop
1.NavgationController pop 回来不进入viewdisload,利用原来载入的视图 不是啊,他pop回来的时候不进viewdidload 直接进去viewwillApper这种方 ...
- 怎样利用JDBC连接并操作Oracle数据库
之前学习.NET的时候.以前利用ODBC进行连接数据库,而在Java中通常採用JDBC连接数据库,这里以oracle数据库为例简单的总结一下利用JDBC怎样连接并操作数据库. 1.连接 public ...
- 用了一天的时间,linux下expect实现ssh自己主动登录server记,歧视下网上各种抄来抄去残段子
由于要对客户方的快30个项目进行特别有顺序的重新启动,所以不得不想办法写个脚本,网上看了不少段子.真是残缺的能够. 没有一段是能够正常运行的.我来按顺序记录一下 脚本的本身 使用expect实现自己主 ...
- 1067. Sort with Swap(0,*) (25)【贪心】——PAT (Advanced Level) Practise
题目信息 1067. Sort with Swap(0,*) (25) 时间限制150 ms 内存限制65536 kB 代码长度限制16000 B Given any permutation of t ...
- HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a probl ...
- zzulioj--1705--小明在工作(模拟水题)
1705: 小明在工作 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 179 Solved: 59 SubmitStatusWeb Board De ...
- Appserv 2.5.10 升级PHP from version 5.2 to 5.3
解决方案查看 该文章:http://blog.csdn.net/dull_boy2/article/details/43927363