PDA

View Full Version : glcommands and texture units



gator
07-12-2003, 03:05 PM
Where can I find a list of all the glcommands that only affect the currently enabled
texture unit? What commands ignore this and affect all texture units?

I already know that these gl commands are specific to the texture unit:
glBindTexture( GL_TEXTURE_2D, texture_id );
glDisable( GL_TEXTURE_2D );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );


What about glEnable(GL_ALPHA_TEST) ?

dorbie
07-12-2003, 03:11 PM
Alpha test is not a texture operation, I think this is indicative of the confusion. All texture operations affect the current texture unit, unless another is explicitly provided as a parameter.

There's a big foldout diagram at the back of the blue book that describes the stages in the OpenGL pipeline, it shoudl help you with this sort of thing. It's probably online somewhere.

Usually the question people ask is which texture state is stored in the texture object and restored with a bind call, but that's a different question ;-)

gator
07-12-2003, 05:28 PM
Thanks, I understand a little better now. I found the blue book, but it looks like
someone hacked it up into a bunch of HTML pages. No diagram found.

zeckensack
07-12-2003, 05:38 PM
No worries. The fixed function fragment pipe goes something like this:

Input: parameters from triangle interpolator
->(Multi)texturing
->Color sum
->fog
->alpha test
->depth and stencil
->blending or logic op

The result will then be written to the framebuffer if it passed alpha, depth and stencil tests.