首页 技术 正文
技术 2022年11月16日
0 收藏 920 点赞 4,113 浏览 8815 个字

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).
acos Returns the arccosine of each component of x.
all Test if all components of x are nonzero.
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.
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.
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.
atan2 Returns the arctangent of of two values (x,y).
ceil Returns the smallest integer which is greater than or equal to x.
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].
clip Discards the current pixel, if any component of x is less than zero.
cos Returns the cosine of x.
cosh Returns the hyperbolic cosine of x.
countbits Counts the number of bits (per component) in the input integer. 5
cross Returns the cross product of two 3D vectors.
D3DCOLORtoUBYTE4 Swizzles and scales components of the 4D vector xto compensate for the lack of UBYTE4 support in some hardware.
ddx Returns the partial derivative of x with respect to the screen-space x-coordinate.
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.
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.
determinant Returns the determinant of the square matrix m.
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.
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.
exp2 Base 2 exponent (per component).
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)).
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.
fma Returns the double-precision fused multiply-addition of a * b + c. 5
fmod Returns the floating point remainder of x/y.
frac Returns the fractional part of x.
frexp Returns the mantissa and exponent of x.
fwidth Returns abs(ddx(x)) + abs(ddy(x))
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.
isinf Returns true if x is +INF or -INF, false otherwise.
isnan Returns true if x is NAN or QNAN, false otherwise.
ldexp Returns x * 2exp
length Returns the length of the vector v.
lerp Returns x + s(y – x).
lit Returns a lighting vector (ambient, diffuse, specular, 1)
log Returns the base-e logarithm of x.
log10 Returns the base-10 logarithm of x.
log2 Returns the base-2 logarithm of x.
mad Performs an arithmetic multiply/add operation on three values. 5
max Selects the greater of x and y.
min Selects the lesser of x and y.
modf Splits the value x into fractional and integer parts.
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.
normalize Returns a normalized vector.
pow Returns xy.
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.
reversebits Reverses the order of the bits, per component. 5
round Rounds x to the nearest integer
rsqrt Returns 1 / sqrt(x)
saturate Clamps x to the range [0, 1] 1
sign Computes the sign of x.
sin Returns the sine of x
sincos Returns the sine and cosine of x.
sinh Returns the hyperbolic sine of x
smoothstep Returns a smooth Hermite interpolation between 0 and 1.
sqrt Square root (per component)
step Returns (x >= a) ? 1 : 0
tan Returns the tangent of x
tanh Returns the hyperbolic tangent of x
tex1D(s, t) 1D texture lookup. 1
tex1D(s, t, ddx, ddy) 1D texture lookup.
tex1Dbias 1D texture lookup with bias.
tex1Dgrad 1D texture lookup with a gradient.
tex1Dlod 1D texture lookup with LOD.
tex1Dproj 1D texture lookup with projective divide.
tex2D(s, t) 2D texture lookup.
tex2D(s, t, ddx, ddy) 2D texture lookup.
tex2Dbias 2D texture lookup with bias.
tex2Dgrad 2D texture lookup with a gradient.
tex2Dlod 2D texture lookup with LOD. 3
tex2Dproj 2D texture lookup with projective divide.
tex3D(s, t) 3D texture lookup.
tex3D(s, t, ddx, ddy) 3D texture lookup.
tex3Dbias 3D texture lookup with bias.
tex3Dgrad 3D texture lookup with a gradient.
tex3Dlod 3D texture lookup with LOD.
tex3Dproj 3D texture lookup with projective divide.
texCUBE(s, t) Cube texture lookup.
texCUBE(s, t, ddx, ddy) Cube texture lookup.
texCUBEbias Cube texture lookup with bias.
texCUBEgrad Cube texture lookup with a gradient.
texCUBElod Cube texture lookup with LOD.
texCUBEproj Cube texture lookup with projective divide.
transpose Returns the transpose of the matrix m. 1
trunc Truncates floating-point value(s) to integer value(s) 1
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,033
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,520
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,368
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,148
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,781
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,862