PDA

View Full Version : Using rectangle texture under GLSL



Groovounet
01-06-2005, 03:34 AM
I want to use rectangle texture provide by GL_ARB_texture_rectangle under GLSL. My problem is that i haven't found any sampler data type dedicated to rectangle texture in GLSL 1.05 spec.

Is there any possibility to use GL_ARB_texture_rectangle or I need to wait a new release of GLSL ?

Daniel Wesslen
01-06-2005, 05:05 AM
From ARB_texture_rectangle (http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_rectangle.txt)

Additions to the OpenGL Shading Language specification

Add the following keywords:

samplerRect
samplerRectShadow

Add to section 8.7 "Texture Lookup Functions"

vec4 textureRect(samplerRect sampler, float coord)
vec4 textureRectProj(samplerRect sampler, float coord)

No "bias" parameter is allowed because mipmaps are not allowed for texture rectangles.Unfortunately, ARB_texture_rectangle is not yet supported by ATI (Catalyst 4.12). I don't know about nVidia (but would be very surprised if it didn't work, possibly with some alternate names).

KRONOS
01-06-2005, 09:35 AM
Originally posted by Daniel Wesslen:
ARB_texture_rectangle is not yet supported by ATI (Catalyst 4.12). I don't know about nVidia (but would be very surprised if it didn't work, possibly with some alternate names).NVIDIA already supports it.

KRONOS
01-06-2005, 03:01 PM
I just noticed in the ARB_texture_rectangle extension:

vec4 textureRect(samplerRect sampler, float coord)
vec4 textureRectProj(samplerRect sampler, float coord) Shouldn't the second argument be vec2 instead of float?

Groovounet
01-07-2005, 11:12 PM
Thanks :)