Thursday 26 July 2018

Dev Update 3 : One step closer!

- Notes:
Recoded Vulkan loader to dynamically load Vulkan and it's functions. Now it's possible to have an OpenGL or DirectX back-up if I'm so inclined.
This new loader can also discern if the user computer has an older version of Vulkan (which as far as I can see right now isn't going to effect things too bad. In the future this may be needed)
Learning colour spaces and colour models
Created a swapchain and now learning how to use them to render things on the images in the swapchain.


The Big Weekly Highlights:

This week has been interesting. I'm not sure if it felt busy or not, but it was sure gone fast! We're trying a new format for the weekly updates, hope ya guys like it. So without further delay, here's the big highlights of this week:
  • Coded the engine to load Vulkan dynamically.
  • Engine now works with both Vulkan 1.0.0 and 1.1.0!
  • Reading a lot. Learning a lot.
  • Swapchains!

Loading Vulkan Dynamically.

What does this mean and why is it important? Well at first I was linking Vulkan with the engine, which means that the engine required Vulkan to be installed. Now it doesn't have to require Vulkan and if I wanted to I could code an OpenGL renderer as well, for use as a back-up just in case Vulkan wasn't found. This also means that if I wanted to learn Direct3D, I could use it as well, and then have the engine pick out of the three based on availability and maybe even user choice. But this isn't the reason why I did that. (I would, later on release, accept a OpenGL or Direct3D renderer to hook into the engine)
So why did you make it load Dynamically? Mostly cause it's less code in the long run. Before this change certain functions weren't being loaded due to their nature, so I'd have to load them dynamically anyhow. So I decided that if I'm gonna load certain code dynamically, I might as well load all the code I need dynamically! Also, it allows for the next highlight:

Running on both Vulkan 1.0 and 1.1!

Before this you were only on 1.0? Nope! I was actually using 1.1, unfortunately my tester needed to buy a new laptop. Which prompted me to ask them if they could test the engine on it. We soon found out that the new laptop, which only had a intel iGPU, could only run 1.0. Therefore the engine was refusing to run. Now I'm only using one piece of code that requires 1.1, and it's actually meant to test what version we're running. Dynamically loading Vulkan meant that if I can't use Vulkan 1.1+ code to check the version, we're obviously running on 1.0, so that was a simple rewrite.
Now to bug Intel to keep their stuff updated!

Turning into a bookworm.

Well...eBookWorm? Either way I spend a lot of time reading and learning things about Vulkan and graphical know-how I know I should learn but was always putting it on the back burner. Not anymore! I took a look at colorspaces, what they are, what they can do for me, and which ones I should be concerned about. While I could write a blog post about colorspaces, do yourself a favour and look it up online. There's plenty of other posts which will help you learn what you need to know.

I'm also reading ahead in all the tutorials I've been... "following" (read as "Looking at, then frankensteining them together in my own way" )... and now I'm very close to actually get some pixels on the screen! That aren't black. That is. My weird way of learning Vulkan is actually working though, reading three different tutorials, and also the specs, when I see something in the tutorials I don't understand, I read the specs...and then get distracted with the specs and read the next 15 sections... It's all fine and dandy, I'm sure I'll need those other 15 sections somewhere!

But... Now to the actual code again: 

Swapchains! 

We've seen 'swapchains' twice now. What is it? Basically, it's a bunch of images which we're rendering to and presenting to the screen. And we've finally made some! If you know the term "double buffering" this is mostly what swapchains are used for. Swapchains have a handful of interesting modes, with a few which could be described as double or triple buffering. 

They're not as exciting as I made them out to be, but still, they're one of the steps to put a 3D image onto the screen, so it's exciting for everyone who wants a game from us!

Conclusion:

I hope this is a good format, and if you enjoy it, please share it with friends or people who you think will like this kind of stuff! If you don't enjoy, maybe leave a comment here or on our twitter @RestartLaterS suggesting improvements? Always willing to listen to feedback, good or bad!
Thanks and again, don't work too hard!

No comments:

Post a Comment