• Advertisement

Archived

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

trouble texture mapping bitmaps

This topic is 5751 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

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.

Share this post


Link to post
Share on other sites
Advertisement
Are the pictures perfectly square (like 128x128)? Digital cameras do not produce perfectly square pictures.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement