I think I've never seen a tutorial as concise and well explained as this one. Pretty nice job!
@VictorGordan4 жыл бұрын
Thank you so much! I'm glad this helped someone :)
@mitchellkelly2413 жыл бұрын
Criminally underrated series, amazing work!
@VictorGordan3 жыл бұрын
Thank you! :d
@CHESShireCat5 күн бұрын
See this is exactly what I wanted to learn from my professor. But he kind of just dropped us into the deep end with no explanation. Thanks for the tutorials you are the only hope for me to pass this class.
@Phidelux3 жыл бұрын
Love your series. Small hint here. C++11 introduced raw string literals, which is a really nice feature for multiline string definitions: const char* vs = R"glsl( #version 330 core layout(location = 0) in vec4 aPos; void main() { gl_Position = aPos; } )glsl"; Additionally C/C++ string literals are automatically null terminated. Thus, adding a `\0` at the end of the string literal explicitly, will lead to a one byte larger string literal containing two null bytes at the end.
@VictorGordan3 жыл бұрын
Thanks! Yeah, I've found out about the R" thing a while ago haha ;)
@shubhabrotapal47099 ай бұрын
Super beginner friendly tutorial, code comments at the end are cherry on top ❤❤❤
@LowRezCat Жыл бұрын
For those who start their journey: This video is the really big step you should do, and once you overcome this challenge, you will go far. You might not see huge results for now. But trust me, you got it! ♥
@nikitaavramov6519 Жыл бұрын
hope you are right. I felt like Victor was talking Chinese for half of this video. I have been using After Effects, Photoshop and illustrator. Went through a course of c/c++ and even played around with MASM and made a program that changes pixels on screen when you move your mouse over them (in a virtual box emulating 16 bit DOS os). But still most of these concepts were foreign to me (shaders?). Felt like there is some context to this tutorial I missed. Should I have background somewhere before I continue this series?
@VictorGordan Жыл бұрын
@@nikitaavramov6519 the only background knowledge you need is C++. Don't worry if some things don't make sense now. Continue and they might click in later. Also try to do the exercises from the GitHub repo, that might help ;)
@seanmaddows9790 Жыл бұрын
Thanks for the advice, this is a tough one.
@prakhargupta1745 Жыл бұрын
hopefully it gets easier, because this is challenging
@LowRezCat Жыл бұрын
@@prakhargupta1745 It is the harder part (at least from my experience), everything else is just calling gl function and understanding C++ better. One tip from me: try to really *read* into things, take your time and analyse your every step. Good luck with you jorney!
@yutsuneko2 жыл бұрын
Ok I finally got it working, now I'm gonna watch the video on repeat and try to understand everything I missed out. Thanks!
@VictorGordan2 жыл бұрын
Good luck :d
@szabotudor3 жыл бұрын
This is awesome! I could never understand how VBOs and VAOs work until now.
@VictorGordan3 жыл бұрын
Glad I could help! :)
@menghanzhang Жыл бұрын
It's the best tutorial I have seen! I'm doing a year project using OpenGL, it's very useful for me. And what surprises me is that you can make it so clear in such a short time! Thank you very much!
@Combinehuntsmanunit2 ай бұрын
amazing tutorials man! i have already worked with open gl for many years using c# and this series helped me a lot while implementing everything again and is still my goto guide when dealing with errors. Amazing videos thanks man!
@VictorGordan3 жыл бұрын
If you are following the tutorials on a Mac and are getting unexpected errors, it might be because of your OS. Here is a possible fix Steve Hewson found: "With the help of a discord commuinity, I realised that it was to with my OS (macOS) Using: glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); after: glfwWindowHint(GLFW_OPENGL_CORE_PROFILE, GLFW_TRUE); resolved the issue. I used: std::cout
@Drmarcus93 жыл бұрын
This channel is so underrated, you deserve so much more man
@VictorGordan3 жыл бұрын
Thank you! :')
@BarkingFlame3 жыл бұрын
I appreciate this series! Thank you for sharing your knowledge
@VictorGordan3 жыл бұрын
No problem :)
@rigbyb Жыл бұрын
Your tutorials are so much better for understanding OpenGL. Thank you :)
@VictorGordan3 жыл бұрын
I accidentally deleted someone's comment. If you're reading this, sorry for that! Btw, the problem with your fragment shader was that you defined a vec4 but only plugged in 3 values instead of 4.
@anoldeyhrithik2 жыл бұрын
Literally, It is the best OpenGL tutorial I have ever watched. Keep it up 🔥🔥🔥🔥 !!
@dnox4282 жыл бұрын
i think i wouldn't start actually using openGL without you :D thanks mah boi
@dhruvagrawal38563 жыл бұрын
great opengl series! I learned c++ and wanted to learn opengl could not find any good tutorials but found you !!!!! at last I am learning it and can understand the code properly ,it is all thanks to you :)
@VictorGordan3 жыл бұрын
Thank you! Good luck with OpenGL :)
@dhruvagrawal38563 жыл бұрын
@@VictorGordan welcome victor, I had a doubt that how can I make smaller triangles......well I guess the number we give in the vertices array, it is the position (x and y ) of the points of triangle thus making 6 arguments 2 * 3 = 6, so I also guess that -1.0f is the left end of our window and 1.0f is the right end, so, I think I should keep the gap between the triangle small, thus resulting in a small triangle, So if this right pls tell me, and if this wrong, pls tell me what should I do Thank you : )......btw I like the exercises you post on your github
@VictorGordan3 жыл бұрын
Yes, you are correct, but you also need to change the y axis of the vertices. An easy way to get a smaller or bigger triangle is to multiply all vertices by a number. If you multiply by 2, it will be twice as big. If you multiply by 0.5, twice as small. Good to know someone actually does the exercises haha
@dhruvagrawal38563 жыл бұрын
@@VictorGordan Thank you for replying!!!! Thank you for the reply and I thought a lot of people must have done the exercises helps learning a lot of things........Well I had a doubt that when I complete the series I want to ask how can I make games with it?? mean how to make 2d game or 3d?? can I make a game by drawing the triangle and add collisions etc, Like I know all the stuff like how to make collision and the maths but I dont know how can I make things like infinite scrolling backgrounds, like I dont know how should I implement it and do stuff.Maybe I will learn this ahead in series. But pls rely to my questions...thank you : )
@dhruvagrawal38563 жыл бұрын
@@VictorGordan I also wanna know how to make two shapes in a same window??
@Napriiihm Жыл бұрын
Nice explanations and I like the training with the Exercises, thanks :)
@VictorGordan Жыл бұрын
Glad you looked at the exercises! :)
@shafagh_projects3 жыл бұрын
You made the best and super organized tutorial of the time. thank you so much
@VictorGordan3 жыл бұрын
Thank you! :]
@justcore69 Жыл бұрын
Thank you for the tutorial. It was very easy to follow and understand all of the code :)
@eenrandomkip2162 Жыл бұрын
Thank you so much you explain prety much everything perfectly
@ReleaseTheKraken257 ай бұрын
I want to kiss this man’s face. Great work, these are very well made and your effort shows. I really appreciate the time you spent making these for us and I am excited to continue the series ❤
@voytechj3 жыл бұрын
@10:50 I have doubts that the order of generating buffers is important, because it only allocates memory by a driver. The order that is important is binding VAO first and then call rest of the functions that modifies VAO as a side effect.
@VictorGordan3 жыл бұрын
Yes, I believe you are right, it is the binding that is important. That makes sense tbh
@juanma98682 жыл бұрын
With this i managed to draw a pentagon, and i feel like im sitting over my own brain. Your tutorial is fucking amazing and clear, thank you!!
@TtEL4 ай бұрын
12:00 Wouldn't you want to use the size of GLfloat and not float?
@jorgelinares19442 жыл бұрын
Great tutorial, love your channel! It inspired me and I have some plans to make a channel like yours taking some tips from your 1024 subs special video, thanks a lot!
@VictorGordan2 жыл бұрын
Good luck!
@ProUserGamer129 ай бұрын
all vscoder's please do not forget to #include library otherwise it will not define sqrt.
@raum_30355 ай бұрын
Thank you :D
@ProUserGamer125 ай бұрын
@@raum_3035 Welcome.
@_sharkdev_2 жыл бұрын
Great series, I've been taking notes! I am having a problem though - I believe I followed the tutorial as shown, but my triangle appears white instead of orange. Where may I have slipped and how could I fix it? Thanks! EDIT: I checked my code with your source code, and I had some things in the wrong order, but mainly I noticed the shader code at the start was missing the "void main() " portion - does that have anything to do with it? It worked after reorganizing and adding that to the shader codes
@VictorGordan2 жыл бұрын
Well, the "main()" function is the code that gets run, so since there was no main function in the fragment shader, nothing happened. The "main()" function is vital
Hey, I wanted to get familiar with OpenGL, but having watched this video I realized how little knowledge about all of these functions and objects I have. I have no idea what the things like VBO, VAO, binding buffers, creating some programs, vertex attributes etc. are. What do you think would be the best way to get familiar with these concepts? Going through the documentation, learning more about computer graphics or some other resources? Could you recommend anything?
@VictorGordan3 жыл бұрын
Yeah, these things can seem weird at first. But if you just continue on with the series you should start to get a feel for them. Reading the documentation also helps quite a bit. Basically just put them into practice and you'll get used to them ;)
@atzek3 жыл бұрын
@@VictorGordan All right, thanks for the reply :)
@x3n6628 ай бұрын
GOOD TUTORIAL but one side note... 13:08 For those who had an AMD cpu I recomend to not Delete the VBO
@Snail50083 жыл бұрын
This is awesome! :)
@VictorGordan3 жыл бұрын
Glad u think that! :D
@drimiteros_217 ай бұрын
Great video, I resently started messing around with Graphics programming and your videos are gold! I have a question, have you considered making another series using glew instead of glad? As far as I know, glew is easier to work with, but does not provide the flexibility of glad. I followed another tutorial that was using glew and I got to draw a triangle in no time.
@VictorGordan7 ай бұрын
You can use GLAD, doesn't rly make a difference for 99% of the tutorial series
@drimiteros_217 ай бұрын
@@VictorGordan Got it, thank you
@walidalrifai23263 жыл бұрын
I am a beginner for this language and I somehow understand the program but I want to know what function to add or change to change the triangle colour. thank you!!
@VictorGordan3 жыл бұрын
You need to modify the vec4 in FragColor in order to change the color of the triangle. In tutorial number 5 I talk more about Shaders (they deal with the colors on the screen). Thanks for watching!
@DidIJustDoThat6 ай бұрын
A while back in math class I was doing simultaneous equations and got that 27 equals to 9(I don't know what was in my mind ). This is how I feel like after watching this video. I have tried reading the learn opengl website and I think I am understanding a small portion of what is happening.
@nicolelyy17573 жыл бұрын
Thanks for the great tutorial!!! Just a small question, may I know why are the coordinates must be between -1 and 1?
@VictorGordan3 жыл бұрын
It's just the way it is. It probably has some nice mathematical properties which allow for some nice tricks inside the OpenGL API. If you want to not have them between -1 and 1 keep watching my videos up to the camera one (or the one before that, can't remember) ;)
@nicolelyy17573 жыл бұрын
@@VictorGordan ohh alright! thank you very much!!!
@SUUHOO-i4g Жыл бұрын
for the next person, if you got the orange or triangle color problem, that's the fragmentshader problem. my problem is the typos in the copying process e.g., "GLuint fragmentShader = glCreateShader(GL_VERTEX_SHADER);" instead of GL_FRAGMENT_SHADER. :)
@mr_fire_6863 Жыл бұрын
thank you
@rishikeshjaiswal3979 Жыл бұрын
For me, this does not work!
@yato_rv7 ай бұрын
@@rishikeshjaiswal3979 make sure the fragment shader sourcecode is just as in the video. even if there's only a semicolon missing at the end of the vec4 it won't work
@lobstercrab-neverdie7 ай бұрын
nvm the triangles showed up thanks for the video
@awwabasad1117 Жыл бұрын
cool! just one question: when you wrote your vertex data in lines 34... of your program, why did you add "* float(sqrt(3)) / 3" just after the coordinates? on opengl learn it says just the raw coordinates in and of themselves should be sufficient enough (i.e., 0.5f, 0.5f, 0.0f) - unless this has some mathematical reasoning behind it? Ive been trying to write in my own vertices but im just curious as to why you did that Lol. Anyway, huge props for the tutorials, i by far prefer watching videos than reading long articles. Thank you!
@samdavepollard3 ай бұрын
late reply but it's to make the triangle equilateral (all sides the same length, all angles 60 degrees) the vertices in the learnopengl lesson give us a triangle which is almost, but not quite, equilateral; the angles in that one are something like 63.4, 63.4 and 53.2 (degrees)
@awwabasad11173 ай бұрын
@@samdavepollard ahh finally after all this time i have an answer! appreciate it
@ВолоддимерТурчинов3 жыл бұрын
Such a nice voice to follow dat tutorials ^^
@VictorGordan3 жыл бұрын
Thank you :)
@PhamAnhKhoa1183 жыл бұрын
Hi Victor, I've recently seen a lesson about creating mirror using stencil buffer. In their code, they specify an array of 42 vertices (first 36 vertices for the cube and other 6 vertices for the plane). But then when they draw a plane like a mirror surface, they write this line only without binding a VAO: glDrawArrays(GL_TRIANGLES, 36, 6); So my questions is: Why don't they bind a vertex array object before drawing their cubes or planes and can I do that for my usual code? Thanks a lot for your help!
@VictorGordan3 жыл бұрын
By the looks of it they only have one VBO with all the vertices, and one VAO for both shapes. They don't bind anything because it's likely binded when they creat that object, and since they have no other VAOs, they don't bother binding it again. This is bad practice though. You shouldn't do this normally. Also the second argument of glDrawArrays is the starting index of thr vertices, while the third one is the amount of vertices. So they probably did smth like this. // They created the VBO and VAO and in the process binded them // They did not unbind the VAO ... ... ... // They draw the plane glDrawArrays(GL_TRIANGLES, 36, 6); // They draw the cube glDrawArrays(GL_TRIANGLES, 0, 36); Personally I would use indices, and I would bind my VAOs before drawing thdm tho 😬
@anuragbhatt283 жыл бұрын
My triangle is white in color while his was orange. I have rechecked my code but still haven't found any error can someone help me?
@VictorGordan3 жыл бұрын
Usually it is an error in the code (got this q lots of time). I suggest rechecking the code :) Probably smth wrong with the fragment shader code
@TrungTran-rz6tz3 жыл бұрын
I have a question about exercise 3. When modifying `glVertexAttribPointer`, why do we have to write `2 * sizeof(float)` for the `stride` parameter? I found this in the documentation: "If stride is 0, the generic vertex attributes are understood to be tightly packed in the array" So if we have 2 floats per generic vertex attribute, we can totally just leave `stride = 0` right?
@VictorGordan3 жыл бұрын
Yup, you can just use stride 0. I just prefer specifying the stride so that I don't get into the habbit of leaving it on 0. Cause you will have many situations in which it won't be 0 and it will bite you in the back :p
@TrungTran-rz6tz3 жыл бұрын
@@VictorGordan I see, thanks for the quick reply man. Your series and the repo is awesome by the way :) Very easy to follow for beginners of this subject, great job!
@VictorGordan3 жыл бұрын
Thank you and good luck with the tutorials :)
@Доелкашусвареньем3 жыл бұрын
Thank you for the tutorial! What do you think about using glfwSwapInterval() function? The compiled program takes 70% of GPU without v sync and it is funny because it is just a window doing nothing. That is why I am concerned about this. When I set swap interval to 1 task manager showes only about 4% of GPU. Don't you have the same behaviour on your computer?
@VictorGordan3 жыл бұрын
Oh yeah, you should definetly use VSync (glfwSwapInterval). I just forgot to add it in this tutorial 😅
@pedrolimon82752 жыл бұрын
Nice video bro!
@VictorGordan2 жыл бұрын
Thanks! :)
@skizzme6 ай бұрын
My only complaint about your videos is that youtube didnt recommend them soon enough lol
@NamelessY2 жыл бұрын
5:50 btw I didn't understand what it meant that we are using only one string
@VictorGordan2 жыл бұрын
It means the whole shader code is written in one string, not multiple
@NamelessY2 жыл бұрын
Ok thx
@rishikeshjaiswal3979 Жыл бұрын
Why is my triangle white? I changed the fragment shader colors as well, but still the problem persists.
@harishkumarlaxmikantgajako10442 жыл бұрын
Awesome Tutorials sir. But How do we make lines from given set of points?
@VictorGordan2 жыл бұрын
You use GL_LINES or GL_LINE_STRIP instead of GL_TRIANGLES when drawing the data
@atlasflare78242 жыл бұрын
I think using sqrt needs #include . Source code does not have this, or maybe I am missing something. Thanks for the series.
@VictorGordan2 жыл бұрын
Huh, that's actually really weird 😅 I usually just use functions and only include libraries if I need to, so that's why I didn't notice I forgot to include it. I think it still works because it might be included in GLFW, so since I am including GLFW, I'm also including the math library ;) But yeah, probably should have included it more specifically!
@theingegnere2 жыл бұрын
Hi. I am having some questions: 1)how you can compile using sqrt() without adding math.h ? 2) when I instance glGenVertexArrays my window crashes. On the website I checked that this can be solved using gl/glew.h which we are not using here. Where I am wrong? Thank you.
@VictorGordan2 жыл бұрын
1) Do I not have math.h? If not, just add it in yours 2) glew is another library that does what glad does in the tutorial. If if crashes, you probably missed a step or did something wrong. Or, your system might not support OpenGL 3.3+ because it's old.
@theingegnere2 жыл бұрын
@@VictorGordan Thanks for the reply. I repeated all instead using Dev C++, VS 2022 and it works well. One of the point I missed is the generation of the glfw3.h via cmake instead of downloading the repository directly. Thanks for you great tutorials.
@stevehewson86773 жыл бұрын
Hi, saying that this is a brilliant tutorial is an understatement. Not only did I understand OpenGL, but also the graphics pipeline basics. It compiles fine but when I run, I keep getting “Segmentation fault: 11”. I even tried to compile your code directly as well, but same result. Any hints on where I could correct this?
@VictorGordan3 жыл бұрын
Thank you for the kind words! First try seeing if you still get the error when running the VS project I left in the source code on GitHub. Then if that still fails, you might be running out of RAM? From what I've heard that error can be attributed to many things, so it's hard to pinpoint to something specific... Hope that helps!
@stevehewson86773 жыл бұрын
@@VictorGordan Thanks a lot for the quick help. With the help of a discord commuinity, I realised that it was to with my OS (macOS) Using: glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); after: glfwWindowHint(GLFW_OPENGL_CORE_PROFILE, GLFW_TRUE); resolved the issue. I used: std::cout
@abhaychandavar17663 жыл бұрын
@@stevehewson8677 thanks man, I was facing the same issue, this comment should be pinned
@VictorGordan3 жыл бұрын
@@abhaychandavar1766 I'm onto it ;)
@christiancompiles5549 Жыл бұрын
Wonderbar.
@urizilber75452 жыл бұрын
Very informative
@VictorGordan2 жыл бұрын
Thx! ^-^
@footballCartoon912 жыл бұрын
why so many functions to call just to render a static single screen buffer
@HibaSf-w7w Жыл бұрын
How can i draw two square the first square include the second square
@techtycho47523 жыл бұрын
Why did we add 'y-axis * float(sqrt(3)) / 3' to every y-axis value in the vertices array?
@VictorGordan3 жыл бұрын
Just because I wanted to make the triangle equilateral. You can put any value there. Sqrt(3) is the length of the height of an equilateral triangle with sides of length 2. And for the bottom vertices I divide it by 3 because that's the distance from the center of the triangle to the bottom side, while for the top vertex I divide it by 3 and multiply by 2 cause that's the distance from the top of the triangle to the center of it. So basically...just maths haha
@techtycho47523 жыл бұрын
@@VictorGordan Many Thanks!
@VictorGordan3 жыл бұрын
@@techtycho4752 No problem :)
@MKR302 жыл бұрын
There is a memory leak in this program. Do you know if it is an OpenGL bug or something different? ~207k bytes in ~2700 blocks still reachable according to valgrind.
@VictorGordan2 жыл бұрын
I doubt OpenGL has a bug. Might be GLFW or my code
@danlol27203 жыл бұрын
I'm doing the exercises, and I can't understand question 1 on Medium. Why 6 coordinates? And why do some of them repeat?
@VictorGordan3 жыл бұрын
Well there is no square primitive. The only polygon primitive in OpenGL is the triangle. So that means that everything has to be rendered using triangles. In this case you learnt how to draw a triangle by specifying three positions for the vertices of the triangle. So if you want to make a square, you need to specify 2 triangles x 3 vertices each = 6 vertices ;) Hope that helps!
@danlol27203 жыл бұрын
@@VictorGordan Oh I see thank you!
@Byynx Жыл бұрын
When i use the function glEnableVertexAttribArray() i get an Access Violation error but if i remove it i have no errors. Can someone help me?
@Byynx Жыл бұрын
It was because i did'nt set the Vertex Array Object "VAO".
@utilizator17012 жыл бұрын
I have errors like glCreateShader, GL_VERTEX_SHADER, GL_FRAGMENT_SHADER is udentified. I included iostream, glad/glad.h and GLFW/glfw3.h. What library should I use?
@VictorGordan2 жыл бұрын
Sounds like you didn't integrate GLAD properly. Did you follow the installation tutorial?
@utilizator17012 жыл бұрын
@@VictorGordan Initially no. After following your first tutorial, all the functions has been found. Thank you!
@sjoerdev3 жыл бұрын
for compute shaders i need opengl version 4.3 or higher. what files would i have to change to opdate the opengl version used in the project?
@VictorGordan3 жыл бұрын
You need to get a newer version of Glad for the specific version of OpenGL you wish to use, and change all the parts of your code that specify a version (so the first few glfw lines and the first line of each shader). Hope that helps :)
@sjoerdev3 жыл бұрын
@@VictorGordan tnx that helped. Also, in the source code for dear imgui i can only find backend files for opengl2 and opengl3, but not for opengl4?
@VictorGordan3 жыл бұрын
The opengl3 should work for opengl4 ;) I believe it is more about the arhitecture than the version itself. From OpenGL 3.0 the arhitecture changed a lot from what I've heard, that's why there are two versions for ImGUI
@sjoerdev3 жыл бұрын
@@VictorGordan thank you so much, this got my so confused lmao. Now i can finally start using compute shaders!
@MustaphaMond-tt3pt Жыл бұрын
Thank you
@VictorGordan Жыл бұрын
No problem :)
@TheMangovnik3 жыл бұрын
Everything works for me, just the triangle is white instead of orange. I checked the fragment shader, but it doesn't look like there is error in it.
@VictorGordan3 жыл бұрын
Hmmm, double check that both your shaders are working fine, otherwise I don't see what else it could be...
@TheMangovnik3 жыл бұрын
@@VictorGordan I poked around the shaders and it works now. Dunno what I did, probably some obscure typo or something.
@VoidloniXaarii Жыл бұрын
Thanks a lot
@dhanushkumarmudupur7287 Жыл бұрын
Why do my triangle comes out as black, even though the code is same as yours??
@VictorGordan Жыл бұрын
Most common problem in this case is a typo within the fragment shader 😅
@dhanushkumarmudupur7287 Жыл бұрын
@@VictorGordan I appreciate your reply and look into it. Great work 👍🏼. Keep it up.
@NamelessY2 жыл бұрын
Why do we use a f after every number , like 0.5f instead of 0.5
@VictorGordan2 жыл бұрын
In C++ 0.5f is a float while 0.5 is a double. A double has "double" the precision of a float but also double the size, so usually floats are used. In GLSL (inside the shaders) you don't have to write "f" to have it he a float (I didn't know this at the time I made this video)
@NamelessY2 жыл бұрын
Ic i have always used doubles so thats why I didn't know! Tysm
@lobstercrab-neverdie7 ай бұрын
welp the triangle dont show help how do i fix it
@dokumencik64933 ай бұрын
I did everything as You have said, but the triangle does not appear. no errors either
@VictorGordan3 ай бұрын
Sounds like a typo in the shader code
@mindlessmeat40559 ай бұрын
I don't know if you still read this or not, but my triangle is just a black void. No idea why since pretty sure all my code is the same.
@VictorGordan9 ай бұрын
Most likely you have a typo in your shaders
@mintcud5 ай бұрын
rewrite shaders
@edipedipbulmazАй бұрын
i hate myself now but hoorray now i can draw a 2d triangle in a 3d domain
@sharksimo33242 жыл бұрын
how can i change the color of the triangle?
@VictorGordan2 жыл бұрын
It's covered in the Shaders tutorial from what I remember
@sharksimo33242 жыл бұрын
@@VictorGordan ok thanks
@giorberto39622 жыл бұрын
Bro speedrunned the triangle
@VictorGordan2 жыл бұрын
💀
@Final_hours Жыл бұрын
Why is my triangle black?
@VictorGordan Жыл бұрын
Your fragment shader probably has a typo
@NexushasTaken Жыл бұрын
bro... The tutorial 1(aka creating a window) is easy and not complex as much, but this one is so difficult AF. i guess ill just go with SDL, lol.
@VictorGordan Жыл бұрын
Good luck with SDL haha
@stephb21583 жыл бұрын
Not sure why, but my triangle keeps showing as black.
@VictorGordan3 жыл бұрын
That usually means there is an error in your fragment shader, make sure you have the same code as me for the fragment shader. The code is explained in the Shaders tutorial, so don't worry if u don't understand it yet :)
@jetkhan5093 жыл бұрын
Check fragment shader creation/compiling/attaching: e.g. in glCreateShader, make sure it is GL_FRAGMENT_SHADER and not GL_VERTEX_SHADER, etc.
@D3xt3rity3 жыл бұрын
Hey! I'm sure you've fixed this by now but I wanted to let anyone know, The Vertex shader code can effect the Fragment shader so make sure to nail both Shader Source codes! :D
@Final_hours Жыл бұрын
I was trying to learn directx and I was like screw it now I'm learning opengl and it's a lot easier
@OnzeQubit3 жыл бұрын
Is it normal that my gpu is at 100% after this?
@VictorGordan3 жыл бұрын
Hmmmm, I think you are not limiting the FPS so it renders everything as fast as possible which would use 100% of the GPU. That's my guess at least
@OnzeQubit3 жыл бұрын
how can I fix this? if this is really the case.
@VictorGordan3 жыл бұрын
I'm sorry about the previous solution I gave you 😅 (I was thinking of another comment haha) The actual solution is to force VSync through your driver settings, or enabling VSync using glfwSwapInterval(1); in the main function after you create the window (but not in the while loop). Hope this helps :)
@OnzeQubit3 жыл бұрын
@@VictorGordanThank you so much it helped and GPU is now at 10% after adding the function. And thank you for the series btw, I appreciate it.
@NamelessY2 жыл бұрын
@@VictorGordan ohk I think I understand that , what I understand by glfwSawpInterval(1) is that don't unnecessarily keep changing btw front and back buffers unless there is minimum one update (Uh I'm sorry I keep asking questions)
@Tayoky5 күн бұрын
how to not open a terminal window ?
@ToxicTrack_5 күн бұрын
My project just has a main, (no WinMain) and to disable console, I just set Linker->System->SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" instead of "Console (/SUBSYSTEM:CONSOLE)" and the console goes away.
@sjb8178 Жыл бұрын
thx sir
@alexandruoporanu82612 жыл бұрын
Very good tutorials but IMO the concepts of VBO and VAO are pretty abstract and only explained by example, not rigorously.
@VictorGordan2 жыл бұрын
Yeah, sadly they are abstract by nature. I wouldn't really know how to explain then rigorously. They probably exist in this form because of some technical requirements that only the people who developed OpenGL know... At the end of the day they are just tools, so I don't think u need to know why they exist, but how to use them ;)
@SimplementeNico2 жыл бұрын
My face when all this is just for a triangle 🙂
@VictorGordan2 жыл бұрын
You should see how much code you need for a triangle in Vulkan... It's not that bad, trust me. It will go faster from here on ;)
@kubolor1234 Жыл бұрын
OpenGL is literally frying my brain...I can't get my triangle t render.
@fft20207 күн бұрын
when I was programming BASIC in the 80s I could draw a triangle on screen withe 3 commands, not 1000 like here... but hey... progress
@VictorGordan6 күн бұрын
@@fft2020 if you want to just do simple 2D draw calls in a few lines, then this series is not for you. I recommend you check out SDL and SFML, those might suit your needs better
@arithene5 ай бұрын
const char* vs = "#version 330 core layout(location=0) in vec3 p;void main(){gl_Position = vec4(p,1.0);}"; const char* fs = "#version 330 core out vec4 FragColor;void main(){FragColor=vec4(.5f,.0f,1.0f,1.0f);}";
@Jtnn7137 ай бұрын
How come the color of the traingle is orange even though you used the same color that you used for the bg?
@Banaannaa6 ай бұрын
the color was decided in the "Fragment shader" at the top of the code in which it says "FragColor = vec4(0.8f, 0.3f, 0.02f, 1.0f);" which is a orange red color The fragment shader is the code that controlls the triangle and its color