Welcome to OpenGL
Summary
TLDRIn this introductory OpenGL video, The Cherno explains what OpenGL is—a graphics API allowing developers to access and control the GPU for rendering graphics. He clarifies misconceptions, noting OpenGL is a specification, not a library or framework, and is implemented by GPU manufacturers, not open source. The Cherno emphasizes OpenGL's simplicity and cross-platform capabilities, making it an excellent choice for learning and small projects, but not ideal for large-scale game development. The series will cover modern OpenGL, focusing on raw API usage without creating an engine, and will explore 2D and 3D graphics, shaders, lighting, and advanced rendering techniques.
Takeaways
- 😀 The Cherno is starting an OpenGL series on graphics programming, which he's excited to cover.
- 🔍 OpenGL is a graphics API (Application Programming Interface) that provides functions to manipulate graphics.
- 💡 An API is a set of functions that allow for interaction with hardware, like the GPU, for drawing graphics.
- 🚫 OpenGL itself is not a library, engine, or framework; it's a specification that defines what functions should do.
- 📥 You don't download OpenGL; it's implemented by GPU manufacturers in their drivers, and implementations can vary.
- 🔒 Despite its name, OpenGL is not open source, as the actual code is implemented by GPU manufacturers privately.
- 🌐 OpenGL is cross-platform, allowing the same code to run on various operating systems like Windows, Mac, Linux, iOS, and Android.
- 🤔 The Cherno expresses a personal preference for DirectX 11 over OpenGL for its API design, especially for game engines.
- 📚 The series will focus on modern OpenGL, which is significantly different from legacy OpenGL, offering more control through programmable shaders.
- 🛠️ Viewers will learn raw OpenGL without creating a game engine or framework, focusing on understanding how OpenGL works.
- 👨🏫 This educational series aims to teach OpenGL in C++, emphasizing its simplicity and cross-platform capabilities for learning graphics programming.
Q & A
What is OpenGL and what does it stand for?
-OpenGL stands for Open Graphics Library. It is a graphics API, which is a set of functions that can be called to perform certain tasks related to graphics, specifically allowing access to the GPU for drawing graphics.
Why is OpenGL considered a graphics API?
-OpenGL is considered a graphics API because it provides a way to interact with the GPU, enabling developers to perform graphics-related tasks by calling a series of predefined functions.
What is the difference between OpenGL and a graphics library or engine?
-OpenGL is not a library or an engine. It is a specification that defines a set of functions for graphics operations. An implementation of OpenGL is provided by GPU manufacturers, not by the OpenGL specification itself.
Why can't you download OpenGL like a regular software application?
-You can't download OpenGL because it is not an application or a library with code. It is a specification, and the actual implementation is provided by GPU manufacturers in the form of drivers.
Is OpenGL open source?
-No, OpenGL is not open source. The term 'open' in OpenGL does not refer to open source; it refers to the fact that it is a publicly available specification. The implementations by GPU manufacturers are typically not open source.
What is the main advantage of OpenGL being cross-platform?
-The main advantage of OpenGL being cross-platform is that the same OpenGL code can run on different operating systems like Windows, Mac, Linux, iOS, and Android, making it easier to develop applications that work across multiple platforms.
What is the difference between legacy OpenGL and modern OpenGL?
-The main difference between legacy and modern OpenGL is the use of shaders. Modern OpenGL provides more control over the GPU through programmable shaders, while legacy OpenGL relied on a set of presets for graphics rendering.
Why is the speaker not the biggest fan of OpenGL?
-The speaker is not the biggest fan of OpenGL because they find it less efficient and more complex compared to other APIs like DirectX 11. They also mention that OpenGL's cross-platform nature can sometimes lead to inconsistencies and bugs across different platforms.
What will the upcoming video series focus on?
-The upcoming video series will focus on teaching modern OpenGL, covering how it works and how to achieve various graphics tasks using raw OpenGL code without creating a game engine or framework.
What topics will be covered in the OpenGL video series?
-The series will cover a wide range of topics including 2D and 3D graphics, lighting, shadows, deferred rendering, physically based rendering, post-processing effects like bloom and sprays, ambient occlusion, and screen space reflections.
Why is C++ chosen as the programming language for the OpenGL series?
-C++ is chosen for the OpenGL series because the speaker believes it is the best language for graphics programming, offering the necessary control and performance for working with OpenGL.
Outlines
🎮 Introduction to OpenGL Series
In this introductory paragraph, the Cherno announces the start of an OpenGL series, expressing excitement for finally covering this topic. He clarifies that OpenGL is a graphics API, which is a set of functions used for graphics manipulation, specifically to access and control the GPU. The Cherno dispels common misconceptions about OpenGL, explaining that it is not a library, engine, or framework but rather a specification defining how to interact with the GPU. He also discusses the role of GPU manufacturers in implementing OpenGL and addresses the myth that OpenGL is open source. The paragraph concludes by emphasizing OpenGL's cross-platform capabilities, which allow the same code to run across various operating systems.
🔍 Understanding OpenGL's Misconceptions and Cross-Platform Nature
This paragraph delves deeper into misconceptions about OpenGL, particularly the idea that it is superior due to its cross-platform nature. The Cherno argues against this notion, stating that platform-specific APIs like DirectX are often more powerful and better optimized. He also touches on the simplicity of OpenGL compared to more complex, lower-level APIs like DirectX 12 and Vulkan, suggesting that OpenGL might be the easiest API to learn currently. The paragraph highlights the author's personal preference for DirectX 11 in terms of API design and explains that while Vulkan is cross-platform, it is still maturing and not yet ready for shipping games. The Cherno positions OpenGL as an excellent choice for learning and small personal projects due to its simplicity and cross-platform capabilities.
🛠️ Modern OpenGL and Its Distinction from Legacy OpenGL
The Cherno introduces the concept of Modern OpenGL, differentiating it from Legacy OpenGL. He explains that Modern OpenGL provides more control over the GPU through programmable shaders, which are programs that run on the GPU to perform graphical tasks more efficiently. The paragraph contrasts the simplicity and preset nature of Legacy OpenGL with the flexibility and power offered by Modern OpenGL's shaders. The Cherno emphasizes the importance of shaders in achieving complex graphics effects and the series' focus on Modern OpenGL to cover these advanced topics. He also clarifies that the series will not be creating a game engine but will instead concentrate on understanding and implementing OpenGL for graphics programming.
📝 Series Overview and Upcoming Content
In the final paragraph, the Cherno outlines the scope and content of the OpenGL series. He confirms that the series will focus solely on OpenGL, covering raw OpenGL code without abstracting it into a game engine or framework. The series will explore 2D and 3D graphics, including advanced topics like lighting, shadows, deferred rendering, and post-processing effects. The Cherno also mentions his intention to ensure cross-platform compatibility and his choice of C++ as the programming language for the series. He concludes by expressing excitement for the upcoming episodes, which will begin with setting up a window and rendering a triangle using OpenGL.
Mindmap
Keywords
💡OpenGL
💡Graphics API
💡GPU
💡Specification
💡Cross-platform
💡Shader
💡Modern OpenGL
💡Legacy OpenGL
💡Game Engine
💡Direct3D
💡Vulkan
Highlights
Introduction to OpenGL as a graphics API and its role in accessing the GPU.
Explanation of API as a set of functions for specific tasks, with OpenGL focusing on graphics.
Clarification that OpenGL is not a library, engine, or framework but a specification.
Discussion on the misconception that OpenGL is open source and its actual proprietary nature.
Highlighting that GPU manufacturers implement OpenGL, leading to variations in implementation.
OpenGL's cross-platform capability and its implications for game development.
Personal opinion on the simplicity and learning curve of OpenGL compared to other APIs.
The distinction between legacy and modern OpenGL, with a focus on the latter in the series.
Importance of shaders in modern OpenGL and their role in GPU programming.
Plans for the series to cover modern OpenGL, including advanced topics like deferred rendering and PBR.
Emphasis on learning OpenGL for educational purposes and its application in personal projects.
The series will not focus on creating a game engine but rather understanding OpenGL itself.
Intent to cover both 2D and 3D graphics, including optimization techniques and rendering concepts.
Use of C++ for OpenGL code examples and the rationale behind choosing this language.
The decision to use Windows and Visual Studio for demonstrations due to industry standards.
Upcoming Patreon rewards related to the series and the encouragement for viewers to support the content.
Preview of the next episode, which will involve setting up a window and rendering a triangle using OpenGL.
Transcripts
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
5.0 / 5 (0 votes)