4 ms·
I still wish there was some kind of middle ground between OpenGL and Vulkan though, as an aspiring indie dev who’s making a 3D game without using Unity/Unreal (
by cyber_kinetist 4y ago
I still wish there was some kind of middle ground between OpenGL and Vulkan though, as an aspiring indie dev who’s making a 3D game without using Unity/Unreal (The reason for this is that for my game I need at least tens of thousands of simulated AI agents, and conventional gameobject systems aren’t designed to do this performantly.)
The Metal API from Apple seems to be just the right abstraction for general graphics programming, though it sucks that you can only use it on Apple devices. Maybe SDL_gpu can take this role once it’s finished, but till then I’m toiling away with Vulkan… yeah it’s still better than OpenGL, but its usability can definitely be improved. Maybe I should have just gone to DirectX 11… since the drivers there are ridiculously optimized.
- SotCodeLaureate 4y ago> at least tens of thousands of simulated AI agents Are you planning on displaying all/most of them every frame, or just to control that many of them, then draw those nearby/visible? If it's the former (but how exactly?) then perhaps Vk is the way to go, if the latter, then it's hard to see how Vulkan vs OpenGL is all that relevant here.
- TillE 4y agoRight, there's no reason to discard a game engine just because its most common usage patterns are inappropriate to your needs. Even if you do need to draw a zillion objects on screen, any engine will let you create your own mesh and feed that to the renderer.
- robotnikman 4y agoIIRC the game From the Depths does this, being a game where you create ships using thousands of voxels. Using gameobjects for everything just would not have worked
- cyber_kinetist 4y agoMany of the enemy entities (which I’m expecting to be around the ten-thousands in the late portions of the game) are going to be visible on-screen, since most of them are going to be flying above the ground and only the terrain is going to hide them (no big architectural structures on the map obstructing them). And I would like to create lighting effects when they explode, which would require huge lighting counts. The AI for the flying enemies isn’t going to be too complex, it will probably going to be some variation of boid simulation. However I still expect this to be computationally intensive, particularly when it comes to querying nearby entities and terrain. I am expecting some of the expensive geometric querying can be moved to the GPU via compute shaders. The reason for using Vulkan instead of OpenGL was more of a pragmatic one: I’ve heard that OpenGL drivers can be hilariously bad on Windows, when it comes to both conformance and performance. Vulkan seems to be better in that respect, since both Nvidia and Amd has incentive to develop decent enough Vulkan drivers since some high-profile AAA games use it. Also, it is a pain in the ass to debug issues in OpenGL, and Vulkan is at least better than that.
- Bolkan 4y agohttps://github.com/gfx-rs/wgpu https://github.com/gfx-rs/wgpu
- ChadNauseam 4y agoSeconding wgpu, it's so much less verbose than vulkan and the memory safety guarantees are pretty nice.
- cyber_kinetist 4y agoI don’t want to use Rust though, I want to use C++. (And before all the Rust afficionados immediately jump at me, I just feel much more productive in C++ than Rust when doing graphics programming.) I’ve heard that Google has a C++ webgpu library in the works, but I wasn’t sure if it was stable enough to actually ship games in.
- steveklabnik 4y agoYou can use wgpu with C++ via https://github.com/gfx-rs/wgpu-native https://github.com/gfx-rs/wgpu-native
- pjmlp 4y agoYou could be using something like Ogre3D, then you have your Apple like solution.
- cyber_kinetist 4y agoI think Ogre3D and Metal are two really different things though… By the way do you know how is the current status of the next version of Ogre3D? I’ve heard they were doing a complete overhaul (with a new much performant render system), but I’m not sure if it was actually finished.
- pjmlp 4y agoYeah, Ogre3D is a graphics middleware, while Metal is a straigh 3D API, with lots of cool tooling, still it could be an option. Probably not at this stage of your development. It has been a decade since I really messed with it, but looking at their site Ogre3D Next seems to be coming along, including Vulkan support.
- twoquestions 4y agoHave you looked at either Raylib or SFML? Both are somewhat high-level graphics abstraction libraries, but neither are anywhere near the weight or functionality of a proper game engine. https://www.raylib.com/ https://www.raylib.com/ https://www.sfml-dev.org/ https://www.sfml-dev.org/ Or is something like this not what you're looking for?
- cyber_kinetist 4y agoNo, I’m making a 3D game that’s going to lean into heavy shader usage (probably going to implement either deferred or forward clustered rendering), and also might have to potentially use compute shaders for some expensive geometry-querying tasks.
- saidinesh5 4y agoThere can still be and there already is plenty of middle grounds between OpenGL and Vulkan. Like Skia, OpenGL etc... They can just be implemented on top of Vulkan. Vulkan is just an API provided by GPU vendors like Nvidia, AMD etc.. to expose the capabilities of their hardware and not worry about accommodating all the edge cases of various graphics use cases in their bloated mess of "drivers". Here's my fav. rant about it, tldr; GPU Vendors needed a lean API to expose the capabilities of their hardware, and OpenGL: https://www.gamedev.net/forums/topic/666419-what-are-your-opinions-on-dx12vulkanmantle/5215019/ https://www.gamedev.net/forums/topic/666419-what-are-your-op...
- cyber_kinetist 4y agoIf you’re making a 3d game with a customed designed renderer, then what should I use instead of Vulkan though? (The real answer for this is DX11, but assume I care a bit for cross-platform and relatively less vendor lock-in.) Skia is only for 2D graphics, OpenGL has shit drivers on Windows, and WebGPU is still work-in-progress and isn’t something you should depend on just yet. Between DX and Vulkan, there isn’t really that much choice.
- saidinesh5 4y agoYou can still use OpenGL. Just not the vendor provided drivers. They are indeed horrible. There are libraries like: * ANGLE ( https://github.com/google/angle https://github.com/google/angle ) - An OpenGL ES implementation with Direct3D 9, Direct3D 11, Desktop GL, GL ES, Vulkan and Metal backends. This is what we used to use for shipping our Qt 3D application, that used a bunch of OpenGL Shaders. We used to get bug reports about various shaders not working properly on various hardware. After switching to this, all those bug reports vanished. * Zinc ( https://www.supergoodcode.com/do-not/ https://www.supergoodcode.com/do-not/ ) - A more recent, OpenGL implementation on top of Vulkan. I haven't used this one yet. But they are making a lot of progress and it is almost as performant as vendor provided OpenGL Drivers these days. So if I ever have to ship a desktop app, needing opengl, I'd strongly consider using this.
- interroboink 4y agoI've had a decent experience with bgfx (https://github.com/bkaradzic/bgfx https://github.com/bkaradzic/bgfx). It is solely a rendering library (no input, physics, sound, etc). It operates a layer just above a native rendering library, such as DirectX, OpenGL, Vulkan, Metal, etc - those are the "backend renderers" that bgfx uses. Though I have my complaints about it, I think bgfx gives a good powerful-but-not-too-complicated abstraction over graphics programming; for some design info, see: https://bkaradzic.github.io/bgfx/internals.html https://bkaradzic.github.io/bgfx/internals.html
- jarpadat 4y agoI am also writing a game engine, also because of the gameobject issues, also doing tens of thousands of simulated AI agents. In my case they are GPU-accelerated and I'd guess you are doing something basically similar even if it's CPU-based. Would be interested to discuss architecture as there aren't many of us out there and not much of a shared knowledge base. I looked for contact info in your profile but didn't immediately turn it up.