Advertisement

trouble texture mapping bitmaps

Started by April 20, 2002 04:58 PM
7 comments, last by pliant 22 years, 10 months ago
i am having a lot of trouble texture mapping some bitmap files. when i started my project, i was given a few images, which mapped just fine. (so i do know that my file loading, texture creating, and tex coordinates are all correct) however, after i took some more images with a digital camera, i made them into bitmaps using gimp, and they acted very strangely. they are either extremely contorted, as though i just stuck in random texture coordinates, or they cause a memory error. (??) i had someone try converting them in photoshop, with the same results. i even tried cutting and pasting them into winpaint, and saving them as bitmaps that way. (although if i actually create a file using winpaint, i''m able to use it as a texture.) the older files, large, small, square, and not, still work beautifully. i am working (unfortunatly) in MS Visual C++ on a WinNT machine. if anyone can help me, i would be +extremely+ grateful, since i am working under a deadline, and i need to finish this project to graduate.
Are the pictures perfectly square (like 128x128)? Digital cameras do not produce perfectly square pictures.
Advertisement
The first reason I can think of is the width and height of the texture not being 2 raised to the power of some integer value (generating ...16, 32, 64, 128, 256...). Don''t know if this would produce the errors you explain though.

The second reason would be some strange error in your code. Try using your bitmaps together with the code in NeHe tutorial 6 to see if the same problems appear there.
no, the pictures are not perfectly square, but neither are the older bitmaps that work just fine. you can process
non-square images using mipmaped textures.
i tried using one of the bitmaps with the NeHe tutorial 10
code. (that one has a mipmap texture) it still didn''t
work. one of the old bitmaps, however, which is rectangular,
and doesn''t have sides that are powers of two, works just fine.
if you''re using a custom bitmap loading
routine you could possibly be limited by its
bitdepth.
try opening one of the images that worked (in
photo shop or psp or something), and check out
the bit depth. make sure your photo''s bitdepth
is the same.


-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

-eldee;another space monkey;[ Forced Evolution Studios ]
Advertisement
they are all 24-bits
Are you sure? A lot of programs (like Paint shop pro) say a 32-bit image is 24 bits. The alpha channel is something completely different to them and is not counted in the bits. Better make sure all (or none) of your images have an alpha channel.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

none of the files have alpha channels.

however, i have found an interesting fix. if i make at least
side (either the width or the height) a power of 2, then it
works. except for one image, which is 540x393 and just started
working randomly. so i must be doing something strange in my
loading procedure, although i still have no idea what.

This topic is closed to new replies.

Advertisement