glTexEnv + GL_ARB_fragment_program


I have a question about how does glTexEnv and ARB-fragment programs work together. Let me be more specific:

Lets say we have 2 texture units 0, 1 and both are enabled. Now if I enable the fragment program, what is the input to the fragment program ?

  1. Is it the output fragement of the texture unit 1 goes as input to the fragment program ?


  1. Does the programmer has to implement the functionality of glTexEnv for each texture unit ?


Fragment programs replace the part of the pipeline which accesses textures and does calculations on them until the final fragment color is written.
There is even no need to enable texture units with fragment programs because they don’t use texture units, but texture image units and there are more of the latter.

We still need to bind textures to Texture Image Units. So once we enable fragment programs, any calls to glActiveTextureARB() actually refers to Texture Image Units. Is that correct ?

Also do I need to specify and enable each texture Coordinate set that I will be using inside the fragment program ?