GLSL or Cg in 3D graphics application for Mac OS X

Nibbie
Posts: 1
Joined: 2008.10
Post: #1
I'm starting the development of a 3D graphics application for Mac OS X. The application will be visualizing a range of different simulations and should support the latest graphics technologies. I'm trying to decide if GLSL or Cg will be the best choice for me. Unfortunately I have had some trouble finding good information on which to base my decision.

The application will only need to run on current macs with top of the line graphics cards. The application will need to be able to run on new macs coming out during the next five years. There are no plans on ever porting the application to other platforms.

I'm favoring Cg at the moment for the following reasons. If anything is incorrect, please correct me.
  • Very similar to HLSL which I have worked with before. This will save me the time it would take to learn GLSL. It will also allow me to easier implement advanced techniques described in various articles since most seem to use HLSL or Cg. I have a limited amount of time for this project, so this is important.
  • There seems to be a lack of tutorials, examples, and articles using GLSL.

There are two questions I haven't found an answer to.
  • How well does Cg work with ATI cards? Will I need to compile using an old profile when targeting ATI cards, and thus restricting what techniques I can use?
  • I get the feeling that GLSL lags behind somewhat in what it supports. Is there something to this at all?
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #2
I think most of us use GLSL on the Mac.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
If you want to take advantage of dynamic branching and looping, you have to use GLSL -- either by having Cg generate GLSL code (which I've heard it does not do well, but have no personal experience of) or by using GLSL directly.

The differences between Cg and GLSL are completely trivial, converting Cg shaders to GLSL manually is no problem whatsoever.

If you're Mac-only, recent hardware and OS only, I don't see any benefit to Cg.
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #4
When Cg was first released I had issues with the Mac version producing code that didn't work 100% of the time on all Macs. Part of that was the rather poor shader support OS X had at the time. The compiler wasn't all that great either. Hand-tuned ARB vertex/fragment program code was generally better. That was years ago (some 4 years, mid 10.3ish), so it's probably greatly improved since then.

That said, if you're Mac-only there's no reason not to use GLSL. Cg ain't any easier to use (not that either are difficult) and you're more likely to get tech support in the Mac community with GLSL.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLSL dilemma (in my Objective-C application) arrelid 21 7,375 Sep 8, 2006 07:02 AM
Last Post: arrelid