PDA

View Full Version : glSampleMapATI



yuval
04-01-2004, 12:41 PM
Hello

i am trying to write a 8bit -> 32 bit lut with ATI card using fragment ext.

i create GL_TEXTURE_2D "original" with GL_ALPHA 8 bit and GL_TEXTURE_1D "lut" with GL_RGBA 256 width.

my fragment code is:

ati_shader_id = glGenFragmentShadersATI(1);
glEnable(GL_FRAGMENT_SHADER_ATI);
{ //The Shader
glBindFragmentShaderATI(ati_shader_id);
glBeginFragmentShaderATI();
{
glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
glColorFragmentOp1ATI(GL_MOV_ATI,
GL_REG_1_ATI, GL_NONE, GL_NONE,
GL_REG_0_ATI, GL_ALPHA, GL_NONE);
glSampleMapATI(GL_REG_1_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI);
glColorFragmentOp1ATI(GL_MOV_ATI,
GL_REG_0_ATI, GL_NONE, GL_NONE,
GL_REG_1_ATI, GL_NONE, GL_NONE);
} glEndFragmentShaderATI();
} glDisable(GL_FRAGMENT_SHADER_ATI);

the drawing is :

glEnable(GL_FRAGMENT_SHADER_ATI);
glBindFragmentShaderATI(ati_shader_id);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_1D);
glBindTexture(GL_TEXTURE_1D, lut);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, original);
..
glMultiTexCoord2dARB(GL_TEXTURE0_ARB,0.0, 0.0);

what i am doing wrong ??
i can no see anything.

thanks.