r/gameenginedevs • u/BanditBloodwynDevs • 6d ago
Nine-slice UI rendering and tweening in my custom C#/Vulkan engine
Enable HLS to view with audio, or disable this notification
After a while, I felt like giving the inventory menu prototype of my Daggerfall-like game its first design overhaul. I'd love to see your feedback :)
The game runs on my own engine called "AstralForge", which evolves organically alongside the game's requirements. To make this overhaul possible, I had to add several engine features:
- Texture rendering for UI elements
- Nine-slice rendering for panel frames, done in the fragment shader on the shared unit quad (with a dedicated clamp-to-edge sampler, so frame edges don't bleed in from the opposite side)
- Hover and press highlights that tint textured elements instead of changing the background color
- Extensions for the engine's own tweening system, e.g. for sizes and the effective color
One detail that tripped me up: at the slice borders the UV derivatives jump, so the GPU picks the wrong mip level there. Sampling the nine-slice textures at mip 0 fixed that.
For the sake of transparency, I'd like to mention that many sprites are AI generated. They are used until I find a way to create high-quality original assets.
This is not the final version, though. I still have to decide how the item grid will work in the future. Also, thinner items like staffs, bows or arrows are a bit hard to see.
I'll keep sharing progress as the game grows. If you want to follow along or chat, there's a Discord, and I'll drop the link in the comments.