system
January 21, 2003, 2:47am
1
Hi all,
I’m a bit puzzled. Where should I put the glTexParameters ?
Like this
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexSubImage2D
OR
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexSubImage2D(
Are glTexParameter global settings or do they appy to the current (binded) texture ?
U’dragon
system
January 21, 2003, 2:50am
2
And what about the glTexEnv, where should I ideally put that one ?
Bob
January 21, 2003, 2:51am
3
glTexParameter sets parameters for the currently bound texture on the active texture unit. So the first one is correct.
system
January 21, 2003, 2:52am
4
The weird thing is that I see -a lot- code on the web using the 2nd one… but indeed the first one seems to be the most logic one
Bob
January 21, 2003, 2:52am
5
Oh, another question. glTexEnvi sets parameter for the texture unit and does not care what texture is bound. glTexEnvi should go after you have activated the correct texture unit.
// Correct
glActiveTexture(GL_TEXTUREn);
glTexEnv(…)
// Wrong
glTexEnv(…)
glActiveTexture(GL_TEXTUREn);
system
January 21, 2003, 2:56am
6
Another issue :
Can I use textures binds in a display list ?
I want to be able to set a different texture on eacht face (if needed), but I want to encapsulate everything in a display list for speed reasons.
I did a first test, but sometimes the texture seems to disappear… :-/
system
January 21, 2003, 3:05am
7
Hey Bob,
Thanx for all the info.
But I can’t seem to find any info 'bout glActiveTexture in my refrence, nor on the online OpenGL reference ?
Is this an OpenGL 1.3 Thing ?
I’ve been using ttp://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_RM/
so far.
Or ist ther a newer version online ?
U
Bob
January 21, 2003, 3:12am
8
glActiveTexture is a function from OpenGL 1.2. You can download the API specification , which describes everything in OpenGL, if you want to know how something works.
system
January 21, 2003, 3:14am
9
Seems I’ve been using 1.0 refs :-/
I’ll read through the specifications.
Thanks a lot !