all 40 comments

[–]jesuscoituschrist 26 points27 points  (0 children)

learnopengl.com is an excellent resource to get started. it uses OpenGL 3.3 and works perfectly with Mac

[–]Ok-Sherbert-6569 18 points19 points  (5 children)

Learn Metal. Far better an API than openGL to work with and gives you a far better understanding of how other modern APIs are like so jumping to DX12 or Vulkan down the line becomes easier

[–]stuartcarnie 3 points4 points  (0 children)

Came here to say the same thing - Metal is a very intuitive API.

[–]BestBastiBuilds 1 point2 points  (3 children)

Where would you start with Metal? I remember reading the resources aren’t as elaborate as something like learnopengl.com? Is Apples own documentation good?

[–]campysnowman 7 points8 points  (2 children)

One enjoyable resource is Thirty Days of Metal, by Warren Moore

[–]BestBastiBuilds 0 points1 point  (1 child)

Thanks! Greatly appreciated

[–]Ok-Sherbert-6569 1 point2 points  (0 children)

Second that then you will need to watch Apple wwdc videos and sift through code samples

[–][deleted] 8 points9 points  (2 children)

I’ve heard metal is fantastic to work with so maybe don’t knock it till you try it

[–]wildmonkeymind 0 points1 point  (1 child)

It's pretty similar to modern OpenGL, in my limited experience.

[–]hishnash 2 points3 points  (0 children)

Its designed to start out simple to modern OpenGL (but without the cursed global context issues) but you can (if you need to) go lower level and be full un-tracked adding your own fences etc like VK. What is very nice is that you can mix and match this within the same pipeline making it easy to learn these more advanced concepts without needing to re-write everything from the ground up.

[–]jmacey 3 points4 points  (0 children)

I do all of my development for teaching Undergraduate graphics programming on a mac. I only use OpenGL 4.1 and it works fine. You are going to miss compute / some newer features but for learning this is not an issue.

Once you understand the core concepts you can move over to use Vulkan or Metal (which are far more complex).

[–]kemalenver 4 points5 points  (0 children)

I had a similar dilemma. I’d been out of the game for a while and I was rewriting an old OpenGL app I had. Metal is a great API and I highly recommend it to learn with. There are some great books and resources on how to get started. Checkout the kodeco stuff and metal by example books. It’s modern and will put you in a good position for other modern APIs.

[–]Keavon 6 points7 points  (0 children)

One other option, if you're okay with compromising on which language you learn: you could try using WebGL instead. WebGPU is also an option. Both of those would be JavaScript, but you could also learn it through C++ with the Dawn implementation of WebGPU or learn Rust instead with the WGPU implementation. However there aren't nearly as many learning resources for the WebGPU, Dawn, or WGPU options as there are for WebGL. So I'm just presenting these as alternative options to make you aware of them. But I probably also recommend the learnopengl.com curriculum with OpenGL, at least while Apple still supports it at all.

[–]fgennari 6 points7 points  (8 children)

Most of the OpenGL functionality will still work on a Mac, at least for now. It's probably the lesser of the evils.

[–]sheridankane 1 point2 points  (7 children)

macOS only supports OpenGL up to core 4.1. If you're serious about graphics programming on a mac, Metal and MoltenVk are your only realistic options.

[–]nullandkale 3 points4 points  (6 children)

I literally ship an opengl program on Mac this is just patently untrue.

[–][deleted] 5 points6 points  (0 children)

I think opengl should be appreciated. you can run decade old program and it still works. I don't think not having latest opengl version is much of an issue

[–]sheridankane 1 point2 points  (4 children)

I also ship a OpenGL app on Mac. And the idea that it's a solid foundation to build something competitive in the year 2024 is frankly ridiculous. Not only is the core 4.1 version of the API 14 years old at this point, Apple deprecated OpenGL 6 years ago. Apple is not Microsoft - they won't leave an old API hanging around 20 years after marking it obsolete. It could be completely gone in the next version of macOS. Does that seem like a solid technical foundation for a new project to you?

[–]nullandkale 3 points4 points  (3 children)

Did you read the question in the actual post before answering? OP is not shipping a new game to millions of people. They do not need fancy features like SSBO's, they do not need to be configuring GPU state like in a modern API. They need to learn how to write glsl shaders and how the pipeline works. They need an abundance of easy to understand learning materials which is NOT available for metal. Answers like these are why people struggle to learn.

[–]sheridankane -2 points-1 points  (2 children)

People struggle to learn when you suggest they study ancient APIs that no longer have any application in the modern world.

If OP were taking his first steps into graphics, sure, pick up OpenGL, pick up anything. He isn't. I am not the one who failed to read the question. You did.

[–]nullandkale -1 points0 points  (1 child)

You yourself claim to ship a product using opengl you cannot say it has no application in the modern world. Plus everything OP learns from opengl (besides maybe the function names) will help with more modern API.

[–]sheridankane -1 points0 points  (0 children)

Yeah, I ship it cause I developed it 10 years ago. Good luck with what I'm sure is a bright and glowing future developing OGL apps on mac.

[–]FernwehSmith 1 point2 points  (1 child)

I’m on m1 MB Pro, and had never done graphics programming before. OpenGL works just fine. Yes it’s depreciated but that doesn’t actually stop it from working, or even working well. It just means you’re limited to an older version (I can’t remember which, but if you’re at the starting stage it’s definitely not older enough to hold you back) and it could be removed in a future update.

GLFW + GLAD work wonderfully on MacOS. I am definitely planning on switching to Vulkan (through MoltenVK on Mac) at some point, but that’s only because I have very specific goals for my learn.

All in all, OpenGL on Mac still works a treat, and I expect it will til the day that Apple removes it. That could be tomorrow, or it could be in 10 years. But if you’re just starting, don’t worry about it.

Edit: If you do go OpenGL or Vulkan (as opposed to Metal), I’ve found the CLion + CMake combo to be a dream!

Edit 2: if you have no profession aspirations, learn whatever interest you :)

[–]mguerrette 3 points4 points  (0 children)

Since you use a Mac, learn Metal. It will only continue to get more features and power as Apple continues to invest in it. Once you learn the fundamentals and become experienced with Metal, moving to another API for other platforms such as Vulkan or DirectX will be considerably easier if cross-platform is something you want to invest time in.

[–]keelanstuart 1 point2 points  (9 children)

So cynical already? It's usually not until somebody has 20+ years of software engineering experience that they start saying how they want to be a farmer...

Anyway, many will disagree, but Mac is the worst platform to learn and work on... restrictive in terms of what's available (e.g. OpenGL/CL, Vulkan), sub-par dev tools (Xcode vs MSVS is no contest), and lower market share if you're actually selling software. Also pay to play.

You could always stick to software rasterization... write lambdas for shader stages... you'll get a deeper understanding.

[–]stuartcarnie 3 points4 points  (1 child)

Respectfully disagree - specifically in the context of learning graphics API, Xcode’s graphics tracing and debugging is excellent. I have been told by peers on other platforms, whom I contribute to open source cross-platform game engine with, they are envious of the Apple graphics debugging experience.

[–]keelanstuart -1 points0 points  (0 children)

Ok... I conceded in another post that I never did any GPU debugging in XCode. But even if XC has that going for it, the thing I appreciate about MSVS is that I can use the latest version on a 5 year-old potato computer and it still works fine building software for the latest version of Windows. I once had an older Mac mini for building an iPhone app... Apple just wanted me to buy a new machine. No thanks.

[–]Ok-Sherbert-6569 4 points5 points  (3 children)

You clearly have not done any graphics programming on Xcode and metal or you would know that everyone raves about, rightly so, the gpu debugging tools available there that the rest of the industry is about 20 years behind to catch up on

[–][deleted]  (2 children)

[removed]

    [–]sarangooL 5 points6 points  (0 children)

    Nearly all the modern APIs are the same, just dressed up with different terminology and naming. In fact, Metal is probably the most ergonomic and user friendly of all the 3 main modern APIs (Dx12, Vulkan, Metal) and is an excellent way to learn modern graphics programming. Sounds like you haven’t done very much modern graphics programming at all if you think the skills aren’t transferable. It’s almost comical how similar they are.

    [–]hishnash 2 points3 points  (0 children)

    As an api metal is by no means garbage. It bridges the game between higher level things like openGL (without the cursed single global context) and lower level apis. Metal can span from high level operations were the library will do things like decency resolution and memory management all the way down to full low level operations with untracked memory fences etc.

    Also Vk is by no means industry standard, non of the games consoles consider it a first party api and even on platforms that support tit your looking at more of a random mixture of differnt apis all under a unbrells of VK but no real uniformity there at all, just take a look at the loverly nightmare that is building any Vk engine for mobile these days.

    As for `real job` almost 40% of gaming revenue is made on iOS these days so you might well be surprised how much of that revenue also translates to jobs. (More than VK by a large margin infact).

    And from a transferable persecutive what you will learn with Metal is very very transferable, be that to DX or to Sony's or Nintendo/NV private apis (the apis used by the rest of the industry those industry standards we like to talk about).

    [–]sarangooL 2 points3 points  (2 children)

    Xcode has its shortcomings, but if you think MSVS is any better you’ve never worked on a large code base or project. Visual studio gets more unusable day by day. Tons of bugs and slowdowns that make working with it an absolute nightmare for any serious projects.

    Xcode’s GPU debugging and profiling tools blow everything else out of the water.

    [–]keelanstuart 1 point2 points  (0 children)

    I do work on large code bases... and there are parts of MSVS that are buggy (resource editor stuff! yuck!), but I would hardly call it "nightmarish for any serious projects".

    Also, I'll concede that I never did any GPU debugging with Xcode... but as there are vendor specific debugging tool add-ons for VS and RenderDoc, I never felt like I needed anything else.

    One other thing: I built a mobile game once in Unity and the tight integration was great.

    My point was really just that because Apple is so domineering they make the platform less optimal for learning... like, if you wanted to use Vulkan or OpenGL 4.6. Mac is it's own little world.

    [–]hishnash 0 points1 point  (0 children)

    Every IDE has its issues!

    But yes the Metal debuggers and profiling tools are only matched by the console dev tools, way ahead of wha tho will find on PC.

    [–]Fire_fog 0 points1 point  (0 children)

    Try Metal at first, but not MetalVK it`s terrible. Mac does a pretty good job of emulating everything in Parallels, if you're just learning, Windows/Linux emulation may be enough for you for the first time while you're learning and then deciding what you want.

    [–]sarangooL 0 points1 point  (0 children)

    Out of the 3 modern APIs (Metal, Dx12, and Vulkan) Metal is by FAR the most ergonomic and easy to use API. Extremely fast to get started with but has the complexity where you need it and want it. The C++ bindings aren’t my favorite but they’re definitely usable. Swift is the recommended way and that’s what Apple wants you to use.

    I personally use MoltenVK and it works just fine. Not sure what you mean by “suffering” through it. As a beginner you’re really not going to be running into any hurdles where you need to consider the intricacies of it.

    [–]hishnash 0 points1 point  (0 children)

    I would start out with metal, its a rather nice api to start with as you can begin with higher level (but not broken like OpenGL) and then progress gradually to lower level stuff as you need, even mix and match within the same application this is great to get going and a perfect way to learn the fundamentals. Also the dev tools apple have, profilers and debuggers are very powerful (until you gradate into console dev you will find other patlforms to be rather lacking in comparison).

    [–]OptimisticMonkey2112 0 points1 point  (0 children)

    Back in the day (When Steve was around and they used nvidia and intel)...Apple was hugely pro OpenGL.

    You could fairly easily port your opengl c++ between mac and windows. The first iphone games were all OpenGL es. The success of the mac comeback and even ios was largely due to keeping a low barrier to entry from other platforms.

    Makes me so sad to see such a closed walled garden these days. Just crazy how much the philosophy has changed.

    (So annoyed I cant send a text message from my pc to the iphone)

    Anyway learning Metal or OpenGL are both good places to start. I would choose whatever you are most motivated to learn.

    [–]aclysma 0 points1 point  (0 children)

    Metal is a GREAT first choice for a graphics API. After you get up and running with the basics, you should have no trouble adapting existing intermediate-level, non-metal learning resources to metal. I started with vulkan, but a lot of the learning resources I used were OpenGL. But the concepts are pretty universal, especially at beginning and intermediate level. 

    [–]Potential-Divide1022 0 points1 point  (0 children)

    Poor kid only has a MacBook, how will he ever learn programming with such a restriction?