Jump to content
  • Advertisement
Sign in to follow this  
leonardteo

OpenGL Mac OpenGL weirdness...works on Windows

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

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
@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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!