Just wanted to say that I've been watching your videos while reading other vulkan resources, the api docs, and a couple other "what not to do" type of excerpts and I am very appreciative of stumbling onto your series. My end goal is to make a small and specific engine over the next few years and hopefully release my first game by the time I hit 40 (currently 27). So this series coupled with other resources are a HUGE help in getting started with vulkan and again - thank you for these videos 😃
Thank you, this seems like the perfect series to start following! After taking a paper on computer graphics during my university days I've developed a real interest in this side of video games. This might just be what I need to start exploring it again!
Thanks for the series! I’m beginner-intermediate with OpenGL. Build myself 2 frameworks with it. Now I’m transitioning to Vulkan and your series will surely come in handy. All the best!
Thank you very much for these videos buddy, I have a big project in mind and I need to develop my own graphics engine, and I choose Vulkan as a tool. I hope you keep posting videos
@BerdanGalea Thanks for the great Vulkan course! I hope will see the next videos about textures, terrain, render-graph and etc. Think about this please-please-please
Great...Easter holidays just started for me ... on mac book pro. I'm swapping from sfml (recently started) to vulkan. More interested in playing with graphics and effects than making actual games. Many thanks and I'm sticking with you, just subscribed. I'm a patient chap know it'll not be easy.
You're on a mac using vscode. Wow, that's great! Can you make a tutorial that gets us there? Right now I'm using Xcode and am pretty unahppy. Thank you!
you... are.. the shit bro, str8 up. This is simply amazing, ty for making these videos. You should follow it up with a part two of an engine creation but instead of vulkan using glfw for 3d graphics in a window, you should do it for OpenXR technologies, focusing on either PCVR or better, the Android / C++ native implementation of OpenXR for the meta quest 3. I am learning a lot from you, as opposed to the numerous books I could not quite grasp fully until I found your videos.. not even in the university I attend have I learned as much as I have in the past 20 summin videos of yours I binged in 4 days.. so far thanks
This is tricky to answer and really depends on the person and their goals. But here's some general info that may help when making the decision on what to learn first. Do you have a deadline? OpenGL is definitely easier to learn in my opinion and quicker to get started with. If you want to learn a graphics api to use for a school or personal project with an upcoming deadline, I'd recommend OpenGL. That way you can spend most of your time on your project specifics, rather than learning the API. What API will get me a job? As of January 2021, this is still in OpenGLs favour. From some quick searching, there seems to be a 2:1 relationship between jobs hiring for opengl vs vulkan (within Canada). However, things are shifting towards vulkan. OpenGL is not going to disappear, but I think for someone getting started now it makes more sense to learn Vulkan. Demand for vulkan will increase, and fewer programmers know vulkan compared to openGL, so less supply. I want to learn vulkan, do I need to learn openGL first? If your goal is to learn vulkan then start with vulkan. While it does help, OpenGL is not a pre-requisite for learning vulkan. Perhaps a year or two ago, I'd have given a different answer to this, since Vulkan wasn't as established yet. But learning openGL or some other graphics API first I'd say is no longer necessary. How comfortable are you with reading code? Programming is funny when compared to spoken languages. Typically you need to read before you can write, but most programmers are better at writing code than reading it. OpenGL tutorials are significantly better than the existing Vulkan tutorials right now; there's more of them, and of higher quality. For many of the more intermediate to advance vulkan topics, I've found the only way to learn right now is by reading the documentation and reading coding examples. This will change over the next couple years as more vulkan tutorials are made, but for now OpenGL has much better educational content for it which is a strong point in it's favour. So I hope this helped and didn't cause more confusion. My goal is that in 6 months time I'll have ~20 more videos released and can definitively say learn vulkan first and watch this tutorial series. However right now, depending on your situation OpenGL could be the better option. Keep in mind that I likely have a bias towards vulkan though no matter how hard I've tried to give an unbiased answer. I am creating a vulkan tutorial series after all and have spent quite a bit of time over the past year learning vulkan, so of course it would be what I recommend :)
I'd like to add to this that you can still use opengl tutorials to help when you're programming in vulkan. They're not completely different and all the graphics techniques still apply. A tutorial like paroj's or learnopengl cover many subjects that are useful no matter the API.
thanks! and yes, not settled on an actually implementation yet but will have a tutorial or 2 covering this topic. We'll make something from scratch, but I will also mention some existing librairies that could be used instead
Want to learn Vulkan to make a game engine that can do minecraft like voxel generation. I keep seeing massive performance videos from people coding in both vulken and OpenGL and they tend to be around x4 more performent for even larger items then there OpenGL counter parts. Lets go!
Hey, after watching the entier series I will recommend any newbie who doesnt have any knowledge of opengl to first go and read the khronos tutorials on vulkan and then come over here :)
Work unfortunately got to busy. I’m hoping to start it up again. Been doing a bit of work in the engine when I have time. Trying to get a few intermediate features completed and added then I’ll push a branch to the GitHub and then go back and start creating tutorials for each part. But still will probably be a few more months, but really can’t make any promises… sorry 😞
i was wondering if you could show how you setup the development area, since i was planning on using visual studio code, but havent found a way to set it up properly to follow this tutorial.
What platform are you using? I’m thinking of doing at least like a write up in setting things up. Or a quick video. You could also take a look at the cmake tutorial I just did, that shows how to use vscode on any platform. But it might be confusing to follow when first getting started
Not a great start ... i've tried to follow all the steps, using xcode 12.4. I'm getting a vulcan/vulcan.h file not found in glfw3.h. In the header paths in xcode I needed to add the 2 paths next to each other, so like below. /usr/local/include Vulcan/macOS/include I've tried separating these by , instead of just a blank space and also ; but doesn't seem to work? would appreciate any help please?
I know C++ professionally along with a pretty decent mathematics background but I've never made a 3D game before. Do you guys think making a custom engine for a game I've been planning to make, which is ambitious mathematically but not graphically, is a better option than using something like Unity?
hey, I want to learn graphics programming and I plan to give opengl and vulkan a try. besides game engines, one application that i would really like to create is a drawing/animation program, but it's been really hard trying to find learning resources to learn from like how the canvas is represented how are vectors rendered stuff like that, i guess people just aren't into it but i'd like to do it.
that's an awesome idea, definitely possible. Whether you choose to start with opengl or vulkan you'll need to cover the basics first anyway. The 3D specific stuff like projection matrices may not be particularly relevant, but I'd say a good chunk of what you'd be learning would apply to a drawing/animation program. And having a particular project in mind in my opinion is the best way to learn opengl/vulkan. That way as you cover each topic you can think of how it would apply to an animation program. I'd need to do some research on specifics though, as I've never done something like that before and I don't want to steer you in the wrong direction.
@@BrendanGalea alright thank you for the response, I'll follow your tutorial and transfer whatever knowledge I can for the project. In regards to the game engine, I'd like to one day be able to create something with a renderer that can produce results that you would find in the witness with the work needed by one person of course.
I also have the same idea, to create a canvas-like api that draws using the GPU (for obvious performance reasons), like the javascript canvas API. I've searched across the internet on how to create simple 2D shapes, lines, circles, e etc using OpenGL 3/4, but there aren't that many resources available, only for legacy versions of OpenGL, which is not what i looking for
@@BrendanGalea It's perhaps an overreaction, but when I see "forked from" on GitHub I get a little paranoid about the possibility of spyware being added to a project. I've looked as far back in the logs as I care to, and it seems like the author was just maintaining the project between two repositories, one in his personal archives and one as part of a group of projects. I think the project was actually forked well over a decade ago, but he finally decided in 2020 to quit maintaining two copies. So it's really more weird than anything else, but when I couldn't find an explanation upfront it kind of worried me.
I've heard the statement: "It is not worth switching from c to assembler code if you want to optimize the code. The compiler does a better job than you will be able to." Why does that not apply when you switch to vulkan?
This is such a great question! Sorry for the essay response…. I got carried away. Tl;dr To make an engine flexible and general can result in unnecessary levels of abstraction for your specific use case. Games have been changing rapidly compared to ISA’s, and it’s harder to optimize a moving target Compilers have a better “understanding” of the programmers intention because languages are a more formal/rigid structure. Probably a lot more I’m just not thinking of as well. In Game Engine Architecture by Jason Gregory he describes game engines on a spectrum of reusability. Some engines are made specifically to create one game, such as pacman. Other engines can be customized to make very similar games. And then you get to more general engines that can be used to build any in a specific genre, and beyond that it would then have things like Unity, Unreal engine etc. But even then, it's probably impossible to design an engine flexible enough to build any game possible. My take on how this applies to your question, is that to make an engine more flexible typically this relies on creating levels of abstractions that may be unnecessary for your specific use case, which will affect the programs performance. Engine designers will try to optimize for the type of work they think game programmers will need. But especially for indie games, one way to stand out is by creating unique mechanics that to get working in an existing engine may require using features in unintended and less than optimal ways. Secondly, it's harder to optimize for a moving target. Game design has evolved immensely over the past few decades, while programming languages have to a lesser degree. And even as programming languages change and are created, the instruction set they are targeting has been well established. So actually one case where you would have seen human written assembly code outperform a compiler in some spots was for game consoles with unique instruction sets and hardware that did not yet have fully optimized compilers. However this is less relevant to today’s consoles. A compiler is able to get a much better understanding of what it is trying to optimize. Programming languages are very formal, and in the process of compiling code a variety of data structures are created encapsulating the meaning of the code, which makes it possible to perform analysis identifying optimizations in a formulaic way that would be very tedious for a human. Finally this can be seen experimentally as well with even simple examples by creating a game using an engine, and comparing it to the performance of vulkan. I just want to also mention I’m not saying that using vulkan is better than using an engine, especially as soon as you start to factor programmer's time into the equation. If as a solo programmer you can get a project done 10 times faster when using an engine, isn’t that a lot more important than potentially better performance?
@@BrendanGalea Thank you, I enjoyed that answer. I had a vague answer already when I asked this question. It went into the direction of engines having unused code. But your response made things more clear.
Hello Brendan this tutorial series on computer graphics and vulkan is definitely great I really appreciate it. Thank you so much. Actually I am new to computer graphics and I want to know your opinion. I do know just a little bit about OpenGL but I feel it is better to start with Vulkan, what is your opinion? I also am a Java developer and feel much better with Java so I decided to use LWJGL 3 and its Vulkan binding for Java. What do you think about game engine development in Java?
It really depends on your situation, and there are pros and cons. Personally I prefer vulkan. I like that it is very explicit. While this means it's often necessary to write more code, and getting started is a bit slower, you have more control over what can be done and none of the details of what's happening behind the scenes is hidden away from you. It's also cross platform, supports newer features such as ray tracing, makes multithreading a render engine more straightforward, etc. The disadvantages of vulkan are that 1. it's slower to learn when first getting started 2. it's a bit more difficult 3. less edcuational content exists for it 4. If you don't create good abstractions yourself things can get pretty messy There's probably other things I'm not thinking of. One potential issue I see is I think its at tutorial 2 and 3 I provide two code files to make getting started with vulkan a bit quicker. But I didn't consider back then that this would make following the series difficult for people using another language... So unless you're pretty familiar with c++ the series might be hard to follow. I've been meaning to convert these files into multiple languages but haven't had the chance. The two files are based off of vulkan-tutorial.com and there exists a java port of that, which you can find here - github.com/Naitsirc98/Vulkan-Tutorial-Java . That would be a helpful resource to use as a comparison if you want to give my series a shot! If you're looking for an excellent openGL java + LWJGL tutorial series definitely check out the youtube videos by ThinMatrix, they are truly superb!
Hey Brendan! First and foremost thanks for the effort put in creating this series! Before I start this new adventure, would you say that the tutorial is still valid after 2 years from publication? Thanks!
Yup still relevant! I guess that’s the one advantage of low level graphics tutorials is that the apis change very slowly, and the theory is relevant no matter which graphics api you are using. I recommend always checking the description or the pinned comment if something isn’t working as you expect. For the first half of the series there are some bugs I missed in testing that appear on windows OS (I only was testing mac and Linux on like the first 15 tutorials) Also just ad a heads up, in tutorial 3 and 4 I gloss over device set up and swap chain. I know that bothered some people (it would have bothered me as well). But It’s really information you don’t need when first starting out and I provide some resources that cover the topics. But feel like I should mention that in case it’s a deal breaker I plan on continuing the series in the next couple months since in terms of TH-cam unfortunately this really seems to be the only in depth vulkan series and nobody else in the past year has started there own. Best of luck! Also on the latest tutorial videos there should be a discord link which is a good place to ask for help. I’m not there too frequently but the community has been really amazing in offering support
Hello, I am stuck in the first part, I have vulkan sdk, glm, and glsw. My issue is actually setting up the project to compile and to look for the includes, I am still relatively new to c++ but still want to follow along and understand this because doing challenging things is the only way to learn and grow. I am used to Visual Studio 2022 and would appreciate if someone could explain how to set up the project so I may follow along.
Ok, so after a lot of banging my head on the wall. I was able to find that VS Code needs things like mingw or msvc to compile because that is not a part of the regular install. I also learned that I need Cmake to make my exe. I then have to modify the .env to have a reference to the GLM and GLFW Libraries. I then also have to include the GLM and GLFW in the includePath of settings.json. I now see that this isn't for the feint of heart.
Hmm I personally like learncpp.com a lot but it might be tricky to follow if you haven’t done C before or some other language with manual memory management. C++ is definitely one of the harder languages to learn, so just keep that in mind.
I use another laptop to practice Vulkan but the required extension VK_KHR_surface VK_KHR_win32_surface Is not loaded. How to solve this issue? I am using Radeon R5 GPU.
So from my understanding VK_KHR_surface is not showing up in the list of available extensions? You may just need to update your graphics drivers, that would be the first thing I'd try. In the vulkanSDK directory you installed there should be a subfolder with an application called vulkaninfo. If you run that you should get a terminal opening outputting all your device info. In the section... Instance Extensions: count = 12 =============================== ... VK_KHR_surface you should have the VK_KHR_surface extension present.
@@BrendanGalea actually it shows up in the extension but i am confused why the screen dissapears after showing white screen. I could not see the error. I used your source code. It's very confusing
I will try this week to see if I am able to somehow get a triangle on screen in a week or something like that. Do you think I should first learn OpenGL or it's ok to start with Vulkan?
@@BrendanGalea Let's assume that I want to follow your tutorial to create something nice in vulkan. How long should I let this project rest until I come back? Half a year?
Ya 6 months sounds about right. I think by then I should have covered all the material that should be known universally regardless of what your project entails and will have established a good foundation to continue to learn from. Past that point the tutorials will probably start to cover more specific topics that may or may not apply to all projects. But also I can’t say for sure. You can always check in occasionally to see if the results of the tutorial series fall in line with what you want to do.
@@BrendanGalea You fall under the category of TH-cam channels which I have subscribed and I don't expect too much content. But whatever content there is I will watch. At least the interesting part. Chances are pretty good that I will always at least look at the title to see if the topic is interesting.
You should really do the setup steps. Lots of people are stuck on the GLFW library from my Google search, because they didn't download the "pre-compiled" GLFW.
Starting from opengl to directX, and finally Vulkan. Is that a good idea? Cannot we do similar rendering with unity 3d or unreal engine 4 with less effort? I am just asking because I have no clear idea.
That could work. It all depends on what you want to learn and the types of projects you want to make. If you enjoy understanding how computer graphics and gpus work and want to make a game engine then starting with opengl or vulkan is a good idea. I haven't worked with DirectX but it probably is just as good for getting started. And yes, similar rendering with engines such unity or unreal is definitely possible and will be for much less effort. With Vulkan you aren't limited by anything, but you have to do everything. So there are pros and cons for both. Once I'm farther in the series I might make a vulkan vs unity comparison video going over each ones advantages and disadvantages.
Hello, Im really liking the content but I'm wondering as another mac user on how you made vulkan work on mac. I'm seeing from various websites that apple hasn't implemented it. So does vulkan work with full compatibility on mac or am I better of on a virtual machine with an os like linux/windows so I can use it's full capabilities?
Also how come you are able to use vscode, the link you've sent shows an xcode setup and I would prefer vscode. Could you please list the steps I need to take to get the vscode setup?
Is there anyway to learn Vulkan without a hardware that doesn't support Vulkan ? I'm using my laptop's Intel HD integrated GPU and currently it doesnt support vulkan ! I can read the docs and follow your vids but without practise its like writing to water.
Hmmm ya that would make things much more difficult. It might be possible to run your tests on a mobile device, but I haven’t actually tried that yet with vulkan and there’s definitely some changes to the project that would be required. (Such as the windowing system) It might be better to start with OpenGL in your situation. Quite a bit of knowledge will eventually transfer to vulkan once you have a computer that you can use.
Sorry I'm not exactly sure what you mean. But an engine isn't something that is ever really finished. It depends on what features you want to have and is something you can continually work on.
I don’t know rust so trying to create a tutorial series using it just didn’t seem like a good idea. I already make enough mistakes in c++! But from the little I know of the language it seems like a great option. There’s also a channel dedicated to rust in the discord and I know some others have followed the series using it. Just a heads up though, there are a few times in the series that I provide code to copy in. Mainly tutorials 3 and 4 (regret doing this in hindsight). So you’d have to port the code or I think some others have provided there versions on the discord. discord.gg/FnTt74vR
Seems like a great tutorial, but getting this set up is a challenge. Using exactly the same process on MacOS I get the error: "Library not loaded: @rpath/libvulkan.1.dylib" when I try to run the a.out file. Anyone else able to find a workaround for this?
Absolutely! On the vulkan-tutorial website I believe there is a guide for rust and Java as well. Really you could use almost any language you want, you’d just need to create bindings from the language to the c function calls. But for many languages someone probably has already done that too. Of course some languages are better suited to the needs of game engines then others though
I'm not sure what you mean by failed. Are you saying my planned pacing of the topics to be covered is too ambitious? Or do you mean that others video series ended prematurely and that is likely in this case as well? I appreciate the feedback, and thank you for taking the moment to comment.
@@BrendanGalea To be honest (and this is not an indictment of you personally), many have said "lets make a game engine" for years and wasted the time of people who are seriously trying to learn. Many bit off more than they can physically chew, while the very few trusted who have proven they have the discipline to go beyond a simple triangle have disappeared (most likely for life reasons). Im assuming you are going to use the vulkan example on the internet. That's not going to help. It would be more helpful if you look at RC-Engine as your base and create your own implementation tutorial (without the physics and animation). th-cam.com/video/u8YhH-_oORs/w-d-xo.html github project: github.com/Ruscris2/RC-Engine How things are broken down to be usable is the biggest problem with creating a "game engine" so that it can be used in a game or writing ones own editor. Hopefully this helps.
Ya that's a fair point. All I can really say is I have no intention to waste peoples time and am putting in my best effort, but only time will tell if I have the discipline to keep going and capability to create a useful learning resource. Of course I can't promise I'll be making these forever, but I've come in with the mindset of committing the next 6 months to a year of my spare time working on these videos. The start of the video series will somewhat follow the vulkan example, but will start to diverge pretty early on. My goal with this is that it can be used as a standalone resource appropriate for newcomers, but also work as a next step for someone whose completed the vulkan tutorial and wants to continue learning. I'll definitely take a close look into RC-Engine, that seems like it could be really helpful. But my main focus is on presenting computer graphics theory and the vulkan api in the clearest way for someone to learn, rather than building a super optimized game engine. Anyway sorry for the long message, but your feedback has definitely helped and got me thinking. I hadn't really considered how I could potentially waste peoples time, and will keep that in mind as I go forward.
Ya my bad. You can pretty much follow the Linux instructions on a mac instead if that’s what you prefer and then use vscode. It wasn’t feasible for me to create a guide going over the many different combinations to set up a dev environment and since the series already assumes significant c++ experience I made the assumption that most people would already have their own preferred environment for c++ dev (this might have been a foolish assumption of mine in hindsight) If I was to start over I now think I would’ve started with covering a cross platform build system using my preference (vscode and cmake) and let people who wanted to do their own thing figure it out themselves.
@@BrendanGalea sorry for the aggressiveness in my previous comment, i just have extremely bad luck with setting up a code environment... been 8 hours and havent managed to make vscode debug the code. it runs fine, but apparently m1 chips are not supported... trying some work-arounds but i have no idea how launch.json and task.json work... supposedly, codelldb extension should be compatible with arm64, but so far no luck
@@BrendanGalea and if you're wondering why i'm not using xcode, it's because last year i was following the vulkan-tutorial and there was some issues with validation layers that i also couldnt fix... i could do it fine on my windows machine, but i wanted do this project on the road and not at my desk...
Hi Brendan, There simply isn't any good tutorial in Vulkan. Please keep the series going. Let me know if you have a patreon account. I would happlly subscribe!
Thank you! But I do not have a patreon, maybe at some point in the future after I have more of the series completed I'll consider creating one. But for now the best way to support the channel is just by watching and liking the videos, and I really appreciate it.
My main goal is to ditch unity and not need to bend over the wills of shitty 3D game engine alternatives that work in very different and unintuitive ways. I have some computer graphics experience in software so the learnign curve for this is likely harder but far more exiting than learning a worst engine just because unity ceo is... well... Him...
I'm not a game dev but the Unity drama definitely motivates me to learn stuff like this, and it seems like a ton of fun to just hack away at lower level stuff :)
Mate, I did just that a while back. I went even further by coding an entire software rasterizer purely in software, without using OpenGL or any third-party graphics library, aside from window handling. It was a ton of fun learning about matrix projection, line-drawing algorithms, triangle filling, as well as lighting and back-face culling. Let me tell you, the foundation of computer graphics boils down to a simple concept: dividing the x and y coordinates by the z-depth coordinate, and then multiplying by the screen height. For instance, if your cube is 5 units away, and you divide a 1x1 cube by 5 units, you'll get a 0.2-sized cube, which is tiny and won't fit a pixel. To address this, you scale it by the height, let's say 600 pixels. This makes it a fifth of the screen's size. Now, the farther away parts are smaller than the closer ones, just like in projection. You can tweak this to your liking by adding rotations with trigonometric functions like sine and cosine, or using the unit circle if you prefer. You can incorporate field of view (FOV), set a distance limit in depth, rotate the world around the camera instead of the camera itself for easier division by z. Don't forget to add 0.1 to z so it doesn't divide by zero. And remember to offset the pixel coordinates by half the screen so that the center of scaling and projection occurs at the middle of the screen. Otherwise, a quarter of your object will be on the screen, while the rest is off on the top right. check out 3D sage's description of this very concept in his explaining 3D graphics video: th-cam.com/video/CcNCgmVJiBY/w-d-xo.html I recommend javidx9 (theOneLoneCoder) mini course on computer graphics as well, he goes much more in depth on matrix projection. Link to part 1: th-cam.com/video/ih20l3pJoeU/w-d-xo.html @@mushroomcrepes
please dont stop this series.
You were right i'm right now in 2023 sending this
if you stop you are gay
IM SUBBING ASAP, Man I've looked so far, finally found a Vulkan tutorial
This series is what this planet needs. Subscribed!
This is the exact thing I was looking for, for almost a year, to get into this stuff. You're a legend for doing this mate! Subed.
Just wanted to say that I've been watching your videos while reading other vulkan resources, the api docs, and a couple other "what not to do" type of excerpts and I am very appreciative of stumbling onto your series. My end goal is to make a small and specific engine over the next few years and hopefully release my first game by the time I hit 40 (currently 27). So this series coupled with other resources are a HUGE help in getting started with vulkan and again - thank you for these videos 😃
Thats great to hear, Thanks!
completely realistic expectations, well said bro
i spent hours trying to find a series like this, thank you :)
Dude, your content is GOATed when it comes to those of us trying to learn Vulkan/Kompute.
Thanks! Glad you like it
Brendan Galea you are a hero. Thank you so much for this series. I am so excited to learn Vulkan!
Just started watching the series today! Thank you for the quality content!
Thank you, this seems like the perfect series to start following! After taking a paper on computer graphics during my university days I've developed a real interest in this side of video games.
This might just be what I need to start exploring it again!
Best of luck!
Thanks for the series! I’m beginner-intermediate with OpenGL. Build myself 2 frameworks with it. Now I’m transitioning to Vulkan and your series will surely come in handy. All the best!
I wish you the best of luck with your transitioning!
@@hcolider2817 thank you very much!
nice tutorial! i've been searching one like this for so long!
The best tutorials I've seen thus far please keep up the great work!
Wow, thanks!
the series just started bro stop the dickriding
Thank you very much for these videos buddy, I have a big project in mind and I need to develop my own graphics engine, and I choose Vulkan as a tool. I hope you keep posting videos
Subscribed, thumbs-up button hitted and popcorn while I've watching this awesome videos.
Awesome, thank you! Next video is on its way.
Grate, I was looking for tutorial exactly like this for a long time, thank you!
You seem very knowledgeable and a great teacher, going straight to the point, i will watch every video, thank you for this :)
@BerdanGalea Thanks for the great Vulkan course!
I hope will see the next videos about textures, terrain, render-graph and etc.
Think about this please-please-please
Great...Easter holidays just started for me ... on mac book pro. I'm swapping from sfml (recently started) to vulkan. More interested in playing with graphics and effects than making actual games. Many thanks and I'm sticking with you, just subscribed. I'm a patient chap know it'll not be easy.
You're on a mac using vscode. Wow, that's great! Can you make a tutorial that gets us there? Right now I'm using Xcode and am pretty unahppy. Thank you!
"Mentions Godot over UE4 :^)" I like you.
this seems exactly like what i need. thank you!
Wow, can’t believe I’m stumbling on this after almost quitting! This looks amazing, and it’s refreshing to see a tutorial use macOS!
you... are.. the shit bro, str8 up. This is simply amazing, ty for making these videos. You should follow it up with a part two of an engine creation but instead of vulkan using glfw for 3d graphics in a window, you should do it for OpenXR technologies, focusing on either PCVR or better, the Android / C++ native implementation of OpenXR for the meta quest 3. I am learning a lot from you, as opposed to the numerous books I could not quite grasp fully until I found your videos.. not even in the university I attend have I learned as much as I have in the past 20 summin videos of yours I binged in 4 days.. so far
thanks
thank you for making these videos
just what i want just when i want!
OpenGL is said to be easier than vulkan. Should i learn openGL first before i jump on to this series?
This is tricky to answer and really depends on the person and their goals. But here's some general info that may help when making the decision on what to learn first.
Do you have a deadline?
OpenGL is definitely easier to learn in my opinion and quicker to get started with. If you want to learn a graphics api to use for a school or personal project with an upcoming deadline, I'd recommend OpenGL. That way you can spend most of your time on your project specifics, rather than learning the API.
What API will get me a job?
As of January 2021, this is still in OpenGLs favour. From some quick searching, there seems to be a 2:1 relationship between jobs hiring for opengl vs vulkan (within Canada). However, things are shifting towards vulkan. OpenGL is not going to disappear, but I think for someone getting started now it makes more sense to learn Vulkan. Demand for vulkan will increase, and fewer programmers know vulkan compared to openGL, so less supply.
I want to learn vulkan, do I need to learn openGL first?
If your goal is to learn vulkan then start with vulkan. While it does help, OpenGL is not a pre-requisite for learning vulkan. Perhaps a year or two ago, I'd have given a different answer to this, since Vulkan wasn't as established yet. But learning openGL or some other graphics API first I'd say is no longer necessary.
How comfortable are you with reading code?
Programming is funny when compared to spoken languages. Typically you need to read before you can write, but most programmers are better at writing code than reading it. OpenGL tutorials are significantly better than the existing Vulkan tutorials right now; there's more of them, and of higher quality.
For many of the more intermediate to advance vulkan topics, I've found the only way to learn right now is by reading the documentation and reading coding examples. This will change over the next couple years as more vulkan tutorials are made, but for now OpenGL has much better educational content for it which is a strong point in it's favour.
So I hope this helped and didn't cause more confusion. My goal is that in 6 months time I'll have ~20 more videos released and can definitively say learn vulkan first and watch this tutorial series. However right now, depending on your situation OpenGL could be the better option.
Keep in mind that I likely have a bias towards vulkan though no matter how hard I've tried to give an unbiased answer. I am creating a vulkan tutorial series after all and have spent quite a bit of time over the past year learning vulkan, so of course it would be what I recommend :)
@@BrendanGalea Well Vulkan is maybe harder than OpenGL but OpenGL has an terrible Texture Quality.
@@xE92vD ? It does? I’ve used OpenGL a bit and I’ve never seen any issues with OpenGL textures.
I'd like to add to this that you can still use opengl tutorials to help when you're programming in vulkan. They're not completely different and all the graphics techniques still apply. A tutorial like paroj's or learnopengl cover many subjects that are useful no matter the API.
i used sdl2 in my game engine (which was a mistake) which is why im here!
subscribed! keep up the good work.
Hey, Thank you, You helped me great my own Engine :D.
This is some really cool stuff!
Subbed and Liked, please keep up the good work!
Damn I really wish this series would be continued
Love your stuff so far
Quick question,
When we get to the gameplay system, will you be using ECS ? Just wanted to know
thanks! and yes, not settled on an actually implementation yet but will have a tutorial or 2 covering this topic. We'll make something from scratch, but I will also mention some existing librairies that could be used instead
@@BrendanGalea one robust library for ecs is entt
good job man
❤️
Want to learn Vulkan to make a game engine that can do minecraft like voxel generation. I keep seeing massive performance videos from people coding in both vulken and OpenGL and they tend to be around x4 more performent for even larger items then there OpenGL counter parts.
Lets go!
it worked! thank you so much!!
Hey, after watching the entier series I will recommend any newbie who doesnt have any knowledge of opengl to first go and read the khronos tutorials on vulkan and then come over here :)
Yooo head to a great start! Im lovin the tutorial, thank you for spreading knowledge
*subs,likes,hit bell* :D
Thank you!!!
why did you stop this tutorial serie : (
Work unfortunately got to busy. I’m hoping to start it up again. Been doing a bit of work in the engine when I have time. Trying to get a few intermediate features completed and added then I’ll push a branch to the GitHub and then go back and start creating tutorials for each part. But still will probably be a few more months, but really can’t make any promises… sorry 😞
@BrendanGalea no worries at least you're still active ;) keep up the good work ! And take you're time !
i was wondering if you could show how you setup the development area, since i was planning on using visual studio code, but havent found a way to set it up properly to follow this tutorial.
What platform are you using? I’m thinking of doing at least like a write up in setting things up. Or a quick video. You could also take a look at the cmake tutorial I just did, that shows how to use vscode on any platform. But it might be confusing to follow when first getting started
Same here I would love to see how to set it up for windows. I will watch your tutorial for cmake right now and hopefully that will explain everything.
awesome!
3:00 why dont you show how to setup vulkan with CMake in VSCode?
I do switch to cmake but it’s not until a later tutorial
Not a great start ... i've tried to follow all the steps, using xcode 12.4. I'm getting a vulcan/vulcan.h file not found in glfw3.h. In the header paths in xcode I needed to add the 2 paths next to each other, so like below.
/usr/local/include Vulcan/macOS/include
I've tried separating these by , instead of just a blank space and also ; but doesn't seem to work?
would appreciate any help please?
Sorry, sorted ... wasn't using full path address!!!!!!
I know C++ professionally along with a pretty decent mathematics background but I've never made a 3D game before. Do you guys think making a custom engine for a game I've been planning to make, which is ambitious mathematically but not graphically, is a better option than using something like Unity?
hey, I want to learn graphics programming and I plan to give opengl and vulkan a try. besides game engines, one application that i would really like to create is a drawing/animation program, but it's been really hard trying to find learning resources to learn from like how the canvas is represented how are vectors rendered stuff like that, i guess people just aren't into it but i'd like to do it.
that's an awesome idea, definitely possible. Whether you choose to start with opengl or vulkan you'll need to cover the basics first anyway. The 3D specific stuff like projection matrices may not be particularly relevant, but I'd say a good chunk of what you'd be learning would apply to a drawing/animation program. And having a particular project in mind in my opinion is the best way to learn opengl/vulkan. That way as you cover each topic you can think of how it would apply to an animation program.
I'd need to do some research on specifics though, as I've never done something like that before and I don't want to steer you in the wrong direction.
@@BrendanGalea alright thank you for the response, I'll follow your tutorial and transfer whatever knowledge I can for the project. In regards to the game engine, I'd like to one day be able to create something with a renderer that can produce results that you would find in the witness with the work needed by one person of course.
I also have the same idea, to create a canvas-like api that draws using the GPU (for obvious performance reasons), like the javascript canvas API. I've searched across the internet on how to create simple 2D shapes, lines, circles, e etc using OpenGL 3/4, but there aren't that many resources available, only for legacy versions of OpenGL, which is not what i looking for
I can't seem to find an answer anywhere, so I'll ask here, but do you have any idea why GLM was forked and the original project just archived?
News to me. I’ll have to look into it!
@@BrendanGalea It's perhaps an overreaction, but when I see "forked from" on GitHub I get a little paranoid about the possibility of spyware being added to a project. I've looked as far back in the logs as I care to, and it seems like the author was just maintaining the project between two repositories, one in his personal archives and one as part of a group of projects. I think the project was actually forked well over a decade ago, but he finally decided in 2020 to quit maintaining two copies. So it's really more weird than anything else, but when I couldn't find an explanation upfront it kind of worried me.
I've heard the statement: "It is not worth switching from c to assembler code if you want to optimize the code. The compiler does a better job than you will be able to." Why does that not apply when you switch to vulkan?
This is such a great question! Sorry for the essay response…. I got carried away.
Tl;dr
To make an engine flexible and general can result in unnecessary levels of abstraction for your specific use case.
Games have been changing rapidly compared to ISA’s, and it’s harder to optimize a moving target
Compilers have a better “understanding” of the programmers intention because languages are a more formal/rigid structure.
Probably a lot more I’m just not thinking of as well.
In Game Engine Architecture by Jason Gregory he describes game engines on a spectrum of reusability. Some engines are made specifically to create one game, such as pacman. Other engines can be customized to make very similar games. And then you get to more general engines that can be used to build any in a specific genre, and beyond that it would then have things like Unity, Unreal engine etc. But even then, it's probably impossible to design an engine flexible enough to build any game possible.
My take on how this applies to your question, is that to make an engine more flexible typically this relies on creating levels of abstractions that may be unnecessary for your specific use case, which will affect the programs performance.
Engine designers will try to optimize for the type of work they think game programmers will need. But especially for indie games, one way to stand out is by creating unique mechanics that to get working in an existing engine may require using features in unintended and less than optimal ways.
Secondly, it's harder to optimize for a moving target. Game design has evolved immensely over the past few decades, while programming languages have to a lesser degree. And even as programming languages change and are created, the instruction set they are targeting has been well established. So actually one case where you would have seen human written assembly code outperform a compiler in some spots was for game consoles with unique instruction sets and hardware that did not yet have fully optimized compilers. However this is less relevant to today’s consoles.
A compiler is able to get a much better understanding of what it is trying to optimize. Programming languages are very formal, and in the process of compiling code a variety of data structures are created encapsulating the meaning of the code, which makes it possible to perform analysis identifying optimizations in a formulaic way that would be very tedious for a human.
Finally this can be seen experimentally as well with even simple examples by creating a game using an engine, and comparing it to the performance of vulkan.
I just want to also mention I’m not saying that using vulkan is better than using an engine, especially as soon as you start to factor programmer's time into the equation. If as a solo programmer you can get a project done 10 times faster when using an engine, isn’t that a lot more important than potentially better performance?
@@BrendanGalea Thank you, I enjoyed that answer. I had a vague answer already when I asked this question. It went into the direction of engines having unused code. But your response made things more clear.
Hello Brendan this tutorial series on computer graphics and vulkan is definitely great I really appreciate it. Thank you so much.
Actually I am new to computer graphics and I want to know your opinion. I do know just a little bit about OpenGL but I feel it is better to start with Vulkan, what is your opinion? I also am a Java developer and feel much better with Java so I decided to use LWJGL 3 and its Vulkan binding for Java. What do you think about game engine development in Java?
It really depends on your situation, and there are pros and cons.
Personally I prefer vulkan. I like that it is very explicit. While this means it's often necessary to write more code, and getting started is a bit slower, you have more control over what can be done and none of the details of what's happening behind the scenes is hidden away from you. It's also cross platform, supports newer features such as ray tracing, makes multithreading a render engine more straightforward, etc.
The disadvantages of vulkan are that
1. it's slower to learn when first getting started
2. it's a bit more difficult
3. less edcuational content exists for it
4. If you don't create good abstractions yourself things can get pretty messy
There's probably other things I'm not thinking of. One potential issue I see is I think its at tutorial 2 and 3 I provide two code files to make getting started with vulkan a bit quicker. But I didn't consider back then that this would make following the series difficult for people using another language...
So unless you're pretty familiar with c++ the series might be hard to follow. I've been meaning to convert these files into multiple languages but haven't had the chance. The two files are based off of vulkan-tutorial.com and there exists a java port of that, which you can find here - github.com/Naitsirc98/Vulkan-Tutorial-Java . That would be a helpful resource to use as a comparison if you want to give my series a shot!
If you're looking for an excellent openGL java + LWJGL tutorial series definitely check out the youtube videos by ThinMatrix, they are truly superb!
Hey Brendan! First and foremost thanks for the effort put in creating this series! Before I start this new adventure, would you say that the tutorial is still valid after 2 years from publication? Thanks!
Yup still relevant! I guess that’s the one advantage of low level graphics tutorials is that the apis change very slowly, and the theory is relevant no matter which graphics api you are using.
I recommend always checking the description or the pinned comment if something isn’t working as you expect. For the first half of the series there are some bugs I missed in testing that appear on windows OS (I only was testing mac and Linux on like the first 15 tutorials)
Also just ad a heads up, in tutorial 3 and 4 I gloss over device set up and swap chain. I know that bothered some people (it would have bothered me as well). But It’s really information you don’t need when first starting out and I provide some resources that cover the topics. But feel like I should mention that in case it’s a deal breaker
I plan on continuing the series in the next couple months since in terms of TH-cam unfortunately this really seems to be the only in depth vulkan series and nobody else in the past year has started there own.
Best of luck! Also on the latest tutorial videos there should be a discord link which is a good place to ask for help. I’m not there too frequently but the community has been really amazing in offering support
Hello, I am stuck in the first part, I have vulkan sdk, glm, and glsw. My issue is actually setting up the project to compile and to look for the includes, I am still relatively new to c++ but still want to follow along and understand this because doing challenging things is the only way to learn and grow. I am used to Visual Studio 2022 and would appreciate if someone could explain how to set up the project so I may follow along.
Ok, so after a lot of banging my head on the wall. I was able to find that VS Code needs things like mingw or msvc to compile because that is not a part of the regular install. I also learned that I need Cmake to make my exe. I then have to modify the .env to have a reference to the GLM and GLFW Libraries. I then also have to include the GLM and GLFW in the includePath of settings.json. I now see that this isn't for the feint of heart.
Hi Brendan, I am wondering how do u set up your Mac and vscode with Vulkan and GLFW. Do you mind giving some advice/guides?
Hello, thanks for the tutorials, do you know where can i start learning c++ for game developement?
Good question, what’s your previous programming experience?
@@BrendanGalea I usually work with C#
Hmm I personally like learncpp.com a lot but it might be tricky to follow if you haven’t done C before or some other language with manual memory management.
C++ is definitely one of the harder languages to learn, so just keep that in mind.
nice bro, ty
I use another laptop to practice Vulkan but the required extension
VK_KHR_surface
VK_KHR_win32_surface
Is not loaded. How to solve this issue? I am using Radeon R5 GPU.
So from my understanding VK_KHR_surface is not showing up in the list of available extensions? You may just need to update your graphics drivers, that would be the first thing I'd try.
In the vulkanSDK directory you installed there should be a subfolder with an application called vulkaninfo. If you run that you should get a terminal opening outputting all your device info.
In the section...
Instance Extensions: count = 12
===============================
...
VK_KHR_surface
you should have the VK_KHR_surface extension present.
@@BrendanGalea actually it shows up in the extension but i am confused why the screen dissapears after showing white screen. I could not see the error. I used your source code. It's very confusing
I will try this week to see if I am able to somehow get a triangle on screen in a week or something like that.
Do you think I should first learn OpenGL or it's ok to start with Vulkan?
nice dude
Will this series also include text rendering?
Yes I want to cover that at some point in the future. But it probably won't be for awhile, like tutorial 25+ or something.
@@BrendanGalea Let's assume that I want to follow your tutorial to create something nice in vulkan. How long should I let this project rest until I come back? Half a year?
Ya 6 months sounds about right. I think by then I should have covered all the material that should be known universally regardless of what your project entails and will have established a good foundation to continue to learn from.
Past that point the tutorials will probably start to cover more specific topics that may or may not apply to all projects.
But also I can’t say for sure. You can always check in occasionally to see if the results of the tutorial series fall in line with what you want to do.
@@BrendanGalea You fall under the category of TH-cam channels which I have subscribed and I don't expect too much content. But whatever content there is I will watch. At least the interesting part.
Chances are pretty good that I will always at least look at the title to see if the topic is interesting.
can someone explain why, in the first_app.hpp the function called has its parameters inside {} instead of () please
You should really do the setup steps. Lots of people are stuck on the GLFW library from my Google search, because they didn't download the "pre-compiled" GLFW.
Starting from opengl to directX, and finally Vulkan. Is that a good idea? Cannot we do similar rendering with unity 3d or unreal engine 4 with less effort? I am just asking because I have no clear idea.
That could work. It all depends on what you want to learn and the types of projects you want to make. If you enjoy understanding how computer graphics and gpus work and want to make a game engine then starting with opengl or vulkan is a good idea. I haven't worked with DirectX but it probably is just as good for getting started.
And yes, similar rendering with engines such unity or unreal is definitely possible and will be for much less effort. With Vulkan you aren't limited by anything, but you have to do everything. So there are pros and cons for both. Once I'm farther in the series I might make a vulkan vs unity comparison video going over each ones advantages and disadvantages.
You should make the include and lib paths relative in the tutorial... Won't really work if someone has different Vulkan SDK version.
Hello, Im really liking the content but I'm wondering as another mac user on how you made vulkan work on mac. I'm seeing from various websites that apple hasn't implemented it. So does vulkan work with full compatibility on mac or am I better of on a virtual machine with an os like linux/windows so I can use it's full capabilities?
Also how come you are able to use vscode, the link you've sent shows an xcode setup and I would prefer vscode. Could you please list the steps I need to take to get the vscode setup?
Is there anyway to learn Vulkan without a hardware that doesn't support Vulkan ?
I'm using my laptop's Intel HD integrated GPU and currently it doesnt support vulkan !
I can read the docs and follow your vids but without practise its like writing to water.
Hmmm ya that would make things much more difficult. It might be possible to run your tests on a mobile device, but I haven’t actually tried that yet with vulkan and there’s definitely some changes to the project that would be required. (Such as the windowing system)
It might be better to start with OpenGL in your situation. Quite a bit of knowledge will eventually transfer to vulkan once you have a computer that you can use.
How much time will take to make a Vulkan engine from scratch?
Sorry I'm not exactly sure what you mean. But an engine isn't something that is ever really finished. It depends on what features you want to have and is something you can continually work on.
why not with rust
I don’t know rust so trying to create a tutorial series using it just didn’t seem like a good idea. I already make enough mistakes in c++!
But from the little I know of the language it seems like a great option. There’s also a channel dedicated to rust in the discord and I know some others have followed the series using it. Just a heads up though, there are a few times in the series that I provide code to copy in. Mainly tutorials 3 and 4 (regret doing this in hindsight). So you’d have to port the code or I think some others have provided there versions on the discord.
discord.gg/FnTt74vR
can you make a updated version of this using 1.4 please and very much thanks
Seems like a great tutorial, but getting this set up is a challenge. Using exactly the same process on MacOS I get the error: "Library not loaded: @rpath/libvulkan.1.dylib" when I try to run the a.out file.
Anyone else able to find a workaround for this?
Dios pero que joyita de curso acabo de encontrar
king
Is it possible to use Vulkan without C or C++ ?
Absolutely! On the vulkan-tutorial website I believe there is a guide for rust and Java as well. Really you could use almost any language you want, you’d just need to create bindings from the language to the c function calls. But for many languages someone probably has already done that too.
Of course some languages are better suited to the needs of game engines then others though
@@BrendanGalea Thank you very much ! I saw everywhere that using C and C++ were a given and I was considering just moving on to something else...
now just need to translate all of that in rust + vulkano o_o still seem good
i just set up a c++ project all by myself holy shit
80th sub
Thank you!
Im not going to downvote, but I do have to say for the first 34 seconds, many tried and failed/disappeared (and that was just OpenGL).
I'm not sure what you mean by failed. Are you saying my planned pacing of the topics to be covered is too ambitious? Or do you mean that others video series ended prematurely and that is likely in this case as well?
I appreciate the feedback, and thank you for taking the moment to comment.
@@BrendanGalea To be honest (and this is not an indictment of you personally), many have said "lets make a game engine" for years and wasted the time of people who are seriously trying to learn. Many bit off more than they can physically chew, while the very few trusted who have proven they have the discipline to go beyond a simple triangle have disappeared (most likely for life reasons).
Im assuming you are going to use the vulkan example on the internet. That's not going to help. It would be more helpful if you look at RC-Engine as your base and create your own implementation tutorial (without the physics and animation).
th-cam.com/video/u8YhH-_oORs/w-d-xo.html
github project:
github.com/Ruscris2/RC-Engine
How things are broken down to be usable is the biggest problem with creating a "game engine" so that it can be used in a game or writing ones own editor. Hopefully this helps.
Ya that's a fair point. All I can really say is I have no intention to waste peoples time and am putting in my best effort, but only time will tell if I have the discipline to keep going and capability to create a useful learning resource. Of course I can't promise I'll be making these forever, but I've come in with the mindset of committing the next 6 months to a year of my spare time working on these videos.
The start of the video series will somewhat follow the vulkan example, but will start to diverge pretty early on. My goal with this is that it can be used as a standalone resource appropriate for newcomers, but also work as a next step for someone whose completed the vulkan tutorial and wants to continue learning.
I'll definitely take a close look into RC-Engine, that seems like it could be really helpful. But my main focus is on presenting computer graphics theory and the vulkan api in the clearest way for someone to learn, rather than building a super optimized game engine.
Anyway sorry for the long message, but your feedback has definitely helped and got me thinking. I hadn't really considered how I could potentially waste peoples time, and will keep that in mind as I go forward.
Unfortunately, Windows isn't play well with Makefile. So I have no choice except change OS to Ubuntu. Anyway, thanks for the tutorial
You could try using visual studio or take a look at the cmake tutorial. That goes over creating a nicer cross platform coding environment
so you're using a mac with vscode, but the vulkan tutorial is with xcode, so i guess we already starting bad arent we...
Ya my bad. You can pretty much follow the Linux instructions on a mac instead if that’s what you prefer and then use vscode. It wasn’t feasible for me to create a guide going over the many different combinations to set up a dev environment and since the series already assumes significant c++ experience I made the assumption that most people would already have their own preferred environment for c++ dev (this might have been a foolish assumption of mine in hindsight)
If I was to start over I now think I would’ve started with covering a cross platform build system using my preference (vscode and cmake) and let people who wanted to do their own thing figure it out themselves.
@@BrendanGalea sorry for the aggressiveness in my previous comment, i just have extremely bad luck with setting up a code environment...
been 8 hours and havent managed to make vscode debug the code. it runs fine, but apparently m1 chips are not supported... trying some work-arounds but i have no idea how launch.json and task.json work... supposedly, codelldb extension should be compatible with arm64, but so far no luck
@@BrendanGalea and if you're wondering why i'm not using xcode, it's because last year i was following the vulkan-tutorial and there was some issues with validation layers that i also couldnt fix... i could do it fine on my windows machine, but i wanted do this project on the road and not at my desk...
Hi Brendan,
There simply isn't any good tutorial in Vulkan. Please keep the series going. Let me know if you have a patreon account. I would happlly subscribe!
Thank you! But I do not have a patreon, maybe at some point in the future after I have more of the series completed I'll consider creating one. But for now the best way to support the channel is just by watching and liking the videos, and I really appreciate it.
@@BrendanGalea I know this is an old comment, but +1 tot this: would love to support you on Patreon -- your tutorials are amazing!
I think ı found a gem
The full series of tutorial videos: th-cam.com/video/Y9U9IE0gVHA/w-d-xo.html .
I love you.
god bless u xdd
Lol i though you are using windows xp
My main goal is to ditch unity and not need to bend over the wills of shitty 3D game engine alternatives that work in very different and unintuitive ways. I have some computer graphics experience in software so the learnign curve for this is likely harder but far more exiting than learning a worst engine just because unity ceo is... well... Him...
I'm not a game dev but the Unity drama definitely motivates me to learn stuff like this, and it seems like a ton of fun to just hack away at lower level stuff :)
Mate, I did just that a while back. I went even further by coding an entire software rasterizer purely in software, without using OpenGL or any third-party graphics library, aside from window handling. It was a ton of fun learning about matrix projection, line-drawing algorithms, triangle filling, as well as lighting and back-face culling.
Let me tell you, the foundation of computer graphics boils down to a simple concept: dividing the x and y coordinates by the z-depth coordinate, and then multiplying by the screen height. For instance, if your cube is 5 units away, and you divide a 1x1 cube by 5 units, you'll get a 0.2-sized cube, which is tiny and won't fit a pixel. To address this, you scale it by the height, let's say 600 pixels. This makes it a fifth of the screen's size. Now, the farther away parts are smaller than the closer ones, just like in projection.
You can tweak this to your liking by adding rotations with trigonometric functions like sine and cosine, or using the unit circle if you prefer. You can incorporate field of view (FOV), set a distance limit in depth, rotate the world around the camera instead of the camera itself for easier division by z. Don't forget to add 0.1 to z so it doesn't divide by zero. And remember to offset the pixel coordinates by half the screen so that the center of scaling and projection occurs at the middle of the screen. Otherwise, a quarter of your object will be on the screen, while the rest is off on the top right.
check out 3D sage's description of this very
concept in his explaining 3D graphics video:
th-cam.com/video/CcNCgmVJiBY/w-d-xo.html
I recommend
javidx9 (theOneLoneCoder) mini course on computer graphics as well, he goes much more in depth on matrix projection.
Link to part 1: th-cam.com/video/ih20l3pJoeU/w-d-xo.html
@@mushroomcrepes