Welcome to OpenGL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up guys my name is the Cherno and welcome to OpenGL finally doing an OpenGL series really excited for this this is something that I probably should have done years ago but here we are let's talk about OpenGL so in this video we're basically just going to cover what OpenGL actually is how we can use it what it can do for us what it isn't and also what this series is actually going to cover so first of all if you've heard of OpenGL but you're not sure what it is you're probably relating it to graphics and that's exactly what OpenGL is OpenGL is a graphics API now API stands for application programming interface and what it basically is is a bunch of functions that we can call to do certain things in this case since OpenGL is a graphics API it allows us to do things with graphics and specifically OpenGL allows us to actually access our GPU our graphics processing unit which is our graphics card and of course being called the graphics card it's pretty good at drawing graphics and so in order to actually utilize this massively powerful graphics processor that we have in either a computer or a device like a phone we need to actually use some kind of API to get access to that actual hardware and OpenGL is just one of many api's that actually allows us to access the graphics card and tell it what to do we have other ones as well such as direct3d Vulcan metal and there are a few others as well so in summary OpenGL allows us to control our graphics card to a certain extent let's clear up some common misconceptions that people seem to have about OpenGL first of all a lot of people call up until a library or an or an engine or something like that or a framework it's none of those things OpenGL by itself at its core is just a specification it's kind of like a C++ specification in that regard it's actually it doesn't actually define any code or anything what it is is a specification that lists hey this function should exist it should take these parameters that should return this value it's just a specification of what you can do with the API there's no implementation there whatsoever which means that is definitely not a library because OpenGL itself there's no code for OpenGL it's just a spec right just the specification so with that in mind where do i download open that's another really common question and the answer is you don't really downloaded OpenGL itself is again just a specification so who actually implements it who actually writes the code that gets called when you call an OpenGL function and the answer to that is your GPU manufacturer so if you're using an NVIDIA GPU then the drivers for that GPU your Nvidia drivers are what actually contained the implementation of OpenGL and videos implementation of OpenGL and every graphics card manufacturer AMD Intel whatever they're gonna have their own implementations and of course Nvidia don't really have a meeting with AMD and decided yeah this is how we're gonna write our code that doesn't happen right so everyone's implementation of OpenGL is gonna be slightly different which is why in a lot of cases some things may work on nvidia drivers on an NVIDIA GPU but that same game might look a little bit different on an MD TV or maybe there are bugs or sub I that but anyway the point is that OpenGL is written by your GPU manufacturer which probably will lead on to the next common misconception about OpenGL it's open source where do people get this stuff I get that it has open in the name but it's not open source at all you cannot see the code for OpenGL because first of all is implemented by the GPU manufacturers they certainly don't release their driver source code some that dude there are of course open source implementations of OpenGL because if like I don't know if I create a graphics card and I wanted to support OpenGL I have to write a driver for it and I may choose to put that on github or whatever and have it be open source but the implementation that your computer is running probably if you're using like an Nvidia graphics card or an AMD or an Intel card you're not going to see the source code behind that implementation so OpenGL OpenGL can't really be open source first of all because it's a specification no no actual source code but second of all the implementation of OpenGL you're using is most probably not open source what OpenGL does offer which excites a lot of people and causes a lot of people unfortunately to say all OpenGL is so much better anything else is because it's kind of cross-platform so what you can do is you can write OpenGL code and that same code will run on Windows Mac Linux iOS Android that kind of stuff right and so people immediately start to think oh well OpenGL is superior to direct3d because it runs on all platforms no no don't stop saying that please I just realized with that last statement of mine I should probably say since this is the welcome video this series is kind of gonna be based on my opinion that's just I'm making these videos so I'm gonna give my opinion you can choose not to follow it I'm not in any way implying my opinion is fact I'm just saying that from my experience in the industry working on central technology for EA specifically game engine technology for EA and having dealt with many different graphics api's I'm not the biggest fan of OpenGL and the concept of the concept of because this API is cross-platform it's kind of you know at the best that that is making sense game mentions do not implement a single graphics API but that's not how they work if game engines a cross-platform that is they're not just made for an Xbox or something ordered they're not just made for Windows they will implement they have to implement multiple graphics api's because the fact of the matter is usually the graphics API that is made for that platform for example direct3d made for Windows by Microsoft it's gonna be superior to an API this kind of cross-platform now remember the people actually implementing the code are not Microsoft Microsoft specifically with directory they actually tend to work with GPU manufacturers to get better kind of code done and stuff like that but at the end of the day something like OpenGL its invidious responsibility to implement open jail for their drivers and they screw up its kind of on them but the fact that OpenGL is cross-platform therefore it's better than direct3d or better than metal metal is what Apple used for iOS and Mac that's that's that argument is really kind of doesn't make any sense because usually the thing that's native to the platform is going to be more powerful and better that is to say that OpenGL as an actual specification is actually really simple especially when you compare it to something more low-level like DirectX 12 or direct3d 12 and Vulcan so in terms of the complexity of OpenGL I think open gels probably like with metal as well metal is a little bit lower level in OpenGL but not quiet in Vulcan I would say that OpenGL is probably the easiest API that you can learn right now so OpenGL is really definitely worth learning Vulcan which is another one of those cross-platform at the eyes it's still kind of fresh and raw and the drivers still need a bit more work just last week for example I've seen Vulcan restart Android devices because it you pulled something and it crash and it's you've all kinds of bit difficult to get into and I would only really advise you get into Vulcan at this point in time which is September 2017 if you really want to just have fun but all I play with it or you have to implement it for some reason but overall is I wouldn't really ship a game on Vulcan just yet if I can avoid it because something like OpenGL is gonna be way more stable anyway I'm kind of ranting I'm kind of if this is kind of getting derailed my point is that this area is gonna cover up in jail I still think OpenGL is the best graphics API you can use for learning because it's just so simple compared to the other ones it's still it's it's it's a really easy kind of simple one to learn and of course it also is cross-platform so if you're not a game studio if you don't have a team of people making a game engine and you can afford the resourcing for actually implementing you know directory for windows metal for app or whatever OpenGL or welcome for Android like if you kind of if you don't have that those resources available which most people watching this video but we don't then OpenGL is fantastic because it is cross-platform and it is going to it's simple as cross-platform it's going to by far be the easiest if you want to shape a game on multiple platforms so that's why we're letting OpenGL because I do like OpenGL like for kind of small personal projects but obviously if I was a triple ace to Europe working this probably be my last choice for a for an actual graphics API because the API first of all isn't that good DirectX 11 my favorite graphics API in terms of API design is probably direct3d 11 and what ends up happening with OpenGL for a lot of people especially if they're writing a game engine and a proper graphics rendering engine is they'll actually tend to basically write a direct3d kind of wrapper over OpenGL so in other words they'll kind of end up writing a framework which calls OpenGL under the hood but on like the actual API of that framework will be very similar to direct3d because direct3d 11 specifically is a really good way of creating a graphics API again my opinion but most people that I've talked to in the industry with this 100% agree so yeah so with that aside you now have some answers to some frequently asked questions OpenGL is implemented in your graphics drivers and it's just a specification for allowing us to control the graphics card now in this series specifically we are going to be dealing with modern OpenGL now modern OpenGL is something that you might have heard a lot about as well this kind of distinction between legacy OpenGL and modern OpenGL the reason that exists is because OpenGL was released in the 90s and back then it was very different toward before to what it was now back then GPUs one has programmable and is flexible I guess you couldn't control them anywhere near as much as you can now especially with these lower-level api's now people are ultimately giving us so much control or I should say manufacturers are giving so much control to the programmers and developers which of course is really good because we can optimize further for that but OpenGL right now is a lot more kind of like a circus a low-level law it gives you a lot more control than it did back then back then it was like a set of precess so in other words you basically draw a triangle and then you say I want lighting so how do you add lighting to the triangle you basically say lighting equals true you enable OpenGL lighting and then you busy you tell OpenGL I want my light to be here like it's it's really is like a set of presets it was like a set of presets - how do I get my graphics to work and because of that it was really use legacy OpenGL is really easy to use it's very the code is quite short and but unfortunately with that of course it doesn't give you as much control and we do want control because we want to implement some pretty crazy graphics things in this series so the biggest distinction between legacy OpenGL and modern OpenGL is shaders this term shader is something that you might have heard we probably would have heard if you were at all interested in graphics and it might kind of resemble the word shadow or light like some people can compare it to lighting or something forget that a shader is program it's a it's a it's code that runs on your GPU that's what a shader is it's a program that runs on your GPU so if we write code in C++ or Java or C sharp or whatever language it runs on our CPU right but since we're specifically dealing with graphics for a lot of the time we want to control exactly what the GPU does and and probably move a lot of our code from the CPU to the GPU because it's gonna run faster on the GPU so that's why shaders come in Cheddar's just allow us to write code on the GPU and we definitely want to be doing that in this series because if you want to work out some complex lighting algorithms for example you definitely want to be doing that on the GPU instead of on the CPU which you had to do in the past so programmable shaders is the biggest kind of difference between the two but there are also many other differences as well as cover in this series but just rest assured if you're looking for a modern OpenGL series this is we're gonna cover modern up you're gonna go as modern as we can the other important thing but I want to mention about this series is that we're not gonna be making a dimension we're not going to be making a graphics engine or a framework or a library or anything like that we're gonna be learning OpenGL I'm actually going to have another series which I hope to start in a few weeks which is going to be how to make a game engine and in that series we are going to make a full-on game engine the graphics engine and all of that which will implement OpenGL as one of its rendering api's so if you want to see OpenGL in an in an actual engine a game engine and how that works then that series is gonna be for you but this series we're actually gonna learn how OpenGL works so that we can write that rendering engine and that game mentioned with opengl and so because of that in this series we're not going to be wasting time writing like a material system for example we're just going to focus on the raw OpenGL code so that I can show you how OpenGL actually works and how you can achieve what you want and then it's going to be up to you to actually implement that in your engine or if you don't know how to do that and of course my game engine series which will come shortly in the future will cover all that but this series specifically we're going to be focusing on OpenGL which is why in our main source file which will have we're going to be writing OpenGL code we're gonna abstract that away or anything like that this is gonna be some roar GL code we're probably are gonna write have to write some utility classes like for mass and also like loading shaders or textures and stuff like that because there's a little boilerplate code that can kind of get repeated a lot but when we actually come time to when when it actually comes time to you know let's render something on the screen that's going to just be raw up in jail code we're not going to abstract that away at all we are going to be writing OpenGL in C++ because in my opinion that's the best language for the job it is going to be cross-platform I'm going to try my best to ensure that it is cross-platform so that any said that anyone can follow along on Mac and Linux as well as Windows we are going to be using Windows and Visual Studio because that is what pretty much everyone in the industry uses that's what I'm used to and that's what I personally believe is the best tool set the best tool chain that you can actually use in terms of actual topics that we're going to be covering for OpenGL we're going to do 2d graphics and we're going to do really fast 2d graphics and learn about batching and all that stuff to actually write a very very fast 2d renderer we're also going to talk about 3d of course and everything to do with that and influence some cool things we're gonna implant lighting of course and shadows and deferred rendering and physically based rendering and just any old post-processing stuff like bloom and sprays based effects great space ambient occlusion screen space reflections just we're going to basically do everything that you guys can think of and leave in the comments on happy to implement pretty much any of that I've done it before and it should be really exciting to kind of get a set of examples together which you guys can explore and hopefully implement in your own engines or in your own games or anything like that so I'm really excited for this series because graphics programming is one of my favorite areas of programming which is remember in this series we're not gonna be focusing on how to make a game engine we're just going to be focusing on how can I achieve this in OpenGL OpenGL is just one of the many api's that exists for graphics programming and this series is going to be specific specifically about how OpenGL actually works if you guys are as excited as I am then hit the like button you can also support this series and all of my videos by going to patreon.com 4/2 Cherno that's going to help ensure that these videos get get released more frequently and that I have more time to make them there are going to be some pretty cool rewards relating to this series coming soon on patreon so definitely it definitely keep an eye out for that in terms of how often these videos are going to come out at least once a week but I'm going to try especially in the beginning I'm going to try and make them a lot more frequently next episode we're going to actually start writing some code and specifically we're going to be setting up a window and actually getting a triangle onto this frame hopefully so I will see you guys in the next video goodbye [Music] you
Info
Channel: The Cherno
Views: 642,020
Rating: undefined out of 5
Keywords: thecherno, thechernoproject, cherno, c++, programming, gamedev, game development, learn c++, c++ tutorial, opengl, graphics, game engine, graphics programming, directx, rendering, how to use opengl, what is opengl
Id: W3gAzLwfIP0
Channel Id: undefined
Length: 16min 3sec (963 seconds)
Published: Sun Sep 17 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.