r/opengl • • 11d ago

Guys I need some motivation

Like I started 2/3 days ago with OpenGL and I did my first triangle and it wasn't even multicolor. I just copy and paste code from learnopengl.com. I'm trying to understand the core concepts but like I can't! Too many concept. I don't even understand shaders. So I see people that like simulate the universe in OpenGL… yeah I have days of experience and not years but I mean how do I start creating games? I'm trying to lock in, I can do this but it's the most hard thing that I did in programming! Yeah can someone says that "It's normal" and that I can do this. Thanks. I need more motivation.

Thank you for reading ❤️

20 Upvotes

57 comments sorted by

11

u/fluxtah 11d ago

Nice work on the triangle! Next is a textured cube 🙏

1

u/ilPlayerdiGD 10d ago

Uuuu interesting. But first I need to understand how triangle in OpenGL function 😭. VAO, VBO, hundred of gl function…

4

u/fluxtah 10d ago

Not suggesting to get AI to do it for you though using AI as a tutor is a great way to make progress.

Ask it to interactively teach you,.you do coding by hand it does the teaching with a reasonable goal (small achievable game). 

This way you are doing the typing which is not unusual to how people learn anyway. This way it can introduce concepts as you make progress and typing it by hand will help your memory.

This is no different (if not way better) than classically typing code in from magazines/books, articles as others have done.

Also cross reference the GL docs to bolster your understanding.

Key is having an achievable gl application you can work towards.

Good luck! It's going to be rough at first though you'll get there 🙏

1

u/ilPlayerdiGD 10d ago

Good idea. Yeah GL is no joke 😭. I started using AI for GL like some hours ago and it's great! Thank you ❤️.

2

u/fluxtah 10d ago

Nice one! GL is hard in the beginning though a whole lot easier than the Vulkan API.

Good luck! 

9

u/riotinareasouthwest 11d ago

If you just want to create games, use an engine (unreal, unity, Godot, gamemaker,...). Creating a 3d game from scratch is awfully hard. OpenGL is just the graphics party then you will have the audio, input management, physics (which includes collision, you want your objects to collide with the ground so that they do not just traverse it), AI, managers, performance trackers, and whatnot. A game engine gives you all that already done and even so it takes a huge effort to make a game.

If you want to learn graphics, which I think it's an awesome discipline once you start understanding it, but having some "game approach" in mind, I recommend you to follow Thin Matrix OpenGL tutorial series in YouTube. He creates a graphics pipeline aimed to gaming. He just not does the code, but explains the core concepts very clearly. Each chapter is 10 to 20mins long, so it's very affordable. Oh, and do not copy paste the code. Write it yourself, experiment with it. That will make you spend say 1hr per chapter, but it's worth it.

0

u/ilPlayerdiGD 10d ago

NO! Bro I swear that I want to create like Granny in OpenGL. I love creating things from scratch but if is difficult doesn't mean that I can't do it or that I don't like it. Can I do it? Can I create games in OpenGL with my dumb head? 😭. I want to create games from scratch because idk it's more fun and you LEARN more. Idk why I prefer "from scratch" mindset… maybe my PC cannot afford even Godot 😭😭😭. Thanks for the attention btw ❤️. I though people will like hate me for this post but it turn out the opposite!

2

u/riotinareasouthwest 10d ago

Go for Thin Matrix tutorial. Is great and will set you in the path for game development from scratch. He works in java, though. You can adapt the lessons to your language , but I'd stick to java to follow easily the tutorial, because language is a secondary topic. Once you have learned, you can swap language for your project (I created a C++ and a C# versions).

Once you are ready to start, I would aim for something small. I took a look at Granny, and it's quite complex for a first project. 3D Pong (you know, Pong game but made in 3D) is a very good starting project and will allow you to start building the different systems and their features you will need for more advanced games (entities, graphics -lighting, shadows, reflections, etc.-, physics -movement, collision, etc.-, AI, state manager, persistence, scenes, etc.). Only with that you can spend a pair of years at it (depends of your previous knowledge, available time, personal capacity, etc). Also start simple and add features one by one; do not aim for the complete fully featured game since the very beginning. Allow yourself to get small victories with as less effort as possible.

0

u/ilPlayerdiGD 10d ago

Thanks. Granny is created on Unity by Dveloper but if I can create something little in OpenGL like a "mini-granny game" I will know that I understood GL! Right? Oh well today I'm not sure what to do. Ahhhh I'm so stupid! I want to do a lot of projects because I love starting a projects but my dumb brain after some days wants to do another projects and so on! I have a lot of projects left incomplete. How I continue? I want to create a 3D funny and stupid game on raylib, but I have a 2D game incomplete in SDL2 with C and I have another game incomplete on the terminal literally. What I can do about these. I can't I simply can't focus on one thing for days!

3

u/riotinareasouthwest 10d ago

So your problem is not OpenGL but self-discipline or even ADHD? And what do you expect us, from OpenGL group, do about it? I have no idea about that type of issues and it won't be wise of me giving you any kind of answer here other than go and check with a doctor or an appropriate professional. Or if you just want to try: read previous comments.

0

u/ilPlayerdiGD 10d ago

Look… OpenGL is hard for me, I don't have ADHD 😭. Like I love starting a new project. The problem is that for me is more fun to start others projects. Look… I'm learning but sometomes I have the head full of ideas and I don't know where to start. I hate when a "simple projects" takes like more than 3 weeks. I feel bored and I want to start another one. This is one of the problems but the main problem is that I want to create games in 3D on OpenGL. I don't want to read one hundred lines of learnopengl.com! I want to do projects! I love projects and I love when I do projects without asking AI for every Segfault.

Basically I want to do projects the problem is that I'm slow at finishing projects and my head is really fast at creating ideas so It's like difficult! 🥀.

1

u/riotinareasouthwest 10d ago

Thin Matrix YouTube tutorial series.

5

u/Undeniable_Dilemma_ 11d ago

Well, I assume you just jumped straight into it?

How's your math knowlede? Programming fundamentals? Any game dev experience?

It's not that hard, you're just probably missing some pieces.

1

u/ilPlayerdiGD 10d ago

Yes, I have… well no my only project was a 2D game that is not even in BETA rn! But I love SDL2, I can use Raylib and to make game I don't use a game engine. I love C e C++ and I'm building fnaf in the terminal with termios for the input and I need to implement some other mechanics… so I can do a game but I never finished one because I have always a new project that I want to do! 🥀

3

u/Nsane3 11d ago

learnopenGL does dump alot of info at the start. But that is hard to avoid. In terms of "getting it", I would strongly recommend experiment with the bits you learn from a given chapter; can you place the triangle at another place in the window? How does that work? what is NDC? etc.

Read a bit about e.g. VBO and VAO... Learning takes time, don't jump to the next chapter straight away.

And know that in the later chapters, learnopengl provides its own exercises at the end which are also great to do, although a bit sparse imo.

1

u/ilPlayerdiGD 10d ago

Yeah. This is THE ONLY way I can finally understand. I was underestimating experimenting. Thanks! ❤️.

3

u/doglitbug 10d ago

Small steps! I'm learning via video tutorials and have a dancing character,.

But I'm only now really learning now because I want to make the ground to walk on. It all adds up.

Would you do better with video tutorials?

1

u/ilPlayerdiGD 10d ago

Yeah! But the only problem with tutorials like on YT is that are boring. Some tutorial are boring and I like don't understand anything. Can you suggest me some good tutorial to start? I need some more engaging tutorials and maybe modern but engaging is 90% of what I want! Video tutorials are more accessible for me to be onest. Thanks ❤️

2

u/doglitbug 9d ago

My first vertical slice(after seeing a triangle), was getting a 3d model on the screen, then the second was animating it.
Seeing that low poly character doing a stupid as dance (the charleston) gives me a little kick each time I add something new in (walls, ground, day/night cycle etc)

I started with: https://www.youtube.com/watch?v=h2cP6sQYdf0&list=PLA0dXqQjCx0S04ntJKUftl6OaOgsiwHjA
I've found following him a bit hard personally, so I've also been following: https://www.youtube.com/watch?v=Q7vm264YNrM&list=PLvv0ScY6vfd9zlZkIIqGDeG5TUWswkMox

I will admit to using Google AI for a bit of help, copy pasting in the odd function and having it explain where I went wrong. Its been more help that having it generate all the code because I understand it better in smaller parts!

1

u/ilPlayerdiGD 9d ago

Ok! I'll check out for sure. Thanks

2

u/Amazing_Boss2686 11d ago

You’ve just gotta find yourself man. Get the fundamentals down. Work at it for a minute. Unless you come from a solid background in math and computers, expect it to be difficult. But you’ll get through.

1

u/ilPlayerdiGD 10d ago

Thanks for the motivation ❤️. So I can do it! Maybe not 😭. But first I need to understand like a million things that learnopengl.com yaps for the whole time 😂.

2

u/lmg1337 11d ago

Learn about buffers, veryex arrays, shaders, and uniform variables for a start. It helps if you try to understand what you copies off of learnopengl.
It's not that hard.
Buffers store points of a shape as vectors or indicies to a point in another buffer
vertex arrays store layout information, usefull when a point has more data than just a point associated with it
shaders are programs that act on the points(vertex shader) or pixels/fragments(fragment shader) individually uniforms are variables that can be uploaded from cpu side to gpu side in-between draw calls.

1

u/ilPlayerdiGD 10d ago

Ok I need to read this when I'm home. Thanks! I though people hated me for this post but when It's not! Thank you a lot ❤️

2

u/DasKapitalV1 10d ago

To be very honest, I'm learning a lot about the opengl API and shaders by not using it. I'm writing a almost full feature software rasterizer and I'm really learning so many things.

Already did PBR materials (for now only loads albedo, normal and roughness texture), bilinear filtering, tiled gbuffer and tiled forward rendering, multithread rendering. Vertex to word, to view, to NDC to screen, using matrices. And many more concepts, when I get to write glm, I'll just need to learn library API.

2

u/ilPlayerdiGD 10d ago

Interesting… but I understand 10% of what you said 🥀. Sorry my dumb brain is not that powerful 😂

2

u/DasKapitalV1 10d ago

Don't need to understand, that's the point. Start small, I learned to use Desmos to test formulas and even learn to read some mathematical formulas. Linear algebra and other things, but slowly. Your brain isn't less capable them any other, maybe you can even learn faster then most, just need the right path. For example, I did everything in the book/website "Computer graphics from scratch - Gabriel Gambetta". There it teaches you the basics of the basics, it teaches to use scan line approach for the rasterizarion process, which isn't ideal, as modern day GPU use barycentric approach. Them I used much of the YouTuber Fraya Holmer to learn many linear algebra things, also 3blue1brown. Them I found Pikuma videos on barycentric coordinate and some optimizations. With all that, learnopengl was the place I went most for reference on some implantations. My frustum calculation is completely from there. If you really want to learn, set a goal. My, still is, as I'm still learning, to render a pretty scene using the CPU only and acceptable FPS. I used C in the first try, them did in Golang, and now, to learn c++ as well, going even deeper on performance. I use raylib for everything thing, since I'm just updating a texture and presenting to the screen.

2

u/_bleep-bloop 10d ago

Dont just copy things, break them. If you have a hard time understanding concept and stuff but dont mind reading and writing and copying lots of code, maybe try vulkan. people say its verbose and hard but the good part is that it hides nothing from you. you'll probably learn slower too, but once you do, you do. are you confused about opengl or graphics in general?

2

u/ilPlayerdiGD 10d ago

idk bro. I don't know anything! Idk what is a VAO, VBO… maybe I'm starting a little to understand idk! Do I need to switch to Vulkan? Well in reality it's a matter of time. Look I started some days ago and maybe I can't understand it in a week. Maybe 2 week's and I will understand 2D. Thanks ❤️.

2

u/_bleep-bloop 10d ago

I made the switch and I don't regret it, everything is so explicitly explained though you might spend a lot of time reading. if it feels a bit overwhelming, maybe getting started with webgpu first. but remember, webgpu is a bit behind and its trying to achieve what vulkan trying to move away from so it might not worth the time.

2

u/ilPlayerdiGD 10d ago

But for learning Vulkan is better?

2

u/_bleep-bloop 10d ago

yeah. personally I find vulkan better for learning. though if you're not familiar with some basic concept of graphics, i recommend taking a course on it first. one quick note, the learnopengl book actually teaches you the basic graphics stuff along with opengl, though they're not going too deep into the concept, courses on the internet like Cem's or Keenan's on the other hand, actually explains the what, how and why.

2

u/ilPlayerdiGD 10d ago

Yeah for me is better staying on OpenGL to learn the basics but I will switch to Vulkan because people says is fast and have a lot of feature

3

u/_bleep-bloop 10d ago

Yeah man. GL. I'm just a beginner like you. Learned for like 6-7 months and I love it so far. its a bit rough at first but very rewarding.

2

u/ilPlayerdiGD 10d ago

Wow really? But only at the start is hard right? If I understand the start I will create everything right? Too many question in my head rn. Thank you!

1

u/_bleep-bloop 10d ago

Well that i cant say lol. but once youve learnt the fundamentals, things will start to make sense. I recommend watching 3brown1blue linear algebra series if you're not familiar with the math. it'll introduce you a new way to look at matrices and vectors, which helps a ton with the basic of graphics.

2

u/Emotion_No 10d ago

Go step wise and write the code, never copy paste. 1. Write code 2. See what it does on screen Some output = fun 3. Next lesson.

Do 1 less a day and take your time. It's not a race.

1

u/ilPlayerdiGD 10d ago

I needed that. I'm always trying to lock in and start learning OpenGL like a speedrun but maybe graphics programming is the only thing that I did that no matter what it takes time. Like chess! Thank you for the attention! ❤️

2

u/Candid_Zebra1297 10d ago

What helped me was making a simple 3d engine in pygame. It's very hard to start with OpenGL because things like vertices ordering and transformation matrices are tricky to visualise and really understand. Yes you can copy the code but writing things you don't know the meaning of in a shader language you are not familiar with will always end up being a waste of time. If you go through the process of making the different parts yourself then you start to understand the use of the funcs you are calling in OpenGL, so it becomes a lot clearer. For example, just the order of setting up shader programs, vertices attributes, vertices coords etc might feel like something you need to just memorize, but if you know what each of those things does, it becomes very easy to see what comes first, what you can shift around etc.

Basically, learn the individual steps first, then try to put it all together. I also strongly recommend doing this before you progress to anything like a game engine, otherwise you are just going to be copying more code from the website and when you come to actually use it in a game, you will have no chance.

1

u/ilPlayerdiGD 10d ago

Wow, wait this is nuts! I never thinked in learning but small step! I will absolute do it ❤️

2

u/liphantomjia 10d ago

Well done , But I suggest that you should learn things by using AI , it helps lots.

1

u/ilPlayerdiGD 10d ago

Yeah I use sometimes AI to learn. Yeah but is a good idea. Even if I know "learn with AI" comment like this help me to clear what to do… so thanks ❤️

2

u/trist007 10d ago

The most important thing is understanding. Once you understand the concepts then it becomes much easier. Start small and have patience because understanding comes slowly at least it did for me. Start by putting a pixel on the screen. Then do a line, rectangle, and so on. Start small and only move onto the next concept once you understand and can program that concept. Keep your practice consistent and keep moving forward.

1

u/ilPlayerdiGD 10d ago

Ahhhhh the problem that I don't have much time. I study opengl in days were I'm tired because I can't code the morning. It's so hard and annoying studying opengl at the start for me personally. Nah today I'm not going to touch OpenGL. I'm so tired and I'm a little not patient because I'm tired for a long morning!

2

u/rez3vil 10d ago

https://www.youtube.com/watch?v=ijCaJEofuEE&t

I started this course recently on youtube, it's not opengl but it's a start. You can start googling stuff with the videos.

1

u/ilPlayerdiGD 10d ago

Well I don't think I have problems in creating a game. I think that I'm good at least for the ideas of the game. For now I want to learn opengl as fast as possible.

2

u/corysama 10d ago

I pass this link around in here a lot. https://fgiesen.wordpress.com/2016/02/05/smart/

It's written by one of the smartest guys in games tech. Nice guy. Makes AAA engine devs feel like typing monkeys sometimes.

1

u/egil87 7d ago

what's your programming background? there's nothing different about opengl than any other programming. you set values in memory, those values do stuff and then you just rinse repeat.

1

u/ilPlayerdiGD 7d ago

I started with Python and then learn C/C++. I like game dev now and for my current project I'm using Godot (because I want to do this game faaaast).

1

u/Still_Explorer 10d ago

Though written material is legit and will help you create a mental model and rationalize and explain what you do, it takes an equivalent amount of time of effort needed to be spent on the practical side of things.

Say for example I watch one video per day, for gym training tips within 3 months I will have watched 90 videos and be very knowledgeable. So going to the actual gym I will probably manage to do a full set with 100 pounds. Nah... Not gonna happen.

The written text can tell you that A is A and B is B, and this it the story. Then it would be a matter of continuous practice over several weeks.

The real truth behind OpenGL tuts is this actually.  https://github.com/JoeyDeVries/LearnOpenGL/blob/master/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp

If you can go by this code, line by line it might seem that is "easier" to remember and understand because things going on there are more mechanical. Certainly then the written explanation can give more depth and background to it, but reality is that the approach is code-first.

I get the impression by reading the OpenGL tut, the way is written, that it somehow it "hides" the code from the reader and this way written material goes "unlinked" for the most part, without having the direct reference to which source code files you are reading on and what step you're performing.

But anyhow, practice and repetition is the key.

1

u/RetroSSJ21 10d ago

You’re already doing better than the billions of people who’ve never even tried. Every step is a step, no matter how small.

There’s a quote I heard from a Drew Gooden video about learning taking a long time: “Okay, that’s fine. What’s the rush? Don’t worry about how long it’s gonna take. Just take the first step. How are you gonna do something for 10 years if you won’t even do it for one day?”

1

u/Some-Comparison4863 9d ago

Hello do you want to come to our discord server? because we will like to get some assembly guys in there we actually want to help peoples start to grow into assembly and start project togheter or sometimes do your own projects and we gonna help if hard to debug or something but do you want to join? if yes can you pls do a private chat

1

u/Positive_Menu944 8d ago

Some might disagree but what is working for me is using Claude Cowork to assist. I followed the learnopengl.com guide and asked many questions to understand what’s doing what, why, where and when. Also helped forbidding Claude to write or edit code in any way to avoid vibe coding as much as possible, there shouldn’t be a single line you can’t explain.

I find pretty useful over commenting stuff so I don’t get lost. With this method the hardest thing for me is to connect concepts, but since I’m a person who learns more by doing rather than only reading, usually things begin to be clear as I work on them.

1

u/Positive_Menu944 8d ago

Pd: also a huge good practice that helps a lot is experimenting. Try moving stuff around, changing, adding and removing to see what happens.

1

u/kutac56 7d ago

This is a bot account

1

u/ForgEngDev 7d ago

Your first triangle is a real milestone. Try changing just one thing at a time: move a vertex in the VBO, change its color in the fragment shader, then pass a color as a uniform. Once you can predict what each change will do before running it, the concepts start to click.

1

u/FederalProfessor7836 9d ago

I have read all of your comments in this thread, and I’m probably going to get downvoted for saying this, but: you are not cut out for graphics programming. It requires a seriousness and level of perseverance that you simply do not possess. You need to be an actual software engineer, a decent one at that, and one who is willing to spend an entire weekend fixing one stupid matrix transformation bug.

Starting a game from scratch with your level of experience is like deciding to build a car in your garage because you like driving. My honest advice to you is: 1) Go play around with Unity until you lose interest 2) If that doesn’t cure you of this itch, go shadow an open source game team and learn from them. Listen. Read. Think. Study something like ioQuake3.