magnification filter and shaders

Hi,

Rendering a primitive using a 8x8 texture specified with a linear magnification filter containing some fairly smooth values; the fixed pipeline generates a nice smooth color across the surface, but when using a simple cg or glsl shader, which does nothing but looking up the texture value and using it as output the result is rather blocky. screenshot

The texture is specified with the following parameters:
Target = GL_TEXTURE_2D, format = GL_RGB, wrap = GL_CLAMP_TO_EDGE

Changing the shader profile does not correct this! Does anyone know what limitation I am facing?

  • Hel

This looks like these problems :
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001431;p=1#000000

Maybe there is something fishy there…

Don’t use GL_RGB as it can be any precision. Use GL_RGB8 instead.

Thank you humus,

Although it did not correct my problem, it showed me how naive I had been! My shader was multiplying the 8 bit channels with an uniform constant, which increased the inevitable numerical errors! When I changed the internal format to GL_RGB_FLOAT16_ATI it worked just fine. The nice thing about 16 bit floating point textures is that they support filters.

Originally posted by Hel:
The nice thing about 16 bit floating point textures is that they support filters.
Filtering of floating point textures is not supported on ATI hw older than R600 (Radeon HD Radeon HD 2x00 family) so you need to filter manually in the shader if you wish support X1x00 and older hw.