View Full Version : glTexSubImage2D && SGIS_generate_mipmap
10-28-2002, 05:35 AM
I read that
glTexSubImage2D is 'better' than glTexImage2D. I changed it in my TextureLoader and all textures went white. Or they weren't there I guess.
Is there any tutorial on this
I also read SGIS_generate_mipmap is 'better' than gluBuild2DMipmaps. Unfortunately I could not use it at all. Is there any good tutorial that helps me to use this?
As you might guess I am still pretty new to all this OpenGL-Stuff...
Well, help would be great!
10-28-2002, 05:42 AM
I believe you can only use glTexSubImage to alter images that have already been set with glTexImage, so the two calls aren't always interchangeable. glTexSubImage is good for cases where you are dynamically changing a texture and need to re-load the image data often.
So far as SGIS_generate_mipmap, I've never used it myself so I can't help much. Are you sure that your card supports that extension, though?
10-28-2002, 05:46 AM
Thanks for the info about the TextureImage.
About the SGIS_generate_mipmap:
No, I am not sure if is supported by my card.
(I have a GeForce2)
Is this SGIS some workstation thing?
If anybody knows if SGIS_generate_mipmap is supported by 'normal' graphic-cards I would like to know how to use it.
10-28-2002, 05:48 AM
I don't remember if my GF2 supports that extension or not, and I'm not home to check. But if you want to see all the extensions your card supports, you can use glGetString(GL_EXTENSIONS).
10-28-2002, 05:54 AM
Is that what we are looking for?
10-28-2002, 07:49 AM
I'm using the "SGIS_generate_mipmap" extension for my 3D Engine, this extension is supported by my 3D card, simply test if the extension is supported then, use this params in your texture loading function :
Try this, and if it's not OK for you, I'll post more code.
10-28-2002, 09:08 AM
Some more code would be great as I get an 'undeclared identifier'-ERROR.
Thanks for the help!
[Just by the way: Are you the slug guy?
I saw your IOD on flipcode and downloaded your demo, couldn't run it, though. 'fmod.dll' or so was missing...]
[This message has been edited by B_old (edited 10-28-2002).]
10-29-2002, 08:03 AM
You error comes from that you need to include "GLExt.h" file. I hope that you've this file.
Next, here's the code (it comes from my engine, but you can use it) :
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Texture_TGA[i].width, Texture_TGA[i].height, 0, GL_RGB, GL_UNSIGNED_BYTE, Texture_TGA[i].imageData);
Yeah, I'm the Slug Guy http://www.opengl.org/discussion_boards/ubb/smile.gif I've sended a mail to you with a document on SGIS MipMapping, the MFOD.DLL and the Demo.
I hope that you'll try it for me.
10-29-2002, 08:14 AM
Don't forget to test if you 3D Card supports this extension :
My GeForce 1 256 DDR supports the extension but not my TNT2 M64
10-30-2002, 12:03 AM
Thank you very much.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.