texture coordinates
Using the glTexture2D commands over and over again with different bitmaps slows programs down loads. Games such as Tomb Raider put all there textures (32x32 each I think) on a single large bitmap texture whose sides are powers of 2. Then I presume they use texture co-ordinates such as:
TexCoord2f(0,0.25);glVertex....
TexCoord2f(0.25,0.25);glVertex....
TexCoord2f(0.25,0);glVertex....
TexCoord2f(0,0);glVertex....
How come it doesn''t work when I try to do it in integer mode? Come to think of it I can''t do colours in integer mode either.
You can''t use the integer form of the glTexCoord command to specify a subsection of the texture because a value of 1 is the same as 1.0f under the floating point form.
You can do colour in integer mode, just give the required fraction of the maximum value of the type (i.e. for signed integer a value of 1073741824 is the same as a floating point value of 0.5f (1073741824/2147483647 = 0.5).
Enigma
You can do colour in integer mode, just give the required fraction of the maximum value of the type (i.e. for signed integer a value of 1073741824 is the same as a floating point value of 0.5f (1073741824/2147483647 = 0.5).
Enigma
It does not work in "integer form" because in integer, there is no fractional part. That is, 0.25 is rounded to 0. So, calling :
glTexCoord2i(0, 0.25);
is just the same as calling :
glTexCoord2i(0, 0);
Enigma: I think you''re wrong about texture coordinates. The conversion you''re talking about takes effect with the glColor commands but not with the glTexCoord ones.
glTexCoord2i(0, 0.25);
is just the same as calling :
glTexCoord2i(0, 0);
Enigma: I think you''re wrong about texture coordinates. The conversion you''re talking about takes effect with the glColor commands but not with the glTexCoord ones.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement