Current design decisions for my game engine:
-
glTF model loading and 3D rendering with depth work! There's some strange bug when I try to load in larger models, and there are a bunch of validation errors about synchronization issues, but those are for another day
Progress of the evening: fixed the problem that prevented some models from loading (it was just a wrong variable), loading all meshes / surfaces in a glTF now, loading normals. Textures will be next!
-
Progress of the evening: fixed the problem that prevented some models from loading (it was just a wrong variable), loading all meshes / surfaces in a glTF now, loading normals. Textures will be next!
biblically accurate bindless textures
-
Engine rewrite progress update after an extended weekend:
- Bindless textures and materials
- Normal mapping
- Scene tree with transform hierarchy
- Camera and scene data in per-frame uniform buffer instead of push constants
- MSAA
- Lots of refactoring and new abstractions -
Engine rewrite progress update after an extended weekend:
- Bindless textures and materials
- Normal mapping
- Scene tree with transform hierarchy
- Camera and scene data in per-frame uniform buffer instead of push constants
- MSAA
- Lots of refactoring and new abstractionsSome stuff was mostly copy-pasted from my previous project. The really new thing is the bindless paradigm. This finally helped me understand descriptor sets - I was really confused about them last time when I followed vkguide.dev.
Not sure if I'm doing bindless "right" or if I'm bound for troubles down the road but so far it works pretty well! I only do a single vkCmdBindDescriptorSets per frame, binding global resources, and push material IDs per object in push constants.
-
Some stuff was mostly copy-pasted from my previous project. The really new thing is the bindless paradigm. This finally helped me understand descriptor sets - I was really confused about them last time when I followed vkguide.dev.
Not sure if I'm doing bindless "right" or if I'm bound for troubles down the road but so far it works pretty well! I only do a single vkCmdBindDescriptorSets per frame, binding global resources, and push material IDs per object in push constants.
I don't know yet how this will change once I add more shaders / material types though. I only have a single graphics pipeline right now, figuring out a system to expand on that will be the next big task.
Also Slang has some stuff dedicated to "bindless" but I didn't really understand it and also it seems to work without it? Might refactor the shader once I figure out the advantage of DescriptorHandle and how to use it
-
I don't know yet how this will change once I add more shaders / material types though. I only have a single graphics pipeline right now, figuring out a system to expand on that will be the next big task.
Also Slang has some stuff dedicated to "bindless" but I didn't really understand it and also it seems to work without it? Might refactor the shader once I figure out the advantage of DescriptorHandle and how to use it
Anyway, possible next steps:
- Mipmaps
- Basic lighting
- Finally start cleaning up resources correctly
- Maybe look into batching the uploads of assets the GPU -
Anyway, possible next steps:
- Mipmaps
- Basic lighting
- Finally start cleaning up resources correctly
- Maybe look into batching the uploads of assets the GPUWith the combined power of albedo, normal maps, and a simple dot product I present: basic lighting
-
With the combined power of albedo, normal maps, and a simple dot product I present: basic lighting
Got a bunch of stuff in mind for where to go next (Qt based editor, copying over more systems from the old codebase, etc) but I have to try to slow down development for at least the next month to focus on other priorities
-
Got a bunch of stuff in mind for where to go next (Qt based editor, copying over more systems from the old codebase, etc) but I have to try to slow down development for at least the next month to focus on other priorities
Despite trying to put my focus elsewhere I've done some experimentation and thinking lately regarding editor UI.
I want to use Qt since it's a mature cross-platform UI framework. But it actually consists of two frameworks: QtWidgets (traditional desktop UI, software-rendered, uses procedural C++) and QtQuick (GPU rendered, mobile support, uses declarative QML and optional JavaScript and/or C++).
QtQuick seemed more "modern" so that's what I started with.
-
Despite trying to put my focus elsewhere I've done some experimentation and thinking lately regarding editor UI.
I want to use Qt since it's a mature cross-platform UI framework. But it actually consists of two frameworks: QtWidgets (traditional desktop UI, software-rendered, uses procedural C++) and QtQuick (GPU rendered, mobile support, uses declarative QML and optional JavaScript and/or C++).
QtQuick seemed more "modern" so that's what I started with.
First major task was getting a 3D viewport rendered by my engine into a Qt window. Qt is quite flexible and there were a lot of different avenues that seemed feasible for this. There were Most of them didn't work out in the end or were intended for different use cases.
What worked for me in the end was:
-
First major task was getting a 3D viewport rendered by my engine into a Qt window. Qt is quite flexible and there were a lot of different avenues that seemed feasible for this. There were Most of them didn't work out in the end or were intended for different use cases.
What worked for me in the end was:
- Render viewport to an offscreen image
- Export the memory with "vkGetMemoryFdKHR"
- In Qt, create a VkImage and import the memory that was exported from the engine
- Extend QQuickItem and QSGTextureProvider to show the VkImage on a custom QML type window -
- Render viewport to an offscreen image
- Export the memory with "vkGetMemoryFdKHR"
- In Qt, create a VkImage and import the memory that was exported from the engine
- Extend QQuickItem and QSGTextureProvider to show the VkImage on a custom QML type windowThe reason for doing it in this roundabout way is that Qt uses its own Vulkan instance and device, and you can't just directly use images in one instance that were created by another one, even if you're in the same process.
I _could_ have told Qt to just use my Vulkan context for its own rendering, and I tried it and it technically worked, but that led to all sorts of synchronization issues and crashes.
-
The reason for doing it in this roundabout way is that Qt uses its own Vulkan instance and device, and you can't just directly use images in one instance that were created by another one, even if you're in the same process.
I _could_ have told Qt to just use my Vulkan context for its own rendering, and I tried it and it technically worked, but that led to all sorts of synchronization issues and crashes.
Right now I _still_ get validation errors, but no crashes (until I close the window, probably because I do zero clean up currently :D)
So proof of concept for the most important aspect: done ✅
Next up: finding Qt libraries for some advanced UI stuff I wanna use.
-
Right now I _still_ get validation errors, but no crashes (until I close the window, probably because I do zero clean up currently :D)
So proof of concept for the most important aspect: done ✅
Next up: finding Qt libraries for some advanced UI stuff I wanna use.
Most importantly: docking. My vision for the engine editor is that everything is a fully configurable and detachable dock. It should be able to spread over all your monitors!
Qt has built-in docking functionality, but it's restricted to QtWidgets (i.e. not available in QtQuick) and is a bit limited.
First library I looked at was Advanced Docking System for Qt: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
Seemed very promising but it doesn't have (and will never get) Wayland support, so not an option :/
-
Most importantly: docking. My vision for the engine editor is that everything is a fully configurable and detachable dock. It should be able to spread over all your monitors!
Qt has built-in docking functionality, but it's restricted to QtWidgets (i.e. not available in QtQuick) and is a bit limited.
First library I looked at was Advanced Docking System for Qt: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
Seemed very promising but it doesn't have (and will never get) Wayland support, so not an option :/
Next most promising library: KDDockWidgets: https://github.com/KDAB/KDDockWidgets
Technically has QML support but I tried it and it doesn't seem to work well :/
The QtWidgets version of it is almost perfect, it does exactly what I want. Widgets isn't a deal breaker, I can just embed QtQuick views inside the docks (and using QML isn't _that_ important to me).
-
Next most promising library: KDDockWidgets: https://github.com/KDAB/KDDockWidgets
Technically has QML support but I tried it and it doesn't seem to work well :/
The QtWidgets version of it is almost perfect, it does exactly what I want. Widgets isn't a deal breaker, I can just embed QtQuick views inside the docks (and using QML isn't _that_ important to me).
The thing is, the license of KDDockWidgets is GPL. Not LGPL, which means that if I use it the whole engine editor must be available under GPL if I understand correctly.
My current intention is to make it MIT, but I'm still open to the idea of putting it under the (L)GPL license. But I kinda want it to be my decision, not be forced by one dependency :/
Soo I'm not sure what to do. Guess I'll try out Qt's built-in docking first. Would prefer not to make my own system...
-
The thing is, the license of KDDockWidgets is GPL. Not LGPL, which means that if I use it the whole engine editor must be available under GPL if I understand correctly.
My current intention is to make it MIT, but I'm still open to the idea of putting it under the (L)GPL license. But I kinda want it to be my decision, not be forced by one dependency :/
Soo I'm not sure what to do. Guess I'll try out Qt's built-in docking first. Would prefer not to make my own system...
The other major non-traditional UI type I need is a node/graph editor (like the one in Blender for materials / geometry nodes). I need it primarily for complex animation graphs, and I'd also like to use it for dialogue trees and maybe quest scripting.
Haven't tried it yet but QtNodes seems promising: https://github.com/paceholder/nodeeditor
It's also based on QtWidgets. Again, not a deal breaker, looks like I could embed it in QML if I wanted to.
-
The other major non-traditional UI type I need is a node/graph editor (like the one in Blender for materials / geometry nodes). I need it primarily for complex animation graphs, and I'd also like to use it for dialogue trees and maybe quest scripting.
Haven't tried it yet but QtNodes seems promising: https://github.com/paceholder/nodeeditor
It's also based on QtWidgets. Again, not a deal breaker, looks like I could embed it in QML if I wanted to.
I wish the situation was reversed - making my own node editor system seems doable and maybe even fun, while making a flexible docking solution for an existing UI framework just feels annoying...
I wonder if it would be easiest to fork "Advanced Docking System for Qt" and add Wayland support 🤔 Tbf it does seem to work under XWayland already, but I feel like if I write new software it should try to support Wayland natively, even though it's a pain...
-
I wish the situation was reversed - making my own node editor system seems doable and maybe even fun, while making a flexible docking solution for an existing UI framework just feels annoying...
I wonder if it would be easiest to fork "Advanced Docking System for Qt" and add Wayland support 🤔 Tbf it does seem to work under XWayland already, but I feel like if I write new software it should try to support Wayland natively, even though it's a pain...
Ok looks like the missing feature in Wayland which was blocking a fix for the advanced docking system has since been merged and this should be doable now. The maintainer isn't interested in Linux support but would be open to PRs.
-
Ok looks like the missing feature in Wayland which was blocking a fix for the advanced docking system has since been merged and this should be doable now. The maintainer isn't interested in Linux support but would be open to PRs.
Alright I checked out the demo of Advanced Docking System and it also does exactly what I need, under a BSD license, as long you force it to run via X11/XWayland. I think I'll just go with this for now and if I _really_ need proper Wayland support I'll look into upstreaming a fix. And maybe someone else will do it until then :D