Thank you so much, i've struggled getting my compute shaders to work and with the help of you, they now work :)
@VictorGordan2 жыл бұрын
Good to hear! :)
@jakestein85162 жыл бұрын
Perfect timing. I was just starting to play around with compute shaders this week.
@VictorGordan2 жыл бұрын
Hopefully you learnt some new stuff ;)
@codeblend52252 жыл бұрын
You are simply amazing. Even a person like me gets everything (when explained by you).
@codeblend52252 жыл бұрын
btw, I like using Visual Studio Code more. Is there any way to do OpenGL dev in Visual Studio Code.
@VictorGordan2 жыл бұрын
Yeah, for sure. But I don't know how to link C++ libraries in VS Code, you'll have to look that up. But it is possible!
@mitchellkelly2412 жыл бұрын
Every time I come back to the channel the production just keeps getting better and better! I have always wondered how to do animation within OpenGL. Would animation or something along those lines be possible as a tutorial in the future? Thank you for your hard work!
@VictorGordan2 жыл бұрын
Yeah, I'll for sure do an animation series at one point, but right now it's not on my priority list :c
@rose955242 жыл бұрын
Thank you soo much for these compute shader videos!! They are absolutely amazing and by far the best resource I've found for making compute shaders :D
@VictorGordan2 жыл бұрын
Awww, thank you! Also, cute profile pic :)
@kylevondra2 жыл бұрын
As usual, another banger video. Love to see it, keep up the great work!!
@VictorGordan2 жыл бұрын
Thank you for your continuous support! :)
@krakacats7532 Жыл бұрын
i hit the 1k like, haha. Also very great video! I really couldnt find anything useful online for learning compute shader, but this really helped me understand it. Thanks
@jawadch87232 жыл бұрын
Amazing video! Covered everything I needed!
@VictorGordan2 жыл бұрын
Glad to hear that! If u made smth cool feel free to share it on my Discord server, I like to see what u guys make using my tuts :)
@jawadch87232 жыл бұрын
@@VictorGordan Sure!
@jeffcummings38422 жыл бұрын
Great explanation, thanks! I decided that maybe I was ready for compute shaders, but now I know that's still a bit of a ways away, but within reach, and this helps with understanding when I may actually need them, however experimentation is warranted! Thanks again.
@VictorGordan2 жыл бұрын
You're welcome! Ray-marching or ray-tracing could be a good start for compute shaders ;) Alternatively, for a non-render use, check out my "planes" video from the procedural generation series. I make use of compute shaders there to vastly improve the generation of planes with high triangle counts!
@jeffcummings38422 жыл бұрын
@@VictorGordan nice, i'll have to check that out!
@Trandunz2 жыл бұрын
Love your work Victor, i can still hear your voice when im doing my opengl :)
@clemdemort96132 жыл бұрын
Very nice of you to put a like counter in the description of your video! :)
@VictorGordan2 жыл бұрын
Someone has to do it since KZbin gave up on it haha
@SirCobraXI9 ай бұрын
7:55 Hey, so this caused quite a bit confusion to me. So i did some research and it seems barrier() has implicit shared memory synchronization, so the other call is not needed. However, this seems to not apply for other types of memory, for which you may still need an extra sync call. Also sadly it is not possible to sync a global memory between all thread groups because they are not always executed at the same time.
@chris_burrows2 жыл бұрын
Epic. Thank you Victor.
@VictorGordan2 жыл бұрын
You're welcome :)
@TheRoy7142 жыл бұрын
Awesome tutorial
@VictorGordan2 жыл бұрын
Thank you! :)
@hamimmahmud57772 жыл бұрын
Keep up the good work
@VictorGordan2 жыл бұрын
Thx :,)
@hamimmahmud57772 жыл бұрын
Welcome
@darkarchon892 жыл бұрын
Great video. This clarified a lot of things that mystified me the past couple of days. Question about 5:08 where you normalize the range from [0,1] to [-1,1]. Is this to match OpenGL clip space, or is there another purpose?
@VictorGordan2 жыл бұрын
Good to hear :) And yes, it is because of OpenGL's clip space!
@dmitrykolesnikovich2 жыл бұрын
good visuals i am enjoying it
@VictorGordan2 жыл бұрын
Thanks!
@alwinjjoseph8882 жыл бұрын
Thanks for the content.
@VictorGordan2 жыл бұрын
You are welcome! :)
@kalebbruwer2 жыл бұрын
Thanks. I was missing one line: glUseProgram() and a small eternity later I figured that out thanks to this video
@VictorGordan2 жыл бұрын
U're welcome :)
@bithigh83012 жыл бұрын
I've just subscribe!! Awesome video! btw, which video editor do you use? thanks for sharing
@VictorGordan2 жыл бұрын
Thx for the sub! :) I'm using Adobe Premiere for editing and Adobe After Effects for animating
@myth0genesis Жыл бұрын
Will there be a step-by-step video about how to make one of these from scratch in, say, VS 2022 and C++ (in keeping with your earlier shader programming series)?
@VictorGordan Жыл бұрын
It should be pretty much the same thing, no? Or did VS 2022 change that many things?
@myth0genesis Жыл бұрын
@@VictorGordan No, VS 2022 didn't really change much as far as I can tell. I meant will you have a tutorial to make a compute shader from the beginning in general? VS 2022 and C++ were just used as examples for illustrative purposes. I don't really know where any of the code goes (I always use IDEs like shadertoy and SHADERed or Unreal Engine to do shader programming, so I've largely been able to get away with not having to hook it into a C++ program from scratch).
@VictorGordan Жыл бұрын
Ah, I already have tutorials for that. My OpenGL tutorials go through that process ;) specifically the first 3/4 tutorials!
@myth0genesis Жыл бұрын
@@VictorGordan Okay. Thanks for that. Sorry for the seemingly needless question, then. I'm already working alongside the tutorials as I suspected this might have been the case. Everything up to episode 3 is working out (even with VS 2022 and Glad for OpenGL 4.6 instead of 3.3, with the appropriate changes to the major and minor version numbers in the code, of course). Great job making things clear and easy to understand! I'm hoping to be able to remake some popular statistical tests for 128-bit hash functions so they can run on GPUs (to test some of my own out). It seems like all existing batteries of tests I came across are CPU-bound and would take forever to test a good sample size (in the 128-bit cases), so I'm hoping to leverage the parallelism of the GPU compute pipeline to speed things up a bit (or at least it'd be fun to try).
@VictorGordan Жыл бұрын
Don't worry about the question haha Good luck with the GPU porting ;)
@dimitrisspiridonidis32842 жыл бұрын
very good job 👍
@VictorGordan2 жыл бұрын
Thank you! :d
@codeblend52252 жыл бұрын
Thanks! I will.
@floriansteinmann72702 жыл бұрын
Hey can you please show us how to make a galaxy shader Should worl similar to endportal shader in minecraft if possiblr
@0xbinarylol Жыл бұрын
How to provide input as nxn matrix and n size vector and multiply then output
@VictorGordan Жыл бұрын
For matrices up to 4x4 you should be able to just use uniforms. For matrices over that size I think you'll have to send the matrix as an array and then make some custom functions that interpret the array as an matrix. But who knows, there might be an easier way out there, not sure :(
@arkadiymel59872 жыл бұрын
5:04 it seems that gl_LocalInvocationID should actually be gl_GlobalInvocationID.
@VictorGordan2 жыл бұрын
Yup, I think you're correct... oops :/
@blaarkies2 жыл бұрын
A good example where this is extremely useful is if you have to do n-body gravity simulations, that is, calculate a value between every object and every other object in the game world, and in the end add up all the values for each object (to find the force applied to each object by gravity). Where normal CPUs can handle a few 100 objects before losing framerate, i bet compute shaders can handle thousands of these
@VictorGordan2 жыл бұрын
Yeah, 100%. If written smartly I bet it can go up to tens of thousands or more (just a guess tho)
@gergelybertalan51812 жыл бұрын
@Victor this is awesome! Where do you learn these things from?
@VictorGordan2 жыл бұрын
Tutorials hidden throughout the internet, stackoverflow, and very imporant, the official documentation ;)
@floriansteinmann72702 жыл бұрын
Could you please do a tutorial on how to make a grass shader which doesnt only repeat the texture but brings in variation with multiple textures I think the key is noise maps
@VictorGordan2 жыл бұрын
Yeah, I'll make a tutorial on that at some point! It will be part of my procedural generation series which will actually get it's second episode in a week or so ;)
@floriansteinmann72702 жыл бұрын
@@VictorGordan thats cool ty
@TristanPopken2 жыл бұрын
Hey, thank you for the great tutorial. I finnaly got to make a working compute shader. One question though, it seems like the more invocations and the less work groups, the better the performace is. For example, i get the best performance with x=32 y=32. Why exactly is that?
@VictorGordan2 жыл бұрын
Good to hear that, I'm glad u found it helpful! Tbh I don't fully understand it myself, but as far as I know it will depend from project to project. So even though 32x32 might seem to give the best performance in this case, it might not in other cases. Basically work groups aren't rly done in parallel at the exact same time, but invocations sort of are, so that's a very rough idea as to why more invocations result in better performance. But it will likely differ as I said. Plus that sometimes you simply want certain sizes for the invocations to deal with non-visual stuff, so more invocations does not mean better performance ;)
@alexandru-cristiansandu10162 жыл бұрын
Interesting tutorial for some of the more modern capabilities of OpenGL, you definitely become better at making such videos!
@VictorGordan2 жыл бұрын
Mersi! :)
@featherless6562 жыл бұрын
@VictorGordan , I'm stuck on the 5th tutorial, the only way I could get you to see is to comment on your latest video, whenever I run the program the triangle is white, could you help me with this?(The shader files and code is perfect)
@VictorGordan2 жыл бұрын
I've seen your comment before, but I wasn't sure what to answer. The most common problem when this happens, is a typo. Lots of people have told me they followed perfectly, but 90% of the time they do find a typo. Another problem might be that you said you changed some directories. Since the triangle is displayed in the first place, it's likely a problem with the fragment shader. Or it might have to do with the vertex attributes. Not sure what else it could be :(
@featherless6562 жыл бұрын
@@VictorGordan It might be my driver for my graphics card, not sure.
@VictorGordan2 жыл бұрын
I also thought of that, but then I think the vertex shader would also not work...
@featherless6562 жыл бұрын
@@VictorGordan another thing I thought of was the #330 core, I thought that maybe because I had gotten glfw 3.3.6 it wasn’t working
@VictorGordan2 жыл бұрын
It shouldn't matter
@nickgennady2 жыл бұрын
So how does OpenGL compare to Vulkin? Also OpenGL does not run on Apple products right? Must be annoying to a certain extent.
@VictorGordan2 жыл бұрын
I think anything up to OpenGL 4.1 runs on Mac, but not the newer versions. But if u're going to make games for example, u wouldn't rly care about Mac since almost nobody games on a Mac. As for how it compares to Vulkan? Vulkan is a lot more syntax heavy. U have to write a lot more boilerplate code and take care of a lot more GPU details to render stuff. OpenGL is simpler in that regards, but because you have less control over the miniscule parts of your GPU it can also be less performant in some situations. If you are a beginner, 100% go for OpenGL. It will teach you all the basics and make it much easier to transition to Vulkan. Keep in mind tho that in terms of graphics, both can look "better" than the other. It really depends on the code you write. OpenGL just dosen't have some of the bleeding edge stuff like RTX support and other things. U're unlikely to use those as a noob.
@KangJangkrik2 жыл бұрын
Will it support ARM devices like raspberry pi and cheap SoC like Allwinner h6?
@VictorGordan2 жыл бұрын
I don't think so since they don't have a GPU as far as I know, and I doubt the CPU supports OpenGL 4 or higher :(
@KangJangkrik2 жыл бұрын
@@VictorGordan raspberry pi 4 has two GPUs actually, VC6 and V3D. Currently supports Vulkan but experimental. I don't know about latest supported OpenGL version, too much mixed information.
@spookyghostking6082 жыл бұрын
God bless!
@VictorGordan2 жыл бұрын
Amen!
@shinystick2412 жыл бұрын
When 3d physics?
@VictorGordan2 жыл бұрын
I don't know tbh. It's not a priority right now, but it will come for sure!
@webgpu Жыл бұрын
GUYS. IF YOU WANT TO BE UP TO DATE ON COMPUTE SHADERS: INVEST YOUR TIME LEARNING WGSL (WebGPU's Compute Shader). one of the advantages is that the text (ascii file) with the shader code can be run instantly (with an html helper) in anyone's browser without needing any compiler. -- if you were wondering, the "native" code you're writing now (c++ + opengl) can be already ported "in full" to typescript + webgpu (ie, a web app
@mccrackhead18326 ай бұрын
I don't like you
@Jkauppa2 жыл бұрын
why webgl 1.0 has to be so stupid formatted
@Jkauppa2 жыл бұрын
languages are not made to get things done, they are only for a show
@Jkauppa2 жыл бұрын
pride kills languages and anything good
@arlynwalker99012 жыл бұрын
s/o to you from china bro, working absolutely well