Sign in to follow this  
dreallink

Dark Texture Problem

Recommended Posts

I'm making a game for class and I'm starting with the terrain map, and using a .raw file for the texture. The problem is that I was somehow able to have the texture load the correct texture color (the .raw file) that I have when I had the program coded wrong for the camera function, however, once I added the camera correctly, the texture file is dark when the program runs. This is a link to texture in jpg format:
http://img.photobucket.com/albums/v280/picshooter04/grass.jpg
I'm wondering how to fix this? Do, I need to rearrange the order of some of my functions and/or call something else so that it displays the correct color of the texture (.raw file)? Also, how do I avoid this happening, like if it is a function arrangment problem, how do I know what I should/should not have before another function? [Edited by - dreallink on June 5, 2007 4:38:30 PM]

Share this post


Link to post
Share on other sites
EDIT: I figured out what the problem was, but there is still a problem.
If I have the following code in the main section, the texture comes out how it is suppose to.
glutInitDisplayMode (GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGB);
glutInitWindowSize (800, 600);
glutInitWindowPosition (50, 50);
glutCreateWindow ("A basic OpenGL Window");


However, I need to use the init(); call and therefore I do not need the above section of code, but taking out the above section gives me the dark texture problem. If I leave in the above code with the init(); call, I get the following error:
GLUT: The following is a new check for GLUT 3.0; update your code.
GLUT: redisplay needed for window 1, but no display callback.

From what I understand, I don't need the function calls that I took out, but if I take them out my texture displays incorrectly.

Correct Texture:
http://img.photobucket.com/albums/v280/picshooter04/colorTerrain.jpg

Incorrect Texture:
http://img.photobucket.com/albums/v280/picshooter04/darkTerrain.jpg


Anyone have any ideas how to fix this?? I do not know how to resolve this, so any help would be appreciated. Thanks in advance.

Share this post


Link to post
Share on other sites
There are a lot of possible sources of this problem. I don't think anyone is going to be able to help you without seeing your source code (the relevant parts, that is).

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