Mac OpenGL weirdness...works on Windows

Started by
4 comments, last by leonardteo 13 years, 4 months ago
Hey guys,

I'm having a strange problem with a small game application which I've ported from Windows to Mac OS X (Snow Leopard) using GLUT.

Basically, objects that are far away and that have planes/triangles which are relatively close to each other, start to intersect. See image below.




Close up, no problem:



On Windows, the application runs fine and there aren't any intersection problems. Has anyone encountered such issues before?



On another issue, my fragment shader won't compile on OSX (again, works on Windows fine)...here are some errors:
'texture2D' : no matching overloaded function found
'=' : cannot convert from 'const float' to '4-component vector of float'
'*' : wrong operand types no operation '*' exists that takes a left-hand operand of type '3-component vector of float' and a right operand of type '4-component vector of float' (or there is no acceptable conversion)

It's a very simple Blinn shader implementation. As I mentioned, everything works fine on Windows and I don't understand why it's not compiling the shader on OSX. Any ideas?



Thanks,

Leonard
Advertisement
What is the graphics card?

Anyway, the driver is probably stricter in OSX that in Windows.
It's a Macbook Pro 17" so here's the system profiler on the graphics card:

NVIDIA GeForce GT 330M:

Chipset Model: NVIDIA GeForce GT 330M
Type: GPU
Bus: PCIe
PCIe Lane Width: x16
VRAM (Total): 512 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0a29
Revision ID: 0x00a2
ROM Revision: 3560
gMux Version: 1.9.22
Displays:
Color LCD:
Resolution: 1920 x 1200
Pixel Depth: 32-Bit Color (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Built-In: Yes
Display Connector:
Status: No Display Connected
Clearly a Z-buffer issue. Ensure the near and far clip values are no more than required, for greater accuracy. And check you are using 24bit Z. You could always use polygon offset if the above doesn't help.
I suspected it was a NVIDIA, but I wanted to confirm.

On Windows the NVIDIA OpenGL drivers are known for their relaxed behaviour when it comes to GLSL shaders.

Probably their OSX drivers are more strict.
@jezham: Thanks man. That was an easy fix. I simply increased the near plane setting and it works fine now.

@triton: I just tested as well on a Windows laptop and got the same errors. I suspect that the GeForce M series has some strictness when it comes to compiling GLSL shaders. Will look into it some more.

Thanks for the help guys.

Leo

This topic is closed to new replies.

Advertisement