differences between linux & windows

Hi

after developing my soft under linux i tested it under windows (and will test it under mac os X)

I have some differences

http://coruscant.u-strasbg.fr/screenshot/linux1.png
http://coruscant.u-strasbg.fr/screenshot/windows1.png

it looks like a color problem, but color working fine when lighting is disabled

and if you look at the edges on this picture, you see the color,
http://coruscant.u-strasbg.fr/screenshot/windows2.png

are the lighting parameters treated differently under linux and windows ?

It looks like your specular highlights have gone all wonky under linux.

I had an almost identical problem when moving from an ATI card to nVidia. It turns out that i was mistakenly setting all the attenuation factors to 0. Under the ATI drivers, everything seemed fine, but using nVidia (or mesa), the specular highlights were always huge, no matter the value of GL_SHININESS. Setting the attenuation factors to (1, 0, 0) solved the problem.
You can read the complete ripping yarn here.

thanks a lot !!

ok, i have the same under linux & windows now

but a wierd thing is, once the lights are set, i can’t change them :

i tried modifiying the lights parameters from a widget, the next method is called, but i see no effect on the scene


    public void setLight(GL gl)
    {
        System.out.println("Ambient "+lightAmbient+ " specular "+lightSpecular+" diffuse "+lightDiffuse+" materialShininess "+materialShininess);
        gl.glDisable(GL.GL_LIGHTING);
        gl.glDisable(GL.GL_LIGHT0);
        gl.glDisable(GL.GL_COLOR_MATERIAL);

        gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, new float[]{lightAmbient,lightAmbient,lightAmbient}, 0); // Setup The Ambient Light
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, new float[]{lightSpecular,lightSpecular,lightSpecular}, 0); // Setup The Specular Light
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, new float[]{lightDiffuse,lightDiffuse,lightDiffuse}, 0); // Setup The Diffuse Light
        gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);            // Position The Light
        float specularReflection[] = {1, 1, 1, 1};
        gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, specularReflection, 0);
        gl.glMateriali(GL.GL_FRONT, GL.GL_SHININESS, materialShininess);

        gl.glEnable(GL.GL_COLOR_MATERIAL);
        gl.glEnable(GL.GL_LIGHTING);
        gl.glEnable(GL.GL_LIGHT0);
        gl.glEnable(GL.GL_NORMALIZE);

    }

is it only possible the set the light parameters once ? or within a given block ?

Where is this being called from? You can only make OpenGL calls while one of your GLEventListener’s methods is active on the stack, since that’s the only time the OpenGL context is current.

yes, that’s true, and i though about that afterwards, but shouldn’t i get an “GLContext not current” exception ?

anyway I think if I delay the call to that function, so that it happens while the context is current it will work

This check shouldn’t be made in production systems, but you’re right that the DebugGL pipeline should be verifying this. Changes have just been checked in which will cause the DebugGL to do this error checking; they will show up in tonight’s nightly build.