Archived

This topic is now archived and is closed to further replies.

NeHe: glTexCoord2d

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I thought glTexCoord2d() was in "decimal" (aka integer) numbers.

And no, it''s YOUR CODE that''s at fault here.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites