CG等效于texelFetchOffset

时间:2012-10-18 18:24:04

标签: opengl glsl shader cg-language

CG函数GLSL的{​​{1}}等价物是什么?

1 个答案:

答案 0 :(得分:2)

根据nVidia documentation

tex2Dfetch - 在给定的采样器中执行未过滤的纹理查找。

使用以下重载之一:

float4 tex2Dfetch(sampler2D samp, int4 s)
float4 tex2Dfetch(sampler2D samp, int4 s, int texelOff)

int4 tex2Dfetch(isampler2D samp, int4 s)
int4 tex2Dfetch(isampler2D samp, int4 s, int texelOff)

unsigned int4 tex2Dfetch(usampler2D samp, int4 s)
unsigned int4 tex2Dfetch(usampler2D samp, int4 s, int texelOff)

参数

samp
    Sampler to lookup. 
s
    Coordinates to perform the lookup. 
    The level of detail is stored in the last component of the coordinate vector. 
texelOff
    Offset to be added to obtain the final texel.