Lindley
05-01-2007, 11:26 AM
Apologies if this isn't the place for Cg questions, I haven't found a forum devoted to that yet....
There seems to be very little documentation available for the Cg Standard Library. Anyone know a good reference?
In particular....
1) If I have a fragment program which needs to access a texture, is it enough to specify the coordinate
samplerRECT tex : TEXUNIT0
? I read somewhere that these parameters have to be uniform, but that doesn't make sense to me---the glBindTexture call should be all the higher-level code has to do. It shouldn't need to call cgGLSetTextureParameter as well, or so my sensibility goes.
2) How does the texRECT function behave when presented with texture coordinates outside the range [0,h]x[0,w]? Is this dependent on the OpenGL texture mode?
3) How do I retrieve the width and height of a samplerRECT object? If necessary I could pass them as a uniform float2, but that seems like a waste, again.....
4) Can uniform parameters be int2, etc, or just floating-point types? I ask because (again, due to lack of a good reference list) I only see versions of cgGLSetParameter* which take floats and doubles.
Thanks....
There seems to be very little documentation available for the Cg Standard Library. Anyone know a good reference?
In particular....
1) If I have a fragment program which needs to access a texture, is it enough to specify the coordinate
samplerRECT tex : TEXUNIT0
? I read somewhere that these parameters have to be uniform, but that doesn't make sense to me---the glBindTexture call should be all the higher-level code has to do. It shouldn't need to call cgGLSetTextureParameter as well, or so my sensibility goes.
2) How does the texRECT function behave when presented with texture coordinates outside the range [0,h]x[0,w]? Is this dependent on the OpenGL texture mode?
3) How do I retrieve the width and height of a samplerRECT object? If necessary I could pass them as a uniform float2, but that seems like a waste, again.....
4) Can uniform parameters be int2, etc, or just floating-point types? I ask because (again, due to lack of a good reference list) I only see versions of cgGLSetParameter* which take floats and doubles.
Thanks....