digitalmars.D.learn - Options for Cross-Platform 3D Game Development
- Andrew (16/16) Jul 05 2023 So, I've gotten the itch to have a go at game development in D,
- ryuukk_ (13/29) Jul 05 2023 Depends what you really want to do
- ryuukk_ (3/3) Jul 05 2023 Oh, and i forgot to mention Sokol, great C library, i couldn't
- IchorDev (33/58) Jul 05 2023 Lately I've been diligently updating BindBC-bgfx because bgfx is
- Chris Katko (18/34) Jul 05 2023 Are you trying to make a PC game, or a mobile game? Because in
- Sergey (4/12) Jul 06 2023 There is a Hipreme Engine (written in D):
- Hipreme (10/26) Jul 06 2023 To be honest, I'm accepting anyone on Hipreme Engine that is
So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is, apparently OpenGL is deprecated for apple devices, so I don't really want to use that unless there are no decent alternatives. So far, the most promising I've seen is [bindbc-bgfx](https://code.dlang.org/packages/bindbc-bgfx), but it's been a pain to set up due to having to build the bgfx codebase, which requires a specific version of glibc that my distro (Linux Mint) doesn't offer yet. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.
Jul 05 2023
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is, apparently OpenGL is deprecated for apple devices, so I don't really want to use that unless there are no decent alternatives. So far, the most promising I've seen is [bindbc-bgfx](https://code.dlang.org/packages/bindbc-bgfx), but it's been a pain to set up due to having to build the bgfx codebase, which requires a specific version of glibc that my distro (Linux Mint) doesn't offer yet. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.Depends what you really want to do If you need something that provides you an API to render things directly without doing raw GPU commands, then RayLib is excellent, you can still build your engine around it, it act like a framework a la libGDX/XNA/MonoGame - https://github.com/schveiguy/raylib-d If you want to create your own engine from scratch, then Vulkan (works on mobile/linux/windows and macOS via moltenvk) Or you can use WebGPU, despite its name it's crossplatform, targets Web via wasm (with LDC, requires some extra work tho), Windows, Linux, macOS, mobiles - https://github.com/gecko0307/bindbc-wgpu
Jul 05 2023
Oh, and i forgot to mention Sokol, great C library, i couldn't find D bindings, so you'll have to create your own (it's trivial) https://github.com/floooh/sokol
Jul 05 2023
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is, apparently OpenGL is deprecated for apple devices, so I don't really want to use that unless there are no decent alternatives. So far, the most promising I've seen is [bindbc-bgfx](https://code.dlang.org/packages/bindbc-bgfx), but it's been a pain to set up due to having to build the bgfx codebase, which requires a specific version of glibc that my distro (Linux Mint) doesn't offer yet. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.Lately I've been diligently updating BindBC-bgfx because bgfx is seriously really good. About your glibc problem, you can use an older version of bgfx (which might mean 1. you have to use the old BindBC-bgfx API, or 2. run the *newest* [binding generator script](https://github.com/BindBC/bindbc-bgfx/#generating-bindings) on an older version of bgfx; rather than running the old generator script that comes with that older version), or you can build and install a newer version of GDC yourself, which is what I did. It's VERY slow to build, but relatively painless otherwise. bgfx is a little bit confusing for a first-time user, but if you have any trouble setting it up try searching through the bgfx Discord server, and if you can't find the answer that way then just ask for help there. Its documentation is alright but some of the English in it isn't the best. Once you're familiar with it, it's a really simple and powerful API that can do basically anything, but it's all rendering backend-agnostic. On Wednesday, 5 July 2023 at 23:53:41 UTC, ryuukk_ wrote:If you need something that provides you an API to render things directly without doing raw GPU commands, then RayLib is excellent, you can still build your engine around it, it act like a framework a la libGDX/XNA/MonoGame - https://github.com/schveiguy/raylib-d If you want to create your own engine from scratch, then Vulkan (works on mobile/linux/windows and macOS via moltenvk)I wouldn't really recommend Raylib unless you only plan to use fairly rudimentary 3D, as I've found its 3D rendering to be very limited. Unlike bgfx it can't do compute shaders, read-back from the GPU, instancing, 32-bit index buffers, etc. [Raylib's cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html) should give you an idea of what you CAN do with its API. On Wednesday, 5 July 2023 at 23:53:41 UTC, ryuukk_ wrote:If you want to create your own engine from scratch, then Vulkan (works on mobile/linux/windows and macOS via moltenvk)Vulkan is also a really good option, and probably a bit faster than bgfx (or OpenGL obviously), but its API is very complicated. My head nearly exploded trying to use Vulkan, and I never got to the point of rendering 1 triangle. If you think you're enough of a genius then I'd say at least give it a shot. Worst case scenario is you give up after spending a day or two trying to learn it. P.S. I'm planning on adding a native-D bgfx backend to BindBC-ImGui 1.0 (my WIP bindings to the ImGui C++ API), if that's of interest to you. ;)
Jul 05 2023
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is, apparently OpenGL is deprecated for apple devices, so I don't really want to use that unless there are no decent alternatives. So far, the most promising I've seen is [bindbc-bgfx](https://code.dlang.org/packages/bindbc-bgfx), but it's been a pain to set up due to having to build the bgfx codebase, which requires a specific version of glibc that my distro (Linux Mint) doesn't offer yet. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.Are you trying to make a PC game, or a mobile game? Because in 99% of cases I would pick a different toolchain for mobile than PC. OpenGL being depreciated on a single, walled-garden platform, does not rule it out for the entire rest of installed systems. Only if I absolutely needed, cross-platform out-of-the-box with mobiles and PC, would I pick a package like, Xamarin. Which now framework with all my apps. I would not pick Xamarin just because I wanted to keep my options open, I would d pick it because I have a planned application that needed to be 1:1 synced across iPhone, Android (and possibly PC). There's also other options. Such as using a OpenGL -> Metal conversion layer, like MetalAngle: https://github.com/kakashidinho/metalangle https://chromium.googlesource.com/angle/angle So be sure exactly what you want as the best tools for the job will depend greatly on the requirements of the project.
Jul 05 2023
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.There is a Hipreme Engine (written in D): Check it out on the GitHub: https://github.com/MrcSnm/HipremeEngine
Jul 06 2023
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote:So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is, apparently OpenGL is deprecated for apple devices, so I don't really want to use that unless there are no decent alternatives. So far, the most promising I've seen is [bindbc-bgfx](https://code.dlang.org/packages/bindbc-bgfx), but it's been a pain to set up due to having to build the bgfx codebase, which requires a specific version of glibc that my distro (Linux Mint) doesn't offer yet. Are there any other recommendations for cross-platform rendering libraries? Of course I could use a pre-made game engine like Unity or Godot, but for me, most of the fun is in making the engine.To be honest, I'm accepting anyone on Hipreme Engine that is willing to help adding a shader transpiler or cross compiler. Right now I got an abstraction over opengl, direct3d and metal, for almost every basic stuff out there, which is really simple. Having the shaders being written once is pretty much the next step but I can't focus on that. You'll have a better experience with Hipreme Engine than mostly of the options you get here since you'll have a complete cross compilation env for you requiring no configuration at all.
Jul 06 2023