Probably it is some my stupid bug, but I dont know where is the problem.
Im going to to lookup 3D luminance12 texture (texture1) in to 2D RGBA texture (texture2) with width 2 and height 2048.
I hope that shader is correct :
//sample volume in to reg1 glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI); //if( reg1 > 0.5)reg3 = 1; else reg3 = 0; glColorFragmentOp3ATI(GL_CND_ATI, GL_REG_3_ATI, GL_NONE,GL_NONE, GL_ONE, GL_NONE,GL_NONE, GL_ZERO, GL_NONE,GL_NONE, GL_REG_1_ATI, GL_RED,GL_NONE); //reg2 = 2*reg1 - reg3; //T coordinate glColorFragmentOp2ATI(GL_SUB_ATI, GL_REG_2_ATI, GL_NONE,GL_NONE, GL_REG_1_ATI, GL_NONE,GL_2X_BIT_ATI, GL_REG_3_ATI, GL_NONE,GL_NONE); //set S tex coordinate glColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_2_ATI, GL_RED_BIT_ATI,GL_NONE, GL_REG_3_ATI, GL_NONE, GL_NONE); //sample from lookup texunit 2 glSampleMapATI(GL_REG_2_ATI, GL_REG_2_ATI, GL_SWIZZLE_STR_ATI); //move result glColorFragmentOp1ATI(GL_MOV_ATI,GL_REG_0_ATI,GL_NONE,GL_NONE,GL_REG_2_ATI,GL_NONE,GL_NONE);
I Activate texture units, set texture transformation, but I see strange blinnking thins. But when I glEnable(GL_TEXTURE_3D), not after ActiveTextureARB ,
I see something not correkt but it approach what it should be. It looks that there are some problems with texture coordinates.
The same code with ARB_FRAGMENT_PROGRAM with 1D lookup texture, also with blending work pretty nice.
Please try to give me some tip what do I wrong.