Jump to content
  • Advertisement
Sign in to follow this  
ajm113

OpenGL Where did all the brightness go?

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

This is really wired, my game shows clearly on my wide screen monitor at my other house, but for some reason on my small screen monitor my game looks really dark and I haven't made any changes to the game when transference to the computer with the small monitor. Is there anything I can do to insure my game will have the correct brightness level on all PCs? Free Image Hosting at www.ImageShack.us I tried games like Doom3 and see if it had the same issue, but it doesn't look like it. The only thing can popped out of my head is the glColor3f, but I don't think so. VS2008, C++, Win32, OpenGL, Windows Vista. [Edited by - ajm113 on December 28, 2008 3:54:52 PM]

Share this post


Link to post
Share on other sites
Advertisement
I would suggest additional logging and ensure that you check every return value for errors. Just looking at the picture, it looks like you've got very low ambient light but no other lighting being applied - concentrate on your lighting stuff first...

Share this post


Link to post
Share on other sites
There is no lights in the scene, it all should be clear to look at with lights or none. GL_LIGHTS isn't even enabled. I looked at SetDeviceGammaRamp, but idk how to use it or know it would work.

Share this post


Link to post
Share on other sites
Can you create a simpler program to limit the sources of the problem first? Just draw a white triangle and see whether that's dark already. Maybe your graphics card on the other computer is unable to do a certain effect (shader model)?

Share this post


Link to post
Share on other sites
Quote:
Original post by ajm113
There is no lights in the scene, it all should be clear to look at with lights or none. GL_LIGHTS isn't even enabled. I looked at SetDeviceGammaRamp, but idk how to use it or know it would work.
Try explicitly disabling GL_LIGHTING - not all drivers set the OpenGL defaults to the same values.

Share this post


Link to post
Share on other sites
Well there is no shaders running and it is all pretty basic OpenGL rendering, I can post some code if it helps a little, I did run a simple first person game I created and it works fine.

I'll post some GL code if it helps:

InitOpenGL

if (Devmode)
{
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);

}
else
{
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
}



// SetDeviceGammaRamp(hDC, 100);
LoadGLTextures();
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Enable Alpha Blending (disable alpha testing)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();






Render

glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glNormal3f(1.0f,1.0f,1.0f);
glColor3f(1,1,1);

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
//Render Model + Transforms etc.

glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);

//Render another model + transforms etc.
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);

//Set Orthro and show HUD.





@swiftcoder - I tried it and the same results, even cleaned up some GL code so it doesn't call a function twice. (I.E glColor3f and glNormal).

I have OpenGL driver 3.0 installed and I disabled all of my OpenGL code, so it just renders a sphere with no texture on it, but it just appears gray with the glColor set to show white.

[Edited by - ajm113 on December 28, 2008 9:14:42 PM]

Share this post


Link to post
Share on other sites
This is really bugging me, it has to be something with Win32 or Windows, but no matter what I change it seems like the brightness isn't effected in my game. I think I mite have tried everything in the book.. :(

Share this post


Link to post
Share on other sites
For some reason

glClearColor(0.0f, 0.0f, 0.0f, 0.5f);

jumps out at me.

Have you tried:

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

?

Alternatively, try using glColor4f instead of glColor3f..

Share this post


Link to post
Share on other sites
check out your pixel format descriptor.
clearly its a (opengl) support issue thats different between the pc's. Step through all basic opengl setup steps, WITH appropriate feedback/error catching. As said, get rid of all shaders and/or extensions to start with.
Seeing that other games seem to work, this should also.

This all assuming that video drivers/directx/whatever is correctly installed and running on both pc's.

If everything seems fine, it could be a default ambiguzation. Make sure ALL variables/values are defined properly. for example, enabling blending, but not setting the values correctly will result in undefined blending results, differing per machine.


edit: reread the gllight setup calls from the msdn reference, if you're suspecting this to be gllight specific.

Share this post


Link to post
Share on other sites
@ Zorm, Yeah I had the same thoughts, I tried that too, but I still get the same results. I even changed the clear Color blue and it's still dim.

@Kincaid like I said, there are no shaders/lights, I did check my pixel format descriptor and it looks fine to me, I even read if it was maybe if I had to do some changes to the flags so it works better with Vista, but no effect.

I even commented out all OpenGL code except for the sphere and glColor like I said and it's still not working. I even tested my game on my laptop and it works perfectly. I am thinking of taking this to nivida now if it's a support issue.


PIXELFORMATDESCRIPTOR pfd;
memset( &pfd, NULL, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_SUPPORT_COMPOSITION | PFD_SUPPORT_GDI;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = (m_b32Bit ? 32 : 16 );
pfd.cDepthBits = 32;
pfd.iLayerType = PFD_MAIN_PLANE ;

int iPixelFormat = ChoosePixelFormat( hDC, &pfd );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!