NeHe: glTexCoord2d

Started by
5 comments, last by vincoof 21 years, 6 months ago
NeHe sent in the following question : Does anyone know what's up with glTexCoord2d? Seems it should be supported on all cards, but the majority of low end cards I tested displayed nothing but crap, even with updated drivers. [edited by - vincoof on September 25, 2002 4:10:18 AM]
Advertisement
I know this doesn''t answer your question, but why would you/NeHe want to use the double version of glTexCoord? It seems like a waste of valuable processing time as most of the operations you do don''t require any more precision than floating point has to offer. Will test glTexCoord2d later on my gpu back home and try to further understand the problem.

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
I thought glTexCoord2d() was in "decimal" (aka integer) numbers.

And no, it''s YOUR CODE that''s at fault here.
Crispy: just as you''ve written, "most of the operations you do don''t require any more precision than floating point has to offer", which means than *sometimes* we may need more precision.

And it''s not a waste of time on some architecture, because if coordinates are treated as doubles in graphics processor, then it''s slower to send floats because the time required to convert the float into double is longer than the time required to send the double into the pipeline.
From the MSDN :

quote:
void glTexCoord2d(
GLdouble s,
GLdouble t
);

void glTexCoord2f(
GLfloat s,
GLfloat t
);

void glTexCoord2i(
GLint s,
GLint t
);

void glTexCoord2s(
GLshort s,
GLshort t
);


So, anonymous poster was wrong.

Back to your problem : perhaps that vendors haven't implemented it because it's pretty useless (at least for most applications). Even if you use a huge texture, you're able to access one precise texel with floats.

Edit (just saw your reply) : even if it can be usefull, some programmers are just lazy bastards and don't care for the standard, thus providing incomplete drivers. I've experienced quite the same problem as you in the past (not with glTexCoord though) and it was a pain in the ass.

[edited by - Prosper/LOADED on September 25, 2002 9:06:01 AM]
I mailed NeHe and he replied that he had problems with "Older TNT, older NON detonator driver, most ATI cards (older), etc."

I'm assuming that's a nothing more than a driver issue. Not alot we can do, except reporting the bug to concerned companies...

[edited by - vincoof on September 30, 2002 3:12:03 AM]
The problem occurs with 2i as well... the reason to use it is to make mapping specific parts of a texture easier, and the code nice to look at... would you rather see...

glTexCoord2f(0.0f, 0.12109375f) or
glTexCoord2i(0, 31)

Not a big deal, just a bug or driver issue I noticed on some cards.

This topic is closed to new replies.

Advertisement