Hi,
Using the GL_ATI_fragment_shader extension, is it allowed to do that :
glBeginFragmentShaderATI();
// Pass 1
glPassTexCoordATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI);// r2 = texcoord0 + offset_given_by_color_of_texture1
glColorFragmentOp2ATI(GL_ADD_ATI, GL_REG_2_ATI, GL_NONE, GL_NONE,
GL_REG_0_ATI, GL_NONE, GL_NONE,
GL_REG_1_ATI, GL_NONE, GL_NONE);// Pass 2
glSampleMapATI(GL_REG_0_ATI, GL_REG_2_ATI, GL_SWIZZLE_STR_ATI);// final_rgb = texture0(offset) * primary
glColorFragmentOp3ATI(GL_MUL_ATI, GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI,
GL_REG_0_ATI, GL_NONE, GL_NONE,
GL_PRIMARY_COLOR_ARB, GL_NONE, GL_NONE);// final_alpha = 1
glAlphaFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_SATURATE_BIT_ATI,
GL_ZERO, GL_NONE, GL_COMP_BIT_ATI);glEndFragmentShaderATI();
The idea is to get a sample color from texture1 and use it as a texture coordinate offset for texture0.
This does not work with Radeon8500 and Radeon9700, so I would like if it is an allowed operation or if I’m mis-using the functionality.
Such effect is possible with the ATI_texture_envmap_bumpmap extension, so I think the hardware is capable of doing it in a fragment shader.
Anyway, the spec does not mention that such operation is forbidden for eg odd/even texture units as it is for ATI_texture_envmap_bumpmap.
BTW, texture0 and texture1 are 2D textures here.
TIA