PDA

View Full Version : Texture properties?



CRasterImage
10-09-2007, 06:20 PM
Hi, I am somewhat new to OpenGL. Lately I have been experimenting with texturing, multi-texturing, PBuffers, framebuffers and the GLSL shader language. (in various combinations)

During these experiments, I have generated a few questions that the red book couldn't satisfy for me.

I was hoping the knowledgeable crowd here might be able to shed some light on them.

They are:

- When using glBindTexture() for the first time, for a particular texture "name" (id number), certain properties are being recorded. Things like, blending mode and whether or not the texture is scaled with linear interpolation or nearest pixel algorithms. Then, these properties are considered active when the texure is selected later, via another call to glBindTexture() with that particular texture id.

My question is: Is there a formal list of what properties are being saved/restored with the texture? OpenGL has dozens of properties and many can effect how a texture is drawn. The red book doesn't seem to specify which things will be active, when a particular texture is selected. If I need a texture to be rendered with a different property, I need to know what to override.

My follow-up question is: If I set a property to a different value, after a texture has been selected during a rendering pass, does the new value replace the recorded one? Or does the texture retain the value it recieved after creation?

Lindley
10-09-2007, 06:26 PM
Well, the basics can be found here:

http://www.khronos.org/opengles/documentation/opengles1_0/html/glTexParameter.html

However, I'd agree that a more comprehensive list including values and attributes defined in common extensions would be useful.

For one, the wrap mode GL_CLAMP_TO_BORDER_ARB (which treats the area outside the texture as zero in the default case) is too useful not to have readily documented for beginners.

CRasterImage
10-09-2007, 06:39 PM
Thanks for the reply. I think there are more properties being recorded than just the few covered in glTexParameter(). I think glBlendFunc() and a few others are being recorded as well. Unless I am mistaken.

Lindley
10-09-2007, 09:07 PM
No, the glBlendFunc is independent of which texture is bound.

Pretty sure, anyway. For any bit of state that doesn't include "tex" somewhere in the name, best to assume it's not included. You can just set it explicitly easily enough; that's a very small time penalty.

arekkusu
10-10-2007, 02:05 AM
Read the spec.

Specifically, section 3.8.11 which enumerates all texture object state.

CRasterImage
10-10-2007, 07:50 AM
Thanks arekkusu! I missed that.