PDA

View Full Version : sampleRect - nVidia hardware



Zulfiqar Malik
01-26-2005, 10:08 PM
I have been working on rectangular textures recently (GL_ARB_texture_rectangle) and managed to get it working fairly easily. Now i was trying to do some pixel shader operations in which i needed to access the texture, and therefore i declared a sampler of type sampleRect and accessed it via textureRect function (and i found them to be consistent with the details in the ARB rectangular texture specification sheet). The problem i am having is that apparently nVidia's latest drivers don't support samplerRect and i get a compiler error when i try to compile such a program (although support for GL_TEXTURE_RECTANGLE_ARB is complete!). I am using GFX 5700 Ultra (Latest driver version 66.93). Currently i have been forced to use CG instead but CG is not much of an option because of its issues with ATI hardware. Has anyone else encountered such a problem, if yes, what is the "workaround" if any?
Any help will be appreciated.

sqrt[-1]
01-27-2005, 12:25 AM
Nvidia drivers have no problem with rectangle textures in GLSl . In fact, some of the GLSL demos in the nvidia SDK use rectangle textures.

ie.
uniform vec4 scale;
uniform vec4 bias;
uniform sampler2DRect tex;

void main()
{
vec2 uv = gl_TexCoord[0].st;
gl_FragColor = texture2DRect(tex, uv) * scale + bias;
}

Zulfiqar Malik
01-27-2005, 03:30 AM
Thanks a lot, problem solved!