9 comments

  • jezze 42 minutes ago
    I just want to be a bit picky and say that bike shedding means focusing on trivial matters while ignoring or being oblivious to the complicated parts. What he described sounded more like a combination of feature creep/over-engineering.
  • tombert 10 hours ago
    My opinions of Vulkan have not changed significantly since this was posted a year ago https://news.ycombinator.com/item?id=40601605

    I'm sure Vulkan is fun and wonderful for people who really want low level control of the graphic stack, but I found it completely miserable to use. I still haven't really found a graphics API that works at the level I want that I enjoyed using; I would like to get more into graphics programming since I do think it would be fun to build a game engine, but I will admit that even getting started with the low level Vulkan stuff is still scary to me.

    I think what I want is something like how SDL does 2D graphics, but for 3D. My understanding is that for 3D in SDL you just drop into OpenGL or something, which isn't quite what I want.

    Maybe WebGPU would be something I could have fun working on.

    • thegrim33 9 hours ago
      SDL 3.0 introduced their GPU API a year or so ago, which is an abstraction layer on top of vulkan/others, might want to check it out.

      Although after writing an entire engine with it, I ended up wanting more control, more perf, and to not be limited by the lowest common denominator limits of the various backends, and just ended up switching back to a Vulkan-based engine.

      However, I took a lot of learnings from the SDL GPU code, such as their approach to synchronization, which was a pattern that solved a lot of problems for me in my Vulkan engine, and made things a lot easier/nicer to work with.

      • ryandrake 7 hours ago
        I'm working with SDL GPU now, and while it's nice, it hasn't quite cracked the cross platform nut yet. You still need to maintain and load platform-specific shaders for each incompatible ecosystem, or you need a set of "source of truth" HLSL shaders that your build system processes into platform-specific shaders, through a set of disparate tools that you have to download from all over the place, that really should be one tool. I have high hopes for SDL_shadercross to one day become that tool.
      • HexDecOctBin 6 hours ago
        SDL GPU is extremely disappointing in that it follows the Vulkan 1.0 model of static pipelines and rigid workflows. Using Vulkan 1.3 with a few extensions is actually far more ergonomic beyond a basic "Hello, World" than using SDL GPU.
      • on_the_train 2 hours ago
        But sdl is super high level. If you want to do more than pong, you'll hit a wall very quickly.

        I just want OpenGL, it was the perfect level of abstraction. I still use it today, both at work and for personal projects.

        • 59nadir 1 hour ago
          For what it's worth my experience with Metal was that it was the closest any of the more modern APIs got to OpenGL. It's just stuck on an irrelevant OS. If they made sure you could use it on Windows & Linux I think it'd fill a pretty cool niche.
          • whstl 30 minutes ago
            Same experience. I worked on porting engine code from OpenGL way back when and Metal was the easiest one of the bunch in the API while still retaining the advanced features. I wish Vulkan and DX12 had just copied it, although they don't really bother me.
          • dontlaugh 1 hour ago
            WebGPU is in many ways closer to Metal than to Vulkan. You can use the API outside of the browser too, especially in Rust.
            • 59nadir 1 hour ago
              I'll check out WebGPU at some point, I guess. I've written our rendering layer in all of the major APIs (OpenGL, DX12, Vulkan and Metal) and found it very instructive to have all of them to compare at the same time because it really underscored the differences; especially maintaining all of them at the same time. We eventually decided to focus only on DX12, but I think I'll revive this "everything all at once" thing for some side projects.
        • beeflet 2 hours ago
          I like OpenGL ES but the support for compute shaders sucks. I hate transform feedbacks. I am in the process of trying out WebGPU now, but it doesn't have good native support everywhere like OpenGL ES 3 does.
    • simonask 9 hours ago
      `wgpu` in Rust is an excellent middle ground, matching the abstraction level of WebGPU. More capable than OpenGL, but you don’t have to deal with things like resource barriers and layout transitions.

      The reason you don’t is that it does an amount of bookkeeping for you at runtime, only supports using a single, general queue per device, and several other limitations that only matter when you want to max out the capabilities of the hardware.

      Vulkan is miserable, but several things are improved by using a few extensions supported by almost all relevant vendors. The misery mostly pays off, but there are a couple of cases where the API asks you for a lot of detail which all major drivers then happily go ahead ignore completely.

      • raincole 4 hours ago
        How easy is it to integrate wgpu if the rest of your game is developed with a language that isn't rust? (e.g. C# or C++)
      • tombert 8 hours ago
        I'll definitely give wgpu a look. I don't need to make something that competes with Unreal 5 or anything, but I do think it would be neat to have my own engine.
      • foltik 6 hours ago
        Could you say more about which extensions you’re referring to? I’ve often heard this take, but found details vague and practical comparisons hard to find.
        • attheicearcade 5 hours ago
          Not the same commenter, but I’d guess: enabling some features for bindless textures and also vk 1.3 dynamic rendering to skip renderpass and framebuffer juggling
    • ryandrake 7 hours ago
      As someone who did OpenGL programming for a very, very long time, I fully agree with you. Without OpenGL being maintained, we are missing a critical “middle” drawing API. We have the very high level game engines, and very low level things like Vulkan and Metal which are basically thin abstractions on top of GPU hardware. But we are missing that fun “draw a triangle” middle API that lets you pick up and learn 3D Graphics (as opposed to the very different “learn GPU programming” goal).

      If I was a beginner looking to get a basic understanding of graphics and wanted to play around, I shouldn’t have to know or care what a “shader” is or what a vertex buffer and index buffer are and why you’d use them. These low level concepts are just unnecessary “learning cliffs” that are only useful to existing experts in the field.

      Maybe unpopular opinion: only a relative handful of developers working on actually making game engines need the detailed control Vulkan gives you. They are willing to put up with the minutiae and boilerplate needed to work at that low level because they need it. Everyone else would be better off with OpenGL.

      • 59nadir 1 hour ago
        OpenGL still exists, runs and works fine on the two platforms that matter. I think its death has been overstated quite a bit.

        With that said we decided to focus on DX12 eventually because it just made sense. I've written our platform layers targetting OpenGL, DX12, Vulkan and Metal and once you've just internalized all of these I really don't think the horribleness of the lower level APIs is as bad as people make them out to be. They're very debuggable, very clear and well supported.

      • phendrenad2 7 hours ago
        OpenGL is still being maintained, it just isn't being updated. Since OpenGL 4.0 or something we've had vertex and pixel shaders. As a non-AAA developer, I can't imagine anything else I'd really need.

        BTW: If anyone says OpenGL is "deprecated", laugh in their face.

        • ryandrake 7 hours ago
          OK, maybe OpenGL is not "unmaintained" but the major OS and hardware vendors have certainly handed him his hat.
      • engeljohnb 5 hours ago
        If I were starting a new project, would it be unwise to just use OpenGL? It's what I'm used to, but people seem to talk about it as if it's deprecated or something.

        I know it is on Apple, but let's just assume I don't care about Apple specifically.

        • 59nadir 1 hour ago
          OpenGL is fine, it has the same issues now it had before but none of it really comes from "old age" or being deprecated in any way. It's not as debuggable and much harder to get good performance out of than the lower level APIs but beyond that it's still great.

          Honestly, starting out with OpenGL and moving to DX12 (which gets translated to Vulkan on Linux very reliably) is not a bad plan overall; DX12 is IMO a nicer and better API than Vulkan while still retaining the qualities that makes it an appropriate one once you actually want control.

          Edit:

          I would like to say that I really think one ought to use DSA (Direct State Access) and generally as modern of a OpenGL usage as one can, though. It's easy to get bamboozled into using older APIs because a lot of tutorials will do so, but you need to translate those things into modern modern OpenGL instead; trust me, it's worth it.

          Actual modern OpenGL is not as overtly about global state as the older API so at the very least you're removing large clusters of bugs by using DSA.

        • rabf 4 hours ago
          OpenGL is still be the best for compatibility in my opinion. I have been able to get my software using OpenGL to run on Linux, Windows, old/new phones, Intel integrated graphics and Nvidia. Unless you have very specific requirements it does everything you need and with a little care, plenty fast.
      • DeathArrow 1 hour ago
        >Maybe unpopular opinion: only a relative handful of developers working on actually making game engines need the detailed control Vulkan gives you.

        If you make a game instead of a game engine, you can use one of the existing engines.

    • user____name 10 hours ago
      If you don't need 4K PBR rendering, a software renderer is a lot of fun to write.
      • tombert 9 hours ago
        Interesting. I wouldn't actually mind learning how to do that; any tips on how/where to get started?
        • RamtinJ95 1 hour ago
          Pikuma.com writes a software renderer pretty much from scratch with all the necessary math and explanations in a very pedagogical way. Highly recommend it
        • junon 7 hours ago
          Getting a triangle on the screen is the hello world of 3D applications. Many such guides for your backend of choice. From there it becomes learning how the shaders work, internalizing projection matrices (if you're doing 3D) which takes a bit of thinking, then slowly as you build up enough abstractions turns back into a more "normal" data structures problem surrounding whatever it is you're actually building. But it's broad, be prepared for that.

          Definitely recommend starting with a more "batteries included" framework, then trying your hand at opengl, then Vulkan will at least make a bit more sense. SDL is a decent place to start.

          A lot of the friction is due to the tooling and debugging, so learning how to do that earlier rather than later will be quite beneficial.

        • rabf 4 hours ago
          Tsoding has been live streaming the development of a software renderer as of late: https://www.youtube.com/watch?v=maSIQg8IFRI
        • dmpk2k 2 hours ago
          Pikuma.com has a good one.
    • diath 4 hours ago
      If you want something like SDL but for 3D, check out Raylib.
    • gyomu 8 hours ago
      To this day, the best 3D API I’ve used (and I’ve tried quite a few over the years) is Apple’s SceneKit. Just the right levels of abstraction needed to get things on the screen in a productive, performant manner for most common use cases, from data visualization to games, with no cruft.

      Sadly 1) Apple only, 2) soft deprecated.

      • fingerlocks 3 hours ago
        Trying to write a ground up game engine in Metal is a very serious exercise in self-discipline. Literally everything you need is right at your finger tips with RealityKit / old SceneKit. It’s so tempting to cheat or take a few short cuts. There’s even a fully featured physics engine in there.
      • rudedogg 6 hours ago
        RealityKit is pretty cool and the replacement it seems. Still Apple only though, and I find the feedback loop slow/frustrating due to Swift

        I find SDL3 more fun and interesting, but it’s a ton of work to to get going.

    • DeathArrow 1 hour ago
      There was XNA but it was abandoned a long time ago.
    • cuckmaxxed 10 hours ago
      [dead]
  • jesse__ 6 hours ago
    > Starting your engine development by doing a Minecraft clone with multiplayer support is probably not a good idea.

    Plenty of people make minecraft-like games as their first engine. As far as voxel engines go, a minecraft clone is "hello, world."

  • gnabgib 11 hours ago
    (2024) At the time (625 points, 260 comments) https://news.ycombinator.com/item?id=40595741
  • jesse__ 6 hours ago
    I love that it's becoming kind of cool to do hobby game engines. I've been working on a hobby engine for 10 years and it's been a very rewarding experience.
  • anvuong 8 hours ago
    Vulkan was one of the hardest thing I've ever tried to learn. It's so unintuitive and tedious that seemingly drains the joy out of programming. Tiny brain =(
    • ryandrake 7 hours ago
      You don't have a tiny brain. Vulkan is a low-level chip abstraction API, and is about as joyful to use as a low-level USB API. For a more fun experience with very small amounts of source code needed to get started, I'd recommend trying OpenGL (especially pre-2.0 when they introduced shaders and started down the GPU-programming path), but the industry is dead-set on killing OpenGL for some reason.
      • jbb67 1 hour ago
        Vulkan is definitely a major pain and very difficult to learn... But once you've created an init function, a create buffer function, a create material function etc which you do once you can largely then just ignore it and write at a higher level.

        I don't like Vulkan. I keep thinking did nobody look at this and think 'there must be a better way' but it's what we've got and mostly it's just learn it and write the code once

      • zffr 3 hours ago
        Does anyone know why the industry is killing OpenGL?
        • whstl 1 hour ago
          People wanted more direct control over the GPU and memory, instead of having the drivers do that hard work.

          To fix this AMD developed Mantle in 2013. This inspired others: Apple released Metal in 2014, Microsoft released DX12 in 2015, and Khronos released Vulkan in 2016 based on Mantle. They're all kind of similar (some APIs better than others IMO).

          OpenGL did get some extensions to improve it too but in the end all the big engines just use the other 3.

        • dontlaugh 50 minutes ago
          OpenGL cannot achieve the control over modern hardware necessary to get competitive performance. Even in terms of CPU overhead it’s very limiting.

          Direct3D (and Mantle) had been offering lower level access for years, Vulkan was absolutely necessary.

          It’s like assembly. Most of us don’t have to bother.

    • raincole 4 hours ago
      I think anyone who ever looked at typical Vulcan code examples would reach the same conclusion: it's not for application/game developers.

      I really hope SDL3 or wgpu could be the abstraction layer that settles all these down. I personally bet on SDL3 just because they have support from Valve, a company that has reasons to care about cross platform gaming. But I would look into wgpu too (...if I were better at rust, sigh)

      • whstl 1 hour ago
        Yep. Most of the engine and "game from scratch" tutorials on Youtube, etc, use this style of having OpenGL code strewn around the app.

        With Vulkan this is borderline impossible and it becomes messy quite quickly. It's very low level. Unlike OpenGL, one really needs an abstraction layer on top, so you either gotta use a library or write your own in the end.

    • bsder 7 hours ago
      You don't have a tiny brain--programming Vulkan/DX12 sucks.

      The question you need to ask is: "Do I need my graphics to be multithreaded?"

      If the answer is "No"--don't use Vulkan/DX12! You wind up with all the complexity and absolutely zero of the benefits.

      If performance isn't a problem, using anything else--OpenGL, DirectX 11, game engines, etc.

      Once performance becomes the problem, then you can think about Vulkan/DX12.

  • DeathArrow 1 hour ago
    >If you haven’t done any graphics programming before, you should start with OpenGL

    I remember reading NeHe OpenGL tutorials about 23 years ago. I still believe it was one of the best tutorial series about anything in the way they were structured and how each tutorial built over knowledge acquired in previous ones.

  • nodesocket 6 hours ago
    I am fascinated with 3D/Gaming programming and watch a few YouTubers stream while they build games[1]. Honestly, it feels insanely more complicated than my wheelhouse of webapps and DevOps. As soon as you dive in, pixel shaders, compute shaders, geometry, linear algebra, partial differential equations (PDE). Brain meld.

    [1] https://www.youtube.com/@tokyospliff

  • jakogut 11 hours ago
    Note that I have retained the original title of the post, but I am not the author.