Difference in OSX vs WIN ofLights and ofMaterials

Hi All

I have an app that I’m running both in Mac and windows forms. It uses a really simple light and materials set up. There’s quite a marked interference pattern in the way it renders it on the windows machine.

Does anyone have any tips for resolving this? Looks pretty ugly compared to the Mac views. The first two images below are PC, the next two OSX >>

that looks like some uninitialized data, it’s probably due to some difference in the graphics card rather than an osx vs windows thing

hmmm… I’ve noticed that when I’m rotating the camera (click drag pan) it vanishes, but comes back when I stop. It is also worse when I draw to an Fbo, rather than direct to the screen…

any thoughts on how to go about fixing it?

S

do you see something similar in the 3d primitives example? and what card are you using on windows and osx?

Yes I tested the primitives example, that worked fine. My devices are Nvidia on PC, Radeon on Mac. However, I have found the issue, mainly by commenting out everything one line at a time…

I was using the line pointLight.setPosition(cam.getPosition()); and it appears that this is setting off the interference pattern

Replaced it with the below, which is clean, no interference, so maybe it is caused in some graphics cards when the camera and light position are co-incident?

       glm::vec3 camP = cam.getPosition();
        glm::vec3 litP = pointLight.getPosition();
        if(glm::distance(camP, litP)>10){
            camP += 1;
            pointLight.setPosition(camP);
        }