Sign in to follow this  
domstyledesign

Incorrect texture colors

Recommended Posts

i know this, it's not the problem.

i don't think(*) it's a problem with my loading class. i made a bmp with an all red circle, an all blue circle, and an all green circle on a black background. the circles load and show up fine.

however, when i try something like this

i get wierd results, as you can see.

this is not a problem with width and height either, other textures load fine, and what's shown here is just a snippet of the full texture. the rest of the image was just reference lines (so i could make sure it wasn't a problem with width/height)

any suggestions?

[Edited by - domstyledesign on August 5, 2004 2:41:29 AM]

Share this post


Link to post
Share on other sites
your program renders 2xbigger color values than stored in your file, then these values are cut off (probably by the type range) you can see that effect here

it is one of color channels taken from your pic

//i have to learn english - i know :/

Share this post


Link to post
Share on other sites
Do you get the correct result if you - before calling glTexImage2d - just divide all the color values by 2?

What's your hardware?
Can you post the rendering and texture setup code?

Share this post


Link to post
Share on other sites
Quote:
Original post by domstyledesign
well yeah, the problem is solved (divide each component by 2), but i don't understand why the problem arises. happybara explained but i don't completely understand...


go through your loader code, check the actual value of a pixel and then check the value you are storing.

Share this post


Link to post
Share on other sites
well i had the loader write the values of each component of each pixel to a terminal window after reading happybara's post. each number printed ranged from 0 to 255, as it should. since every value is now divided by 2, the range is obviously 0 to 127. unless these values can be of higher precision than an INT, my openGL app isn't running @ 24bit color.


...right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this