I just found this, and this is quite a gem; please continue on your series, don't feel disappointed by the lack of viewers/comments/subscribers yet. This is quite a niche topic, but considering how clear your instructions are, eventually you'll get there.
@@j_respect5948 - It depends. There are many more tutorials out there for openGL so it can be easier to learn. It is also less verbose, so getting started with it is easier. If you are already very comfortable programming in c++ then I think either vulkan or openGL are good options, with vulkan being slightly harder. If you're still learning c++ I would recommend learning a bit of openGL first as trying to learn a hard language like c++ and a complicated api like vulkan at the same time is too much to do at once.
For windows machines that have installed the 64 bit version of Vulkan (only checked version 1.3.268.0), the "glslc.exe" executable mentioned @12:27 can be found in within the Bin folder, rather than Bin32.
Hey, I've just discovered this channel after some weeks trying to learn Vulkan by myself. It's mind-blowing how difficult topics finally click as you explain it. Thanks so much for the series!
Thank you so much. These videos do take for me a lot of time and effort so it is really great to hear that there are people out there that find them helpful!
Wow! I had never compiled shaders for SPIR-V, and following the tutorial on that page, it became cumbersome and eternal to read, about the validation layers. But here, much progress was made. Thank you!
Thanks a lot for the tutorials!!! I know this video is 2 years old but it really has no age from the perspective of it's usefulness. I am grateful that you and other people like you educate us so much and I myself learned so much from you tube only. As far as I'm concerned if schools had teachers like you I would love to be there.
I don't usually comment on youtube videos, but you are a godsent! your tutorial is awesome and super helpful! Especially since there isn't much easy to follow/understand vulkan tutorials and guides out there.
Thank you :) it’s definitely not perfect so I’d recommend not using this as your sole resource. But I think it acts as a pretty good way to get started, especially if you prefer the video format for learning
I don't know anything about shaders but still enjoy learning about advanced topics such as this. You had a good tempo in the video and explained everything clearly. GJ
I love your tutorials! I am following the official Vulakn Tutorials but I think it is hard for me to understand how it works. Your explanation is very clear!
Really gives a good view on the subject. There are parts that I didn't know how they worked, because my knowledge of c++ is still quite new. But with a little bit of looking up I figured out how those work. Thank you!
I'm loving your tutorials! I followed the complete LunarG tutorial, however, it adds everything into one class which makes it over 1.5k lines of code to search through which makes things hard. Even though I am at an intermediate level of C++, I found it hard to put things into classes. You make it extremely easy! Thank you!
I just discovered this channel and i finally got through episode 0 and 1 over two days. I haven't programmed anything in 6 years. Kinda rusty on the fundamentals, but i think im following along okay sofar. Definitely gonna need to study the basics of c++ while im doing this series.
Please, if you ever find time, make an extra video about differences between your Makefile and the one we get after following vulkantutorial website, e.g. `pkg-config` for `glfw3` returns more libraries than the website suggests and I see you prefer it for some reason. I'd love to get more fluent in C++ (and Makefiles) and this seems like a very fun project but my compilation skills s*ck as*. Everything works so far but idk why which is the worst kind of unknown. I love the way you explain sh*t. 🖤
For you windows folks' getting the exception thrown, you might want to try setting absolute paths at 19:33. Windows and relative paths that aren't environment variables can very easily cause trouble.
For those struggling to find the glslc compiler in the Vulkan SDK's Bin32 directory on windows: For the modern 64 bit release of the Vulkan SDK (as of Feb. 2024), glslc is contained in the "Bin" directory rather than the "Bin32" directory.
Maybe it will have someone but make sure that your files for shaders are encoded in UTF-8 without BOM, glslc wont be able to parse them correctly with BOM, rider added BOM automatically and it was quite hard to realize what the problem was when compiling the shaders
I had some problem for compiling to the .spv format because my glslc.exe path had spaces in it. Puting quotations marks (these things : ") around the path solved the issue. I thought I'd put that there if anyone has the same problem. By the way thanks a lot for these tutorials, your explanations are great !
love the series so far! already went through the vulkan tutorial website and I also really like that but I wanted to go over a video tutorial to get some different perspectives on the layout and following so far I've actually made some changes to my programming style and text editor (not completely related to the tutorial) i decided to change my brackets to be on the same line, I went from const type to type const because I think that is more direct and I switched from the itai theme to the rose-pine theme in nvim :)
Hi there, just discovering those tutorials and although all those things are hidden and "automatically handled" by higher level engine, i'm delighted to learn what's happening under the hood and all the work that is put for me everytime i totally fail to optimize anything :D I'm also curious about what software(s) you use to make your "handwritten" blackboard slides? That format is very comfortable to follow
Hello! Thank you for you amazing tutorials. I have an error, when i run my code i get an exception from "vector" that says "Microsoft C++ exception: std::length_error at memory location 0x000000CD9B90EA80." my code looks exactly like yours but it still dosent work. Do you have any idea of what i could be doing wrong? (my guess is thata there is something wrong with my pipeline readfile function)
I've got an error: simple_shader.vert:3: *error: '' : syntax error, unexpected LEFT_BRACE, expecting LEFT_PAREN 1 error generated.* So I had to change the array declaration syntax to this: vec2 poistions[3] = vec2[] ( vec2(0.0, -0.5), vec2(0.5, 0.5), vec2(0.0, -0.5) ); after that the error disappeared, still syntax looks quite weird.
Not at all! I've always had a strong interest in computer graphics since I first started coding at around 15. I did a BSc and MSc in computer science.For my masters I was in a computer graphics and animation lab and was a teachers assistant for some grad level graphics and animation courses. Then I've also followed a lot of youtube tutorials for opengl. Following school I spent a couple years at facebook and then worked at a iot device startup for a couple years after that, and just trying to figure out what to do next now. I was working on building affordable motion capture cameras when I needed to make a gui for it and rather than use opengl I figured I could learn vulkan. However I was kind of surprised nobody had created a beginner friendly vulkan series yet. Without my background in computer graphics I knew there wasn't any chance I would've been able to learn vulkan using the existing stuff out there. So I started working on this series in hopes to help with that.
if you executing from Xcode, you probably need to change the working directory in Xcode settings (Edit scheme -> run -> options) or set absolute paths to the shader files
when creating the function readFile at ~14:40 why do you choose to return a vector of chars instead of a string, and then use the string constructor that takes a start and end forward iterator once the file is successfully opened?
when I try to compile the shaders (on windows) I get the following error Error: no binary generation requested (e.g., -V) (use -h for usage) I can't seem to figure out how to solve this problem.
when ever i compile the programm i get the error "Unhandled exception at 0x00007FF9F588CB69 in VulkanTest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000C0F1B4F488" at the end of line 18 in lve_pipeline.cpp the memory locations are always diffrent ,do you know anyway i culd fix the issue?
I think this has already been solved, but I'll leave it here in case someone else needs it. The following possibilities are considered, the file is in the wrong working directory, incorrect path, or both. You can check the working directory with the code below.(This code requires ) std::cout
I'm having trouble compiling the vertex shader. If I use an exact copy of what you wrote, which is the same as on the vulkan-tutorial page, I get an error. "shaders\simple_shader.vert:3: error: '' : syntax error, unexpected IDENTIFIER" I've been googling for 2 days and haven't found anything that helps. Any ideas?
Hello, I just wanna share that if anyone is having the opening file error, and already tried the absolute path, that to me changing the fstream file variable to an ifstream variable solved the error to me.. I think that because it is a compilation file the program cant open with option to write Anyways, thank you for the tutorial, it's super well made!
I tried using GLSL Lint extension for vscode, using the glsllangValidator that came with vulkan sdk, but it keeps giving error: "gl_VertexIndex' : undeclared identifier"
Just in case anyone else is having this problem, the solution is to set "glslangValidatorArgs" setting to "-V". This will enable the validator to validate for Vulkan (the default being openGL)
I draw the pictures using the procreate app on an iPad, and then edit the images and apply transitions using the video editor DaVinci resolve. So it’s all pretty manual, any image editing and video editing software should work.
guys, I have been a c/opengl dev for a long time. I wanted to upgrade to vulcan, so I started writing cpp. I noticed that the readFile returns a vector of char. Why can't it return an std::string?
Keep getting the runtime error that is failing to open the .spv files in the shaders/ file. I'm program on Xcode on Mac. I ended up copying the absolute address of the files into "filepath" and it works that way.
If anyone runs into the issue and is in an IDE, I found a solution that worked for me. IDEs compile and send the .exe to a specific folder. Your path must be relative to that location. For Visual Studio, check the project properties by right-clicking the project in the solution explorer and click Properties. From there, go under Configuration Properties and General. Look at the path in Output Directory. That is where the .exe goes and thus it is the path from which the shader path is relative.
@@meowmeowcatcat8 Hello, I read your comment 10 times and I still don't understand it, could you be a little more specific in the final part? Should I put the .exe in that folder or should I configure the folder to run from where the video explains?
Greetings again! I have been progressing on my own and I have already come to implement the buffers (I am trying to guide myself from the structure you have in your github), and I am starting with the depth buffer, but it seems that you have already included it in the files of the exchange chain?
@@BrendanGalea tnhx! those files are so helpful!! One more thing about the Swapchain recreation, could you give me a little guide to do it? I tried to follow vulkan's tutorial but I get an error that command buffers are in use
@@yaircambordamorocho4506 Here ya go: github.com/blurrypiano/littleVulkanEngine/commit/aaa1922eab3d26a1df307ea6747461187286991d I've tested only on linux so far but I think it should be good. I'm probably going to make the next tutorial video on this topic, and then cover push constants after that.
I am following along but am stuck at the .bat file, In visual studios, double clicking just slects the file. The filie is not represented by the windows logo, instead a bok with gears if thats of any importance.
so it turns out vs2022 uses something called filters as opposed to folders and as susch the lacation of the files was not correct. furthermore even the source filter is not represented in a file heiarchy when I try to navigate my project in the file explorer. Seeems like an interesting design decision on VS2022 part. But, also wanted to say the tutorial series is great!
@@jonj4040 Hey I am on VS2022 to. So you just did as if the filters where folders when following the organization of the tutorial and when entering the fille paths you did as if all filles where in the same folders as they are on disk but not in the filter organization of the project ? :)
sorry! is it too fast? I tend to cut out any pauses to keep the video flowing with the intention that people would pause as they follow along while coding.
@@BrendanGalea I'm sure it's fine for more experienced users but I'm relatively new to c++. Coming from years of backend web dev. A lot of this is just way too fast for me and goes a mile over my head. I'm trying to find someone to help me understand this tutorial more.
@@Fidelity_Investments Ok! Ya I have mostly just focused on explaining the vulkan specifics, and only explain certain aspects of c++ occasionally . There are plenty of great resources for learning c++, I really like www.learncpp.com It's long, but many parts can be skimmed on a first read through and then looked up when you come across that functionality.
When I try to compile the vert and frag files. I get an error saying glslc: error: cannot open input file: 'Resource Files\simple_shader.vert': No such file or directory glslc: error: cannot open input file: 'Resource Files\simple_shader.frag': No such file or directory I'm on windows and am using visual studio where all my shader files are under "Resource Files" in visual studio. Is there any way to fix this?
Hello, While writting this in c++ I got another nice little error where the compiler tells me "abort()" has been called. There seems to be an issue with the readFile function. I've tried to catch exceptions with a try and catch block but it doesn't catch any exceptions. I've also seen the comment by nyzs about this topic i trippel checked it and in my code it says "std::ifstream" and not "std::fstream". Thank you for the help :)
Around 19:56, your shader files are around 1164, and 424 bytes/. My Vertex Shader prints 1164 as well, but my Fragment Shader prints 456 bytes instead of 424. Is it ok for my Fragment Shader to be a little bit over, or is there some sort of read issue in my function? I am writing this in C rather than C++, so I am assuming that there is a bit of padding here or there.
Hiya there, like the commenter before me, I know this is an old video, but I was hoping you could maybe give me a hand, I'm using VS2019 and despite now copy pasting in directly from github, am still getting the error. The if statement for file.is_open() catching was having a runtime error at memory location x, upon commenting the if statement to see if it would help me figure out what's up, i got a "vector too long" error. very clueless on how this might happen, but any ideas would be appreciated. I build fine, but running does not work. I love your videos, but my own mistakes are messing me up a bit here D: any chance you could help me out?
I have managed to at least continue with the tutorial, using absolute filepaths seems to work, not sure why the simple shaders/simple_shader one wouldnt work. odd
likely has to do with the working directory of visual studio not being where you expect it to be by default. Try googling how to change the working directory of visual studio to where you want it to be if you want to use relative filepaths. I also show a more general build process in tutorial 23 (in hindsight this is something i wish i did earlier on in the series)
@@BrendanGalea I'll have a look at this, hopefully this will fix it. Thanks for the help anyway, especially on such an old video. Your explanations are excellent and these are by far some of the better tutorials on this website, so thanks for everything you do.
Hi, I m coding on Mac Big Sur with xCode and I'm getting this error when i run the program : std::runtime_error: failed to open file: Shaders/simple_shader.vert.spv I have no clue why, I checked with the file on github and to me they look the same
Is this with the .spv files for the fragment and vertex shaders? Make sure that they aren't being included as part of your engine compilation. These shader files are separate files that are read into the engine only at runtime. Visual Studio might be trying to compile them as part of the c++ code for the engine, which would cause problems.
Hi loving this series so far but I'm stuck at compiling my shaders on Windows. Specifically, my fragment shader throws this error when I run the .bat file: #version: desktop shaders for vulkan spir-v require version 140 or higher Looking at the glslang source code this looks to be a compatibility issue with SPIR-V but everything else so far up to this point has been running fine. Any ideas what could be going wrong? I really want to progress with this series!
@@BrendanGalea sorry I forgot to mention I have that at the top of my files as well. Line for line both my vertex and fragment shaders are the same as yours but only the fragment shaders gets this error
In that case I really am not sure. Maybe try using a different glslc? You could try this version github.com/google/shaderc Other than that unfortunately I don't really have a clue...
Old post, but I had the same issue. I found out this was caused by the .vert and .frag files not being saved in UTF-8. Maybe this will help other people.
In tutorial 11 I show an example of that being done (but in a suboptimal way). And it actually won’t be until tutorial 20 that we’ve covered enough material to know how to do that in a proper way
Not sure what you mean, vulkan's coordinate system is different but it still is cartesian based. Here's an article that goes into a bit more detail on how it differs from OpenGL's - matthewwellings.com/blog/the-new-vulkan-coordinate-system/
@@BrendanGalea maybe i should have called it "standard cartesian system" because the quadrants are rotated clockwise by 90 degrees.. i will read it. thanks!
Hi there, just caught a small issue with this for me but it seems to work for you, for some reason the lve::lvepipeline(consy std::string& vertFilepath, const std::string& fragFilepath) does not seem to like the & symbol after the std::string, this also applies to the void lve::createGraphicsPipeline function. Removing the & symbol from the cpp and the header file fixed my issue but is there any reason why the constructor and refuses the & on the string?
@@BrendanGalea"void lve::lvepipeline::createGraphicsPipeline cannot convert argument 1 from 'const std::string' to std::string &'" "Conversion loses qualifiers" void lve::lvepipeline::createGraphicsPipeline(....) overload member function not found in lve::lvepipeline
I'm currently learning C++ and I can say that enables basic input/output in the console. So you can write into buffer or output to console basic types: chars, ints, floats, etc. The same with arrays, though chars need to be terminated with '/0' symbols at the end. introduces a new type of object, it's type declaration begins with "std::string". It has its own set of methods, which makes operations with strings much easier. Without you cannot initialize strings as objects of std::string class, and you have to deal with them as an array of chars, as well as managing memory for them yourself.
Very nice tutorial! However, I‘m using vs2022 and there is an error when I compile it. It says that unresolved externals "private: static class std::vector __cdecl lve::LvePipeline::readFile(class std::basic_string const &)". I followed vulkan tutorial to setup visual studio environment and I have no idea about this.
I'm not really sure, I'll need a bit more information. Do you know at which point you first started getting these errors. At the end of tutorial 1 were things working correctly?
I can try reproducing this on monday in visual studio 2019. Have you tried to see if the errors are present in both release mode and debug mode? Might also have something to do with the 32 bit vs 64 bit binary for glfw. It could be something related to this: discourse.glfw.org/t/setting-up-glfw-on-visual-studio/1344/2 I'm not super familiar with visual studio though so I'll have to try some stuff out when I have the chance. But my guess is that your code isn't the problem, and its more to do with the project configuration and setup.
Fallen at the final hurdle, getting following in xcode terminating with uncaught exception of type std::runtime_error: failed to open file simple_shader.vert.spv terminating with uncaught exception of type std::runtime_error: failed to open file simple_shader.vert.spv
@@BrendanGalea Of course of course Mr B..should know by now that my machine likes the absolute... Vertex Shader code size 1164 Fragment Shader code size 424
this is a bit embarrassing but if you get a "Debug Error -Abort() Has Been Called" error you may want to check line 15 in your lve_pipeline.cpp and make sure you typed "std::ifstream" and not "std::fstream". i didnt know what was causing this for atleast 30 minutes lmao
I just found this, and this is quite a gem; please continue on your series, don't feel disappointed by the lack of viewers/comments/subscribers yet. This is quite a niche topic, but considering how clear your instructions are, eventually you'll get there.
Thank you, much appreciated!
Nah he's just starting out, once he has more content the views will go up. He just needs to stick with it.
@@BrendanGalea i was actually looking for opengl but i found vulcan, should i choose vulcan over opengl? But most ide supports opengl
@@j_respect5948 - It depends. There are many more tutorials out there for openGL so it can be easier to learn. It is also less verbose, so getting started with it is easier.
If you are already very comfortable programming in c++ then I think either vulkan or openGL are good options, with vulkan being slightly harder.
If you're still learning c++ I would recommend learning a bit of openGL first as trying to learn a hard language like c++ and a complicated api like vulkan at the same time is too much to do at once.
Just came here to say - it's been 3 years and this comment has now proven to be right :) congrats on your views and subscribers!
I cant belive this content is free, this series are amazing, thanks for this, and for making internet a better place.
Thank you, that means a lot to me!
Amazing stuff Hold this sub
For windows machines that have installed the 64 bit version of Vulkan (only checked version 1.3.268.0), the "glslc.exe" executable mentioned @12:27 can be found in within the Bin folder, rather than Bin32.
This is an extremely beautiful series of tutorials.
Thank you!
Hey, I've just discovered this channel after some weeks trying to learn Vulkan by myself. It's mind-blowing how difficult topics finally click as you explain it. Thanks so much for the series!
Thank you!! Glad you’re enjoying the series so far
This is awesome!! Please please please do not feel discouraged, you're helping a lot of people. Thank you soo so much!
Thank you so much. These videos do take for me a lot of time and effort so it is really great to hear that there are people out there that find them helpful!
Wow! I had never compiled shaders for SPIR-V, and following the tutorial on that page, it became cumbersome and eternal to read, about the validation layers. But here, much progress was made. Thank you!
This is the clearest series I've seen.
Thanks a lot for the tutorials!!! I know this video is 2 years old but it really has no age from the perspective of it's usefulness. I am grateful that you and other people like you educate us so much and I myself learned so much from you tube only. As far as I'm concerned if schools had teachers like you I would love to be there.
Thank you for the tutorial series! This is really good stuff. You're easy to understand, concise, and informative. Keep it up!
Finally, something that beginners (like me) can understand. Thanks mate!
I don't usually comment on youtube videos, but you are a godsent! your tutorial is awesome and super helpful! Especially since there isn't much easy to follow/understand vulkan tutorials and guides out there.
The best Vulkan series, absolute mad lad
Thank you :) it’s definitely not perfect so I’d recommend not using this as your sole resource. But I think it acts as a pretty good way to get started, especially if you prefer the video format for learning
@@BrendanGalea the way you lay out the pipeline is so concise that this is probably the best place to start
I don't know anything about shaders but still enjoy learning about advanced topics such as this.
You had a good tempo in the video and explained everything clearly. GJ
I love your tutorials! I am following the official Vulakn Tutorials but I think it is hard for me to understand how it works. Your explanation is very clear!
I am learning Vulkan thanks to you. Thanks a lot! Really really nice series.
the greatest graphic pipeline guide i've ever seen!
Really gives a good view on the subject. There are parts that I didn't know how they worked, because my knowledge of c++ is still quite new. But with a little bit of looking up I figured out how those work. Thank you!
I'm loving your tutorials! I followed the complete LunarG tutorial, however, it adds everything into one class which makes it over 1.5k lines of code to search through which makes things hard. Even though I am at an intermediate level of C++, I found it hard to put things into classes. You make it extremely easy! Thank you!
I just discovered this channel and i finally got through episode 0 and 1 over two days.
I haven't programmed anything in 6 years. Kinda rusty on the fundamentals, but i think im following along okay sofar.
Definitely gonna need to study the basics of c++ while im doing this series.
How this content is free!! can't believe it, hope you stay healthy
This what I was looking for years...Thank you ♥♥
The fact that you did all this without CMake is amazing... I would've automated things like shader compilation from the start
Half way to drawing our first triangle you say. This is going faster than I thought!
Just thank you for your service and product quality!
Subscribed. Extremely promissing channel.
and at that moment, he knew, he just f....
........ound a legendary channel.
Best tutorial on UA-cam!!!
What is this IDE used during this tutorial?
VS code. I really like it!
Please, if you ever find time, make an extra video about differences between your Makefile and the one we get after following vulkantutorial website, e.g. `pkg-config` for `glfw3` returns more libraries than the website suggests and I see you prefer it for some reason. I'd love to get more fluent in C++ (and Makefiles) and this seems like a very fun project but my compilation skills s*ck as*. Everything works so far but idk why which is the worst kind of unknown. I love the way you explain sh*t. 🖤
For you windows folks' getting the exception thrown, you might want to try setting absolute paths at 19:33. Windows and relative paths that aren't environment variables can very easily cause trouble.
These videos are amazing, good job and keep up the good work.
Thank you very much for the Tutorials! You are very good at explaining!
hey i just found this video, the tutorials are extremely helpful! Thank you for putting effort into the documentation and timestamps!
Great explanation, thanks for sharing your ecpirience with all of us
Thanks for making these! :) Just got done with the triangle tutorial but this definitely helps to understand it better
For those struggling to find the glslc compiler in the Vulkan SDK's Bin32 directory on windows:
For the modern 64 bit release of the Vulkan SDK (as of Feb. 2024), glslc is contained in the "Bin" directory rather than the "Bin32" directory.
Maybe it will have someone but make sure that your files for shaders are encoded in UTF-8 without BOM, glslc wont be able to parse them correctly with BOM, rider added BOM automatically and it was quite hard to realize what the problem was when compiling the shaders
Agreed. Just found this. Very well put together. Keep going! Please :)
Thank you! More to come!
I had some problem for compiling to the .spv format because my glslc.exe path had spaces in it. Puting quotations marks (these things : ") around the path solved the issue. I thought I'd put that there if anyone has the same problem. By the way thanks a lot for these tutorials, your explanations are great !
Thank you!
Helped me, thanks :)
love the series so far! already went through the vulkan tutorial website and I also really like that but I wanted to go over a video tutorial to get some different perspectives on the layout and following so far I've actually made some changes to my programming style and text editor (not completely related to the tutorial) i decided to change my brackets to be on the same line, I went from const type to type const because I think that is more direct and I switched from the itai theme to the rose-pine theme in nvim :)
Thanks dude...It helps alot especially on beginners like
This is a gem! Thank you
On arch linux, the glslc file is included in the "shaderc" package
Thank you!!
Thank you for making these videos.
Hi there, just discovering those tutorials and although all those things are hidden and "automatically handled" by higher level engine, i'm delighted to learn what's happening under the hood and all the work that is put for me everytime i totally fail to optimize anything :D I'm also curious about what software(s) you use to make your "handwritten" blackboard slides? That format is very comfortable to follow
I draw them using procreate on an iPad, and then transitions are edited in DaVinci resolve
Academic style, i love this
Hello! Thank you for you amazing tutorials.
I have an error, when i run my code i get an exception from "vector" that says "Microsoft C++ exception: std::length_error at memory location 0x000000CD9B90EA80." my code looks exactly like yours but it still dosent work. Do you have any idea of what i could be doing wrong? (my guess is thata there is something wrong with my pipeline readfile function)
I've got an error: simple_shader.vert:3:
*error: '' : syntax error, unexpected LEFT_BRACE, expecting LEFT_PAREN 1 error generated.*
So I had to change the array declaration syntax to this:
vec2 poistions[3] = vec2[] (
vec2(0.0, -0.5),
vec2(0.5, 0.5),
vec2(0.0, -0.5)
);
after that the error disappeared, still syntax looks quite weird.
Yep shaders are programmed in glsl. It is a language that is similar to c but there are some differences.
@@BrendanGalea Sorry, my fault. I was watching late and it seemed you wrote curly braces.
Great videos, love your clear presentation style - Brendan do you mind me asking your background?, you are so knowledgeable!
Not at all! I've always had a strong interest in computer graphics since I first started coding at around 15. I did a BSc and MSc in computer science.For my masters I was in a computer graphics and animation lab and was a teachers assistant for some grad level graphics and animation courses. Then I've also followed a lot of youtube tutorials for opengl. Following school I spent a couple years at facebook and then worked at a iot device startup for a couple years after that, and just trying to figure out what to do next now.
I was working on building affordable motion capture cameras when I needed to make a gui for it and rather than use opengl I figured I could learn vulkan. However I was kind of surprised nobody had created a beginner friendly vulkan series yet. Without my background in computer graphics I knew there wasn't any chance I would've been able to learn vulkan using the existing stuff out there. So I started working on this series in hopes to help with that.
if you executing from Xcode, you probably need to change the working directory in Xcode settings (Edit scheme -> run -> options) or set absolute paths to the shader files
Amazing tutorial, thank you!
Underatted 💯%
when creating the function readFile at ~14:40 why do you choose to return a vector of chars instead of a string, and then use the string constructor that takes a start and end forward iterator once the file is successfully opened?
in windows you can directly call it since it's already in the env variable
On linux, I kept getting errors opening the shader files - adding std::ios::in to the flags fixed this.
Thanks for making good tutorials! btw is there any difference between .hpp files and .h files?
Thanks! And no not really. If you prefer using .h you can use that and it won’t affect the tutorial.
when I try to compile the shaders (on windows) I get the following error Error: no binary generation requested (e.g., -V) (use -h for usage) I can't seem to figure out how to solve this problem.
wow what a great job! thank you so much!
with the help of ChatGPT my understanding of these fundamentals increased tenfold.
when ever i compile the programm i get the error "Unhandled exception at 0x00007FF9F588CB69 in VulkanTest.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000C0F1B4F488" at the end of line 18 in lve_pipeline.cpp the memory locations are always diffrent ,do you know anyway i culd fix the issue?
I think this has already been solved, but I'll leave it here in case someone else needs it.
The following possibilities are considered, the file is in the wrong working directory, incorrect path, or both.
You can check the working directory with the code below.(This code requires )
std::cout
I'm having trouble compiling the vertex shader. If I use an exact copy of what you wrote, which is the same as on the vulkan-tutorial page, I get an error.
"shaders\simple_shader.vert:3: error: '' : syntax error, unexpected IDENTIFIER"
I've been googling for 2 days and haven't found anything that helps. Any ideas?
Make sure you use the correct type of brackets
Hello, I just wanna share that if anyone is having the opening file error, and already tried the absolute path, that to me changing the fstream file variable to an ifstream variable solved the error to me.. I think that because it is a compilation file the program cant open with option to write
Anyways, thank you for the tutorial, it's super well made!
I tried using GLSL Lint extension for vscode, using the glsllangValidator that came with vulkan sdk, but it keeps giving error: "gl_VertexIndex' : undeclared identifier"
Just in case anyone else is having this problem, the solution is to set "glslangValidatorArgs" setting to "-V". This will enable the validator to validate for Vulkan (the default being openGL)
Glad you figured it out so quickly!
Can anyone tell me which software are using for this presentation . I really need this types presentation software for planning..
I draw the pictures using the procreate app on an iPad, and then edit the images and apply transitions using the video editor DaVinci resolve.
So it’s all pretty manual, any image editing and video editing software should work.
excellent video, benefit a lot
guys, I have been a c/opengl dev for a long time. I wanted to upgrade to vulcan, so I started writing cpp. I noticed that the readFile returns a vector of char. Why can't it return an std::string?
Keep getting the runtime error that is failing to open the .spv files in the shaders/ file. I'm program on Xcode on Mac. I ended up copying the absolute address of the files into "filepath" and it works that way.
I followed the tutorial but when running the program I get the error “failed to open file: shaders/simple_shader.vert.spv”.
Could be a path issue. Try using the full path (c:/documents/…/shaders/simple_shader_vert.spv) instead of the relative path for when reading the file
@@BrendanGalea that worked thanks!
You say full path is place the full path and after -o full path again but executable. I don't undestend?
If anyone runs into the issue and is in an IDE, I found a solution that worked for me. IDEs compile and send the .exe to a specific folder. Your path must be relative to that location.
For Visual Studio, check the project properties by right-clicking the project in the solution explorer and click Properties. From there, go under Configuration Properties and General. Look at the path in Output Directory. That is where the .exe goes and thus it is the path from which the shader path is relative.
@@meowmeowcatcat8 Hello, I read your comment 10 times and I still don't understand it, could you be a little more specific in the final part?
Should I put the .exe in that folder or should I configure the folder to run from where the video explains?
Greetings again! I have been progressing on my own and I have already come to implement the buffers (I am trying to guide myself from the structure you have in your github), and I am starting with the depth buffer, but it seems that you have already included it in the files of the exchange chain?
Yes the swap chain file class provided set's up the target framebuffers with both a color and depth buffer attachment.
@@BrendanGalea tnhx! those files are so helpful!! One more thing about the Swapchain recreation, could you give me a little guide to do it? I tried to follow vulkan's tutorial but I get an error that command buffers are in use
Ya I can do that tomorrow. It’s not too tricky, just everything that depends on the swap chain has to also be recreated.
@@yaircambordamorocho4506 Here ya go: github.com/blurrypiano/littleVulkanEngine/commit/aaa1922eab3d26a1df307ea6747461187286991d
I've tested only on linux so far but I think it should be good. I'm probably going to make the next tutorial video on this topic, and then cover push constants after that.
I am following along but am stuck at the .bat file, In visual studios, double clicking just slects the file. The filie is not represented by the windows logo, instead a bok with gears if thats of any importance.
so it turns out vs2022 uses something called filters as opposed to folders and as susch the lacation of the files was not correct. furthermore even the source filter is not represented in a file heiarchy when I try to navigate my project in the file explorer. Seeems like an interesting design decision on VS2022 part.
But, also
wanted to say the tutorial series is great!
@@jonj4040 Hey I am on VS2022 to. So you just did as if the filters where folders when following the organization of the tutorial and when entering the fille paths you did as if all filles where in the same folders as they are on disk but not in the filter organization of the project ? :)
Thank for sharing the idea
can I give you guys a tip to understand something like vertex? try to use Blender this can help you understand batter
god this man moves fast
sorry! is it too fast? I tend to cut out any pauses to keep the video flowing with the intention that people would pause as they follow along while coding.
@@BrendanGalea I'm sure it's fine for more experienced users but I'm relatively new to c++. Coming from years of backend web dev. A lot of this is just way too fast for me and goes a mile over my head. I'm trying to find someone to help me understand this tutorial more.
@@Fidelity_Investments Ok! Ya I have mostly just focused on explaining the vulkan specifics, and only explain certain aspects of c++ occasionally .
There are plenty of great resources for learning c++, I really like www.learncpp.com
It's long, but many parts can be skimmed on a first read through and then looked up when you come across that functionality.
When I try to compile the vert and frag files. I get an error saying
glslc: error: cannot open input file: 'Resource Files\simple_shader.vert': No such file or directory
glslc: error: cannot open input file: 'Resource Files\simple_shader.frag': No such file or directory
I'm on windows and am using visual studio where all my shader files are under "Resource Files" in visual studio. Is there any way to fix this?
Easiest solution would be to use the absolute path. So like C:/users/…/simpleshader.vert
Hello,
While writting this in c++ I got another nice little error where the compiler tells me "abort()" has been called. There seems to be an issue with the readFile function. I've tried to catch exceptions with a try and catch block but it doesn't catch any exceptions. I've also seen the comment by nyzs about this topic i trippel checked it and in my code it says "std::ifstream" and not "std::fstream".
Thank you for the help :)
Hey, has anyone tried this lesson on linux with wayland? I have transparent window without control elements and don't know if this is normal or not.
Around 19:56, your shader files are around 1164, and 424 bytes/. My Vertex Shader prints 1164 as well, but my Fragment Shader prints 456 bytes instead of 424. Is it ok for my Fragment Shader to be a little bit over, or is there some sort of read issue in my function? I am writing this in C rather than C++, so I am assuming that there is a bit of padding here or there.
Ya at this point I wouldn’t be too concerned yet. Your file might just have some extra whitespace characters or something like that.
How do I create .vert file in Visual Studio?
The file extension here doesn’t actually matter. But you should be able to just create a new file and when you save it manually type the extension
Is 450 required, could I use 3.3 if I also want to use the shader in an opengl context?
Hiya there, like the commenter before me, I know this is an old video, but I was hoping you could maybe give me a hand, I'm using VS2019 and despite now copy pasting in directly from github, am still getting the error. The if statement for file.is_open() catching was having a runtime error at memory location x, upon commenting the if statement to see if it would help me figure out what's up, i got a "vector too long" error. very clueless on how this might happen, but any ideas would be appreciated. I build fine, but running does not work. I love your videos, but my own mistakes are messing me up a bit here D: any chance you could help me out?
I have managed to at least continue with the tutorial, using absolute filepaths seems to work, not sure why the simple shaders/simple_shader one wouldnt work. odd
likely has to do with the working directory of visual studio not being where you expect it to be by default. Try googling how to change the working directory of visual studio to where you want it to be if you want to use relative filepaths. I also show a more general build process in tutorial 23 (in hindsight this is something i wish i did earlier on in the series)
@@BrendanGalea I'll have a look at this, hopefully this will fix it. Thanks for the help anyway, especially on such an old video. Your explanations are excellent and these are by far some of the better tutorials on this website, so thanks for everything you do.
Hi, I m coding on Mac Big Sur with xCode and I'm getting this error when i run the program :
std::runtime_error: failed to open file: Shaders/simple_shader.vert.spv
I have no clue why, I checked with the file on github and to me they look the same
Likely a path error you could try using an absolute path instead. And did you compile the .vert file to the .spv ?
@@BrendanGalea absolute worked thanks also another way around was to change my ide environment build path.
my .vert file is not linking to the project al lthe code is jsut plain text if i write anything. VS2022
hey did you find a solution
@@kepcukhusamettin9400 well im a little late, but try installing GLSL language integration and see if it fixes it
I'm using visual studio 2019 and I have a little problem with file extension.
Is this with the .spv files for the fragment and vertex shaders? Make sure that they aren't being included as part of your engine compilation.
These shader files are separate files that are read into the engine only at runtime. Visual Studio might be trying to compile them as part of the c++ code for the engine, which would cause problems.
I mean I was trying to make a file .vert, and I was writing in it, vs didn't recognize what's writing in it
@@BrendanGalea never mind! I just didn't install GLSL language integration.
@@kacperxt371 I had the same issue thx !!
hi can you show how to automate the shader compile whit shaderc lib?
Don’t have that currently planned for the tutorial series, sorry!
How to make presentatation picture?
Hi loving this series so far but I'm stuck at compiling my shaders on Windows. Specifically, my fragment shader throws this error when I run the .bat file:
#version: desktop shaders for vulkan spir-v require version 140 or higher
Looking at the glslang source code this looks to be a compatibility issue with SPIR-V but everything else so far up to this point has been running fine.
Any ideas what could be going wrong? I really want to progress with this series!
The first line of both the vertex and fragment shader files should be #version 450 . I think if you are missing that you might get that error.
@@BrendanGalea sorry I forgot to mention I have that at the top of my files as well. Line for line both my vertex and fragment shaders are the same as yours but only the fragment shaders gets this error
In that case I really am not sure. Maybe try using a different glslc? You could try this version github.com/google/shaderc
Other than that unfortunately I don't really have a clue...
Old post, but I had the same issue. I found out this was caused by the .vert and .frag files not being saved in UTF-8. Maybe this will help other people.
@@hice962 How did you fix it?
removing the " symbol is only counterproductive because paths with spaces are no more one path instead they will be treated as two seperate arguments.
could you tell me or give me a link to a resource where the creation of several objects in one scene would be described? thank you in advance)
In tutorial 11 I show an example of that being done (but in a suboptimal way). And it actually won’t be until tutorial 20 that we’ve covered enough material to know how to do that in a proper way
@@BrendanGalea благодарю) translation thank you)
is there a deeper reason why the coordinate system is so different and why vulkan uses not a cartesian system?
Not sure what you mean, vulkan's coordinate system is different but it still is cartesian based. Here's an article that goes into a bit more detail on how it differs from OpenGL's - matthewwellings.com/blog/the-new-vulkan-coordinate-system/
@@BrendanGalea maybe i should have called it "standard cartesian system" because the quadrants are rotated clockwise by 90 degrees.. i will read it. thanks!
Hi there, just caught a small issue with this for me but it seems to work for you, for some reason the lve::lvepipeline(consy std::string& vertFilepath, const std::string& fragFilepath) does not seem to like the & symbol after the std::string, this also applies to the void lve::createGraphicsPipeline function. Removing the & symbol from the cpp and the header file fixed my issue but is there any reason why the constructor and refuses the & on the string?
I'm not sure why that would be. What was the compiler error message?
@@BrendanGalea"void lve::lvepipeline::createGraphicsPipeline cannot convert argument 1 from 'const std::string' to std::string &'"
"Conversion loses qualifiers"
void lve::lvepipeline::createGraphicsPipeline(....) overload member function not found in lve::lvepipeline
Not entirely sure why it's doing this in comparison to your code but removing the '&' from the hpp and cpp file resolves the issue
Correction* this only applies to createGraphicsPipeline function and not the constructor
@@novacaine_.5108 check that Ive::createGraphicsPipeline takes a const std::string& as well
little thing I'd like to say, including iostream makes including string unnecessary, correct me if I'm wrong
I did not know that! Thanks :)
I'm currently learning C++ and I can say that enables basic input/output in the console.
So you can write into buffer or output to console basic types: chars, ints, floats, etc. The same with arrays, though chars need to be terminated with '/0' symbols at the end.
introduces a new type of object, it's type declaration begins with "std::string". It has its own set of methods, which makes operations with strings much easier.
Without you cannot initialize strings as objects of std::string class, and you have to deal with them as an array of chars, as well as managing memory for them yourself.
Very nice tutorial!
However, I‘m using vs2022 and there is an error when I compile it.
It says that unresolved externals "private: static class std::vector __cdecl lve::LvePipeline::readFile(class std::basic_string const &)".
I followed vulkan tutorial to setup visual studio environment and I have no idea about this.
After comparing your code and mine, I eventually realise my error. I implement readFile function with something wrong, my poor c++ >_
glad you were able to figure it out, c++ code to debug can be tricky at times :p
How were your files organized? I'm having trouble getting the .bat file to run and create the spv files for the shader.
Hey! So i get the "LNK4098 defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library" error at runtime. How can i solve it?
I am using vs2019 on windows
I'm not really sure, I'll need a bit more information. Do you know at which point you first started getting these errors. At the end of tutorial 1 were things working correctly?
I got the errors only when i compiled at the end of the second tutorial
The point is i get these errors even if i use your code instead of mine, ofc by changing the graphics compiler to the windows version..
I can try reproducing this on monday in visual studio 2019. Have you tried to see if the errors are present in both release mode and debug mode? Might also have something to do with the 32 bit vs 64 bit binary for glfw.
It could be something related to this: discourse.glfw.org/t/setting-up-glfw-on-visual-studio/1344/2
I'm not super familiar with visual studio though so I'll have to try some stuff out when I have the chance. But my guess is that your code isn't the problem, and its more to do with the project configuration and setup.
Thank you!!
Any video editor like that for windows ?
Yes I use DaVinci resolve to edit the videos
pretty good
Do you have idea how to use GLSL with Metal ?
No sorry, I’ve no direct experience with Metal
Fallen at the final hurdle, getting following in xcode
terminating with uncaught exception of type std::runtime_error: failed to open file simple_shader.vert.spv
terminating with uncaught exception of type std::runtime_error: failed to open file simple_shader.vert.spv
Are your shaders compiled and make sure the file path is correct. Might try using an absolute path rather than the relative file path
Annoying because the frag.spv and vert.spv files both exist and have data in them.
@@BrendanGalea Of course of course Mr B..should know by now that my machine likes the absolute...
Vertex Shader code size 1164
Fragment Shader code size 424
@@BrendanGalea This helped me sooooooooo much
@@dalegriffiths3628 this helped me sooooooo much
The full series of tutorial videos: ua-cam.com/video/Y9U9IE0gVHA/v-deo.html
why does vulkan litearlly look mcuh simpler than opengl
It's more modern. I really wish more learning resources would be available for Vulkan. OpenGL has much more.
this is a bit embarrassing but if you get a "Debug Error -Abort() Has Been Called" error you may want to check line 15 in your lve_pipeline.cpp and make sure you typed "std::ifstream" and not "std::fstream". i didnt know what was causing this for atleast 30 minutes lmao
thanks for sharing! We’ve all been there lol😣