Unwanted Funky Colors in Textures...
Hi...
I''m still working my way through the nehe tutorials and so my skills don''t extend very far past rotating cubes and quadratics...
My problem is that the textures in this game that I''m working on are for some reason displayed as distorted and generally really screwed up from what they''re supposed to be.
The texture alignment is all ok, so I think it might have something to do with the... pixel format?
Anyway I knew this explanation wouldn''t be enough so I took a snapshot comparing the actual texture to the displayed.
http://www.members.shaw.ca/nexius/myproblem.bmp
Help....please...
MSN: stupidbackup@hotmail.com (not actual e-mail)ICQ: 26469254(my site)
It looks like it is correct at the bottom and gets distorted as it goes up.
My guess is when you are loading up the texture, each row of the data does not exist on a 4-byte boundary. So each row you load is that much more off. But I haven't done texture programming for a while, so this may not be accurate, or even relevent.
[edited by - Waverider on May 9, 2002 4:10:45 AM]
My guess is when you are loading up the texture, each row of the data does not exist on a 4-byte boundary. So each row you load is that much more off. But I haven't done texture programming for a while, so this may not be accurate, or even relevent.
[edited by - Waverider on May 9, 2002 4:10:45 AM]
It's not what you're taught, it's what you learn.
It''s a BMP.
I was just using the code given in Nehe''s lesson 8.
However, I did manage to fix it, even though I still don''t understand the problem.
For some reason, when I blew up my textures to 256*256 instead of 50*12 it worked fine.
Could someone tell me why?
Using the method of loading textures described in lesson 8, do all textures have to be perfect squares or what?
Thanks
I was just using the code given in Nehe''s lesson 8.
However, I did manage to fix it, even though I still don''t understand the problem.
For some reason, when I blew up my textures to 256*256 instead of 50*12 it worked fine.
Could someone tell me why?
Using the method of loading textures described in lesson 8, do all textures have to be perfect squares or what?
Thanks
MSN: stupidbackup@hotmail.com (not actual e-mail)ICQ: 26469254(my site)
quote:
OpenGL Programming Guide
Both width and height must have the form 2m + 2b, where m is a non-negative integer (which can have a different value for width than for height) and b is the value of border. The maximum size of a texture map depends on the implementation of OpenGL, but it must be at least 64 x 64 (or 66 x 66 with borders).
In english:
You can use width or height of 2, 4, 8, 16, 32, 64. They don''t have to be the same.
Sizes larger than 64 like 128, 256, 512 will also work on most modern video cards but they are not required to support anything larger than 64.
If you have a texture border you add 2 to the size.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement