4 ms·
Oh, I wish. There are plenty of game engines and graphics libraries for C++. We have enough of those. This is not yet true for Rust. There seem to be, but if yo
by Animats 5y ago
Oh, I wish. There are plenty of game engines and graphics libraries for C++. We have enough of those. This is not yet true for Rust. There seem to be, but if you start to push the performance limits, problems appear.
I've been writing a client for Second Life, which, despite all the hype from NFT land, is still the best metaverse around. It's just sluggish, so I'm trying to fix that. The stack I'm using is Rust->Rend3->WGPU->Vulkan->NVidia.
Rust is doing fine. No problems at the language level. For this, I need Rust's safe concurrency; there are a lot of threads manipulating shared data. 18 months on, I only needed a debugger once, and the problem wasn't in my code.
Rend3/WGPU provides a cross platform layer. Put in meshes, materials, textures, and transforms, and have a loop endlessly calling the render function. Other threads change the scene in parallel with rendering. Rend3 handles memory allocation and scheduling. Vulkan gives you access to the GPU's memory. Managing it is someone else's problem. WGPU provides a common interface to Vulkan, DirectX, and Apple's Metal, which all do pretty much the same thing, but incompatibly. WGPU sits below most of the major game engines on Rust.
It all works, but not fast enough. There are locking bottlenecks at the Rend3 and WGPU levels which cause the render thread to be stalled when another thread is loading content. The whole point of Vulkan is that you can do both at once, but the Rend3 and WGPU levels don't quite have that working yet. The right functionality is there, but not the optimization needed for serious work.
Nobody seems to be building AAA titles in Rust. I'm pushing the scene complexity to AAA title levels[1], and I seem to be close to the first person to do that. Not where I wanted to be.
If you want to work on the lower levels, the WGPU and Rend3 projects, which are open source, need more good people.
[1] https://video.hardlimit.com/w/peBesyAgtzfRWS5FnDQQtn https://video.hardlimit.com/w/peBesyAgtzfRWS5FnDQQtn
- 1ark 5y agoEmbark Studios started an all Rust operation a few years ago. https://github.com/EmbarkStudios https://github.com/EmbarkStudios
- Animats 5y agoYes, and they're still working on the basics. Their system for writing shaders in Rust may be useful, but it's not done yet.
- johnnyanmac 5y agoIt's a tough problem when it comes to AAA adoption. I'm not even certain if Rust has been in the game developer's conscious enough for a robust, performant engine to arise yet. i.e. if we assume that a studio deadset on making a Rust engine for a AAA game was given 5-6 years of full time engine development, they'd still be in the thick of things. And on top of that, there's just so much tooling built around existing engines/software/IDE's to be built for truly productive AAA work. There's so much to work on and developers as of now aren't convinced enough of the potential benefits to jump into that foray (at least, not on the company's dime).
- Animats 5y agoIt is. I'm doing this because in the "metaverse" space, defined as virtual worlds with user-created content, the existing game engines are not that helpful. They all rely on heavy content preprocessing in some desktop environment. Virtual worlds full of items created by huge numbers of users don't have that step. Which means Unity and Unreal Engine are out, at least in their current versions. (This, by the way, is why you can't sell furniture NFTs in Decentraland; the unit of updating is the land parcel with everything on it, edited offline.) Everybody who has a good, editable virtual world has their own engine. Roblox is doing some very nice work, but the system is entirely proprietary. Watch this build in Roblox. It's not just blocks any more.[1] That's a very nice 3D editor, using constructive solid geometry. [1] https://www.youtube.com/watch?v=fpiRDk510Wg https://www.youtube.com/watch?v=fpiRDk510Wg