I'm building a school project with OpenGl using glut, and I work both on my notebook (when not in home) and on my desktop. Both were fine, but all of a sudden, when I compile the code on my desktop, everything is white, while THE SAME CODE, runs fine on my notebook! I need it working on my desktop, as it is much easier to work in it when I'm at my home.
Screenshots:
Notebook: http://imageshack.us/a/img580/9522/f9yx.jpg
Desktop: http://imageshack.us/a/img821/8189/r51l.jpg
Code: pastebin(dot)com/keVyt55q
Well, here's the problem:
GLfloat especularidade[COORDHOMO] = {10.0, 10.0, 10.0, 1.0};//<------here
GLint especMaterial = 6000;
glMaterialfv(GL_FRONT, GL_SPECULAR, especularidade);
/* Define a concentração do brilho sobre os objetos */
glMateriali(GL_FRONT, GL_SHININESS, especMaterial);
specular color is the same as every other color. Every component is supposed to be within 0.0..1.0
range if you use floats. Also it is possible that shininess is also too high, it is supposed to be within 0..128.0
range, and I'd definitely use float there glMaterialf(GL_FRONT, GL_SHININESS, 25.0)
or something.
Either your notebook or your desktop computer has non-compliant OpenGL driver. Fixed-function OPenGL is supposed to clamp results of lighting calculations to 0.0..1.0 range (which is the reason why fixed-function textured opengl scene might appear dim). Your desktop computer doesn't do that. Hence the bright white scene.
P.S. It is also strongly recommended to use english names for functions and variables. Well, at least if you want to get help with your code later.