This better be the most beautiful triangle ive ever seen...
@carrapaz36454 жыл бұрын
it will be, every dumpling it's beautifull for his mum
@dualperception42964 жыл бұрын
You havent tried vulkan yet have you?
@marcovalentinoalvarado32904 жыл бұрын
I drawn a rectangle cause im badass
@ijojoi72263 жыл бұрын
@@dualperception4296 No, he hasn't
@058w.3 жыл бұрын
@Drake Lionel yea it works 100% guys. just give your social security bank account and credit card/paypal password. remember to sell your house and car or whatever else you have and deposit money to your bank account. it works better this way. only con is that you go bankrupt or homeless but hey you gotta compromise something too , right
@arondejong65157 жыл бұрын
Best C++ and OpenGL tutorials EVER!
@machine0man4 жыл бұрын
Other KZbinrs : Uses Drawings to Explain The Cherno : Just talk and Draws on Viewer's Mind
@SpiteAnims2 жыл бұрын
Couldn't've said it better
@Yazan_Majdalawi2 жыл бұрын
The movement of his hands help with that
@HungryEagle26108 ай бұрын
Legend of TheCherno
@DridriLaBastos7 жыл бұрын
OH YEAH TRIANGLE, THE NEXT TIME I WILL SEE YOU !!!
@spencerfreebairn93466 жыл бұрын
"... on the fly shader generation..." As if my mind weren't blown enough already. I'm loving these videos! You are an amazing teacher! You go in depth but always remain within the scope of the discussion. Excellent.
@eloquentlyemma7 жыл бұрын
Thank you for this video. It has helped me clarify a few things in my mind. I'm going to go back and look at my own shader code now that you pointed out how many times the fragment shader is run in comparison to the vertex shader (I have a nasty feeling that my code will need a rewrite). It just those simple obvious pieces of information that can make such a difference. Also, I can't wait for when you show us more complex shaders.
@goncalosoares84837 жыл бұрын
I'm having a college class on computer graphics and these videos are helping a lot! Please keep up the great work
@adityaranigaon4 жыл бұрын
Same
@biskitpagla3 жыл бұрын
us
@Noey145 Жыл бұрын
Leiria?
@ghw2402 Жыл бұрын
so you graduated?
@goncalosoares8483 Жыл бұрын
@@ghw2402 ahah yes I did, and I'm currently working at Envar Studio
@Rasenganist4 жыл бұрын
@6:24 ;) The beautifull thing for me is to see people making great tutorials and videos, helping other to improve their own skills. Thank you for that man! It is a pleasure to listen to your videos.
@denic68614 жыл бұрын
Beautifully explained. As somebody who has worked with shaders for the past 7 years, I am glad more light and accessible information is being tread on this amazing world of technology. I will be recommending this video to people for sure!
@nm5paczek5 жыл бұрын
Insane teaching skills, thank you
@yinhao40856 жыл бұрын
This is the most detailed explaination! Helps so much on visualising the shader pipeline!
@apfelstrudlOfOA2 жыл бұрын
I just stumbled upon this video by chanse, and I love your teaching style. You're extremely pedagogic in the way you teach. You repeat yourself with different wording and examples so we get different types of understandings for the same issue you're trying to teach, and it works tremendously! Great video!
@TinoBurset5 жыл бұрын
I'm 10 minutes in and just realized that there were no cuts in the video, with an spectacular and well paced explanation. Simply amazing content man!
@bumpsy4 жыл бұрын
there are SO many cuts in Cherno videos xD he very often only says one sentence per cut but he cuts cleverly to not disturb the audio too much so it seems like he's talking in one stream
@TinoBurset4 жыл бұрын
@@bumpsy You are absolutely right! 😆 I guess that it _felt_ that way at the time.
@maugre3163 жыл бұрын
@@TinoBurset Just noticed one at 2:36, but there are more. I guess one way round it is to use multiple cameras and switch between them but the actual content is the important thing.
@dot323 жыл бұрын
there is one two seconds later at 10:02 lmao
@JayAnAm6 жыл бұрын
Very good explanation, just subscribed!
@arslantariq895 жыл бұрын
And I am your subscriber!!!! lol
@B4RN154N6 жыл бұрын
Man, the quality of your videos is just amazing. Keep up the good work!
@specialgorilla3 жыл бұрын
I have never found such a clear and thorough explanation of this anywhere else. Thank you for making this.
@mitcaro73102 жыл бұрын
I spent a semester on a GPU programming course at my university and didn't get a word of what our "experienced" professor said! Even until the end of the semester, I didn't know what shader or even OpenGL is. I hated that course. But now with only 6 short videos, BANG, everything makes sense and is easy to understand. Come to Switzerland and become a university professor Cherno. You're just fantastic.
@AmeshaSpentaArmaiti7 жыл бұрын
I didn't know shaders were generated on the fly. That's pretty cool.
@deletevil4 жыл бұрын
what do you think happens when you go forward holding a flashlight/torch and the intensity of the light on the wall before you increases lol?
@AmeshaSpentaArmaiti4 жыл бұрын
@@deletevil That's not generating an entire System-specific shader during runtime. that's just a shader.
@deletevil4 жыл бұрын
@@AmeshaSpentaArmaiti , aah okay, thanks. I am a noob learning.
@generichuman_3 жыл бұрын
@@deletevil then why would you say that with such confidence if you're just learning? A little humility goes a long way
@deletevil3 жыл бұрын
@@generichuman_ and what are 'you' gaining from by replaying to a noob like that?
@spookier4444 жыл бұрын
he got Electronic Arts team perform every intro
@kevingergely24624 жыл бұрын
I will soon start working with openGl and your videos are really good to refresh my memory with it. Thank you for the awesome tutorials.
@panaah303 жыл бұрын
You explain so clearly ❤️ Keep doing this ❤️🙂
@siddharthgpta6 жыл бұрын
In the beginning you were explaining that glDrawArrays draws the currently bound VertexBuffer, but just above the while loop you've bound it to 0. How is it still drawing the triangle in this case?
@olfmombach2605 жыл бұрын
That's also what I didn't get
@rialseebran20725 жыл бұрын
the glBindBuffer(0) unbinds the buffer. After this we can write to the buffer
@paoloose Жыл бұрын
This got me thinking. I found this in the docs: Buffer object names are unsigned integers. The value zero is reserved, but there is no default buffer object for each buffer object target. Instead, buffer set to zero effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target (if supported for that target). Buffer object names and the corresponding buffer object contents are local to the shared object space of the current GL rendering context; two rendering contexts share buffer object names only if they explicitly enable sharing between contexts through the appropriate GL windows interfaces functions. But don't exactly know what it means in the last part
@eliaspr81247 жыл бұрын
I'd say you forgot a cut at 3:10
@shashanktambe63416 ай бұрын
ye ye he deffo forgor
@timothyvandyke95114 жыл бұрын
"When it comes time to optimize and think about performance, which is really all the time" Thank you for making me feel less crazy.
@shunnie84826 ай бұрын
Great explanation. I think its a great idea to give examples with modern game engines as well, in Unity or Unreal (in Unity->Shadergraph, in Unreal->Material Editor) you are actually making fragment shaders. There is also a part where you can also specify vertex positions as well, thats the vertex shader. In Unreal thats World Offset in the Material Editor. In Unity, if you are writing a shader completely in HLSL, you can also access the vertex shader, and you can see that all it does is get the world positions and then multiply them by the MVP matrix (model view projection matrix) to get the position it needs to have on the screen. For me it clicked when I saw these things in the programs I use everyday. I hope it helps someone trying to understand them as well.
@RudolfCickoMusic Жыл бұрын
So in summary. - Vertex shader is called for each vertex. (used just for position) - Fragment shader (pixel shader) runs for each pixel that has to be rasterised.
@shashanktambe63416 ай бұрын
What is rasterisation?
@RudolfCickoMusic6 ай бұрын
@@shashanktambe6341 Basically a vector function like you have in math. For example y = 2x where x = {1..10} all the pixels from (1,2) to (10, 20) will be rasterized.
@shashanktambe63416 ай бұрын
@@RudolfCickoMusic thanks for coming back to comment
@beterax3 жыл бұрын
I really love that this does not feels like someone reading a Wikipedia page to me. I really love how you explain the fundamentals and why we use them as well to make sense. Thanks a lot for these videos man!
@moichumoirunescape Жыл бұрын
Your explanations are so clear and easy to understand! Thank you so much for this series, it's really awesome. :)
@greebly60118 ай бұрын
not even drawing or using animations and this still is one of the best explanations
@zaspanyflegmatyk24465 жыл бұрын
when i hear "shaders" all that comes to my mind are Minecraft shaders
@xtdycxtfuv93534 жыл бұрын
kek same
@miles72674 жыл бұрын
and they have to be written in code too
@andresvallelisboa55114 жыл бұрын
That is because Minecraft uses them, they allow you to do amazing stuff.
@Damoygames7 жыл бұрын
Sunday: (TheCherno && ThinMatrix ) == Kreygasm
@KennyTutorials5 жыл бұрын
@@lufenmartofilia5804 Two best on my option teachers EVER! And also awesome guys! (TheChernoMatrix)
@MaruskaStarshaya5 жыл бұрын
The best explanation in the internet
@JimmyTheZombie1157 жыл бұрын
When I was thinking of OpenGL... THIS came out! Nice!
@navegct84577 жыл бұрын
yep. same dude!
@fenilli7 жыл бұрын
sadly is not everyday
@mukeshpareek54146 жыл бұрын
Hi I have question here from opengl series video number 5 glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, 6*sizeof(float),position,GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 2, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); // Why still we see Triangle rendered even we are unbinding the buffer here? can anyone please help me to understand?
@SaravanaKumar-nl4sz7 жыл бұрын
clean and clear intro for shader. Keep doing
@arkemal Жыл бұрын
Can't wait to create my first Shader. Thanks!
@tahseensaad78607 жыл бұрын
You made me think now! And visualize without coding or learning anything!
@kenan23863 жыл бұрын
My man making an OpenGL Tutorial Series i would have gave up if you didn't make a series *keep up*
@ironichoneybadger50663 ай бұрын
I'm coming to this series in 2024, and the comments all being in agreement that this tutorial is what we all needed to learn this skill is so entertaining to me
@justchris8466 жыл бұрын
These videos, excellent quality.
@iHouqLF2 жыл бұрын
My possibilities are exploding right now. Thanks for the awesome tutorials! :D
@miteshsharma31067 жыл бұрын
Can you please make a video about unions in your c++ series
@Ahmed-wj5sd7 жыл бұрын
Mitesh Sharma he already did in the sparky engine series 5.5
@aakashs1806 Жыл бұрын
I had a subject named computer graphics in my post graduate. My teacher didnt teach, but was strict in class, telling to write notes record note so on. Literally saying, you are teaching so good.
@fraenkfurt5 жыл бұрын
your hands are freaking me out but by purely listining to you it's excellent! thanks so much!
@Youngduck933 жыл бұрын
Thank you so much for the quality content!
@darkphoenix682 жыл бұрын
I'm trying to get up to speed in OpenGL, and was looking for something on shaders. Found this video, and was so impressed I'm now working through the entire playlist. I'd originally avoided it because I'm actually working in Go -- but I figured, what the heck, apart from a few language-specific differences, it all works basically the same; sure, I can translate from C++ (which I've not used for literally decades) to Go (which I've only just begun tinkering with...) :-) Wrapping my head around three-four languages at once is about par for the course! ;-)
@jellykisses96417 жыл бұрын
Would it be practical to save compiled shaders (programs are saved as .exe) instead of compiling each time the program runs?
@ChrisHorner_WCC7 жыл бұрын
I don't think that's possible, as the result of the compilation may be driver-dependant. Plus I don't think OpenGL provides any way to actually copy those compiled shaders to the GPU memory.
@platin21487 жыл бұрын
You could do that but this will bind the shader to your graphics card as it uses the compiler in the graphics driver to compile your code to the graphics card. And no the program gets only compiled once only if you add glCompileShader to the loop it would do that else you could use the program handle. Also there is a platform independent way to compile you shader the output is then called SpirV shader assembly.
@daniilvinnik44503 жыл бұрын
I don't really think i can ever find such easy-understandable tutorial about OpenGL and Graphics Programming, which is really complicated by itself. Aah, and of course: drawing the best triangle in my life is priceless :)
@navegct84577 жыл бұрын
#Notifacation Squad!!!!
@navegct84577 жыл бұрын
you are my favorite KZbinr ever!!!!
@navegct84577 жыл бұрын
Cherno
@TheCherno7 жыл бұрын
@navegct84577 жыл бұрын
@wacko1jacko6992 жыл бұрын
This is fantastic! love this explanation!
@hyla42544 жыл бұрын
Thank you! Your explanation is very easy to understand.
@satomi85004 жыл бұрын
Thanks man, you are really good teacher.
@agustinlawtaro5 жыл бұрын
Sos crack, colorado. Gracias!
@RedstoneHair2 жыл бұрын
ah yes, an entire video (without coding) just explaining shaders. I love your explanations!!
@phanisrikar71914 жыл бұрын
So I was reading this on learnopenLG and did try it that I cannot render the vertex budder object unless I have it binded to an vertex array object, idk if this is specific to a Mac or not. I'd really like to know if it is necessary to use a VAO before using any VBO to render anything at all??? Ahhh.... save me from this confusion.
@bfkmnemonic2 жыл бұрын
I have a difficult time expressing how much I enjoy these videos. That said it is meant in a strictly non-stocker way... Obviously...
@ianmoseley99104 жыл бұрын
So, at the simplest level, the vertex buffer details where vertices are in relation to each other, the vertex shaders determine where they are in relation to the screen?
@generichuman_3 жыл бұрын
If position is the only data in the buffer, then yes, you could think of them as coordinates in local space. The shader then has transformations to change that to world space, screen space, etc.
@Lordp00m5 жыл бұрын
Question: Do you only have one vertexshader and one fragment shader for all your mesh? Let say you have a 3D mesh shader. Do you need to make a new one for a 2D mesh? What about if you have a shader which handles lighting. Do you use the same shader to handle objects which you don't want to be lighted or do you create new shaders for all the different cases?
@ycombinator7652 жыл бұрын
I love his hoodie
@gimmemoreborisbrejcha97945 жыл бұрын
You are doing something "good" for the society. Appreciate it.
@shatakshimishra48424 жыл бұрын
Hii Cherno.. I need to render camera captured images using fragment shaders, the camera inputs and parameters come from a structure in another file, I need to pass them to my shader class and render them. There are 4 cameras. How do I do it please help me. I have seen many tutorials where they are using some functions to load the image, where we specify file path, but that is only for 1 file. I have 4 camera data's. I'm finding it difficult. Can you please help me?
@aaronh2484 жыл бұрын
One thing I wonder about current GPUs is why they are still reliant on the CPU performing draw calls. Wouldn't it be more efficient to be able to tell the GPU directly via some sort of programmable function when to draw stuff? With how busy the CPU already is it seems like alot of work added to the CPU to constantly have to perform draw calls to make the GPU do its job. Maybe I'm just too much of a newb but it just sounds like alot of work for the CPU that could just be done by a processor within the GPU itself
@alexdomenici85036 жыл бұрын
You have a gift for explaining things. Keep up the excellent work, we're tuned in :D
@hasbroboy877 жыл бұрын
Is the fragment shader run for each pixel of the display, or for each pixel of a triangle/shape? As in, if I have a drawing area that is 1280x720 and 3 triangles all in the same exact spot that cover, say, 50 pixels worth of the display, will the fragment shader be called 921,600 times (1280 times 720), 150 times (because 3 triangles cover 50 pixels each), or just 50 times (because all 3 affect the same pixels)?
@creature_of_fur7 жыл бұрын
150 times. EXCEPT if you have depth buffer enabled. In which case GPU may consider not to call fragment shader for the pixels which have their z-value less than in a buffer. What is z-buffer? Its a thing that OpenGL uses to prevent things behind other things to get drawn. (great explanation)
@Chris-cs7nv Жыл бұрын
How come that's happening: Yes, but now shouldn't this fail because the buffer is unbound? Did I really hallucinate that in a previous video it was said that if we unbind the buffer then opengl will not draw anything?
@cptray-steam3 жыл бұрын
I feel like I'm learning so much!
@jakubhorak6365 жыл бұрын
How is it possible that it worked in the beginning although we have bound buffer 0 before start of the while loop? I thought (and I think he has even said it in the end of the episode before the previous episode) that it will not work like this because we have to bind the right buffer in order... I am confused, could you please explain it to me?
@TheKingoftheriff5 жыл бұрын
think of binding the buffer as a rotating bridge. Once the data has been sent to GL_ARRAY_BUFFER(&buffername), the bridge to the &buffername is no longer needed and can be reset or set to another buffer. Setting it to 0 is one way to prevent accidental data transfer to the wrong place.
@jakubhorak6365 жыл бұрын
@@TheKingoftheriff thanks for answer, but how does then opengl know which buffer to use if I uploaded more vertex buffers. I thought it always uses the bound vertex buffer.
@TheKingoftheriff5 жыл бұрын
@@jakubhorak636 AFAIK, the draw function that outputs all the poly work, will put all the saved buffers on the screen. You only need &buffername while sending data. Currently all of it is stored in GL_ARRAY_BUFFER, which is like an area for all the buffers that belong to that type.
@tuxmusicman6 жыл бұрын
Sooooooooo much information!
@himanshupoddar13955 ай бұрын
In the plain old architecture we used to provide even the coordinates of vertex in the draw call, now it has been replaced by buffer and shaders. Why???
@remak63424 жыл бұрын
great video again
@Meddten4 жыл бұрын
Why is the Triangle Rendering? The buffer ist not bound because of the glBindBuffer(GL_ARRAY_BUFFER, 0);
@creature_of_fur7 жыл бұрын
I had a problem with OpenGL ES1.1 on my tablet. My app wouldn't draw anything. Which lets me to believe that compiling shaders is mandatory. But the shader functions arent in the opengles1.1 header! And my question is, how do I deal with this situation? I was trying to solve this program for around 2 yeras now (not really trying all that time, because I switched to developing the PC game) Any help?
@scewps7 жыл бұрын
OpenGL 1.1 and OpenGL ES 1.1 don't support shaders. You need to use at least GL ES 2.0 I think
@NikhilKumar-ry7eg4 жыл бұрын
where is your say thanks link?
@lllll694 жыл бұрын
i love cherno video thanks
@aqua1236706 жыл бұрын
Greatt, thanks. You should write the opengl documentation
@AkshayAradhya6 жыл бұрын
Love your videos
@BlackJar727 жыл бұрын
Other tutorials just assume this will work -- so that I took it that the default shader was a universal hold-over from the pre-shader era.
@duckymomo360 Жыл бұрын
yo i am eating a cadbury egg while watchin this. this is awesome
@clodgozon39685 жыл бұрын
I drew a quad on a screen without help... It means I understood your lessons well.
@vnaqr5 жыл бұрын
ARE YOU SURE??? IT'S ACTUALLY NOT A TRIANGLE?
@sleep30174 жыл бұрын
I always watch through all the ads so he can get his money
@0xfrijolito3 жыл бұрын
Whats shaders i need to mine with my gpu?
@gamereplayhq6 жыл бұрын
The quality is at par with the course I'm taking at edx (Computer Graphics), in fact way better as compared to that course. B-)
@Sl33pySt3rdust5 ай бұрын
everytime i hear the word "shader" i instantly think of minecraft
@eliasf.fyksen58383 жыл бұрын
Watching that "glBindBuffer(GL_ARRAY_BUFFER, 0);" line is just killing me
@larko29333 жыл бұрын
Consider that line as a function to unbind the buffer. You are just telling OpenGL that your bound buffer is 0, so nothing
@micro4797 жыл бұрын
what's intro music name?
@johnrussell69714 жыл бұрын
What's the language of a shader?
@ahaququq6 ай бұрын
on NV works too
@gordonlim23224 жыл бұрын
program that runs on GPU
@czirjakmarton5 жыл бұрын
Is this projekt avaible on github?
@mysticfakir20294 жыл бұрын
The fragment shader only does one thing, decide what colour each pixel will be. That's all it does... That one simple task........
@koenderbb51914 жыл бұрын
3:09 you forgot to cut there, man
@milo200602 жыл бұрын
Ahaa. So basically vertex shader = the outline fragment shader = what comes in.
@blackswordsman60944 жыл бұрын
Mine doesn't have a default shader then......
@saranh16873 жыл бұрын
cherno reminds me of that city,chernobil
@Jkauppa2 жыл бұрын
write the vertical camera plane-ray intersection raster shader
@Jkauppa2 жыл бұрын
yes per primitive, triangle (strip)
@Jkauppa2 жыл бұрын
you can easily limit which plane-rays hit the triangle, left-right bounds
@Jkauppa2 жыл бұрын
keep the z-buffer
@Jkauppa2 жыл бұрын
why you are kidding
@Jkauppa2 жыл бұрын
make the plane ray-limiting in the vertex shader, it can be zero intersections (primitive skip)