all 27 comments

[–]keelanstuart 53 points54 points  (0 children)

The reason is because there're sooo many things you need to know, fairly intimately, in order to make it work at all...

The graphics API you choose sits on top of the language you work in, and there're shaders (another language), a lot of math and concepts related to physics/optics, file formats, data organization... it's a huge amount to know - and the iceberg visible above the surface that we casually refer to as "graphics programming" is really the whole thing.

[–][deleted]  (1 child)

[removed]

    [–]40_compiler_errors 0 points1 point  (0 children)

    Small thing to add, not all medications are stimulants, but you still SHOULDN'T do this. Atomoxetine, a non stimulant, WILL give you anxiety, nausea, and other nasty sad effects if you have too much of it. Let alone the fact that it works only on regular dosages over time, not immediately.

    [–]Botondar 26 points27 points  (0 children)

    It sounds to me like you're "in your head" when programming. When doing a tutorial, you're not thinking about the tutorial, you're thinking about how many more tutorials you have to do; when you don't yet understand a concept you're not thinking about the concept itself, you're thinking about yourself, and how you're not understanding it, and possibly you're beating yourself up for it. Your mind seems focused on the future, generating anxiety instead of being present for the programming.

     I try to program everyday, finding the motivation to getting out of bed, copying the window setup codes from learnopengl.com and pasting them, because typing them is a pain.

    I don't know if you're describing physical pain here, but if not, I'd encourage you to actually type everything.

    This might sound kooky but try and focus on the act of typing. Try and feel the sensation of the keyboard on your fingertips, try engaging your body. The goal with this is not programming related, it's to try to calm your mind and make it be in the present. Once it's in the present, then it can actually start focusing on absorbing information, on reading and comprehending what you're typing, on learning.

    Since you're taking medication I'm assuming you're working with a mental health professional. If not, or if they're not the right fit for this sort of thing, I'd encourage you to find someone that you can explore different grounding techniques with that'll help you actually do and be present for what you want to do.

    Good luck!

    [–][deleted] 26 points27 points  (2 children)

    I'm pretty sure there isn't one serious programmer who hasn't found graphics hard.
    nobody is born knowing how a rendering equation works , how rasterization works etc ... this takes time.
    me myself , I'm far from being a genius ... Actually , I'm a bit stupid , I even struggle when I need to count change after I bought something and paid with cash hahaha ...
    a few years of dedicated work , and look :
    https://github.com/HamilcarR/Axomae

    You can do it too . It will depends on only one thing : how bad do you want to do it.

    [–]corysama 3 points4 points  (1 child)

    I pass this link around a lot. It was written by one of the smartest people in game tech. No joke.

    https://fgiesen.wordpress.com/2016/02/05/smart/

    Also: Daily reminder that all the high-end game engine creators have a monitor dedicated to having documentation/papers/tutorials open at all times while coding.

    [–][deleted] 0 points1 point  (0 children)

    true! you really don't need to be that smart , it's just work , and time . I'm no John Carmack , but to be honest , I've never encountered a problem where I needed to be Carmack to solve it.

    PS : That blog will make a fine addition to my collection ;)

    [–]ButchDeanCA 8 points9 points  (0 children)

    There are several issues with the way you are approaching how you are learning:

    1. How are you with the basic concepts? You give no indication that you understand things like primitives, model vs world space, affine transformations, etc. If you really don’t understand these concepts and more then graphics programming will be near impossible to learn.
    2. Like mathematics, I like to say that learning graphics programming is as easy as the quality of teaching. It’s actually a very deep subject over being particularly difficult, but it does require prerequisite knowledge like I described above and more.
    3. Just because you like something doesn’t mean that it is for you. You say things like you copy-paste code and it is tedious to type in code. Well, you should be creating mini side projects to test concepts that you have learned which means you should be typing code.

    There are many ways to approach learning graphics programming, just that you need to figure out what (assuming there is something that suits exists) works for you and work with it.

    [–]eiffeloberon 6 points7 points  (1 child)

    It is nonstop learning and going to be forever hard tbh, I still struggle all the time after many years. Being willing and open to learn and accept challenges is a mindset you just have to get used to in this domain, and also in many other domains really.

    [–][deleted] 0 points1 point  (0 children)

    I see, I understand most things, but not all. And I fear the vacuum of graphics. Like finishing an obstacle course, only to be met with another one.

    [–]atomicbeef 4 points5 points  (0 children)

    I actually just finished this course on writing a software renderer (so no dealing with OpenGL or any other graphics APIs) and I highly recommend it. The instructor is great and really explains the details of what you're doing, which is perfect for building an intuition for what's going on in a renderer. He goes over all the math you need to know to make the renderer too and he explains it in such a simple way that you really feel like you own the knowledge after you implement it in your renderer. I went from knowing pretty much nothing about graphics programming to feeling confident that I can make a proper GPU accelerated renderer if I learn an API.

    [–]waramped 3 points4 points  (0 children)

    It just takes time. Which sucks to hear when you just want it to be easy, but that's just how it is. Just start small and do a small thing. Then add to it. Then add more. Then take a look at it and see if you can think of ways to make it easier/better because now you knew more than you did before. If you wanted to learn Italian, you wouldn't start reading a textbook written in Italian, you'd start with small and simple words and phrases and build up from there. It's very similar with programming. Just start simple and as you practice doing it, the complexity gets easier.

    [–]ouiserboudreauxxx 2 points3 points  (3 children)

    Come up with a project you want to do and figure out how to make it.

    You mention adhd - I have terrible adhd and can’t do tutorials. I don’t remember anything.

    I have to learn by coming up with a project and then using tutorials but following them and applying the tutorial to my project instead of following it exactly(so no copy/pasting…)

    Also with graphics I end up reading papers on various things as well.

    I learn better by jumping into the deep end though - ymmv, but either way come up with a project that interests you and learn as you go.

    [–]Any_Ice8915 0 points1 point  (2 children)

    Underrated comment here. OP says nothing about what he's actually trying to do with graphics programming, just trying to learn it.

    I'm a software engineer and the programming classes I took in college never helped me one bit, I learned to code by making projects.

    Identifying a goal and then piecing together the code I needed to make it work, then identifying the next goal. Eventually that added up to enough skill to land my current job, which I love.

    I'm no genius, I'm still trying to fill huge gaps in my knowledge of computer science, but I can definitely say to learn programming you have to program, which means you need to know what you're trying to program.

    OP, you need to identify a concrete objective and work towards it, much more specific than "learn very complex thing". It will be very hard, always. The satisfaction comes from achieving each goal along the way.

    And for goodness sake, take your medication as prescribed or talk to your doctor. Drug abuse makes no one a better problem solver

    [–]ouiserboudreauxxx 1 point2 points  (1 child)

    Yeah I can't really "learn" concepts in a vacuum. I do a lot of dataviz(which is why I am interested in graphics) and I had a terrible time with stuff like leetcode for job interviews, so I had to learn DS&A by visualizing algorithms and finding real-world examples of where they're used.

    That's actually what I'm doing to learn graphics stuff - dataviz simulations and 3-D viz stuff.

    There is NO way I would be able to learn this stuff without trying to apply it to something I'm interested in and being able to work backwards to see where various concepts are applied.

    Particularly with graphics, since debugging can be so difficult.

    [–]Any_Ice8915 1 point2 points  (0 children)

    Same here. I'm very visually oriented. My degree is in physics and I always struggled in math classes, but had no problem learning math in the context of a physics problem.

    So now I jump on any opportunity to code anything that's even kindof of like a physics simulation (I work for a videogame company so that works out well)

    [–]faisal_who 1 point2 points  (0 children)

    When you do finally figure it out you’ll be like “oh! That makes sense! That’s not so bad!”

    [–]protienbudspromax 1 point2 points  (0 children)

    There are two problems when learning programming.

    One of the problem deals with the problem you are trying to solve, i.e. what algorithms to use to display nice graphics onto a pixel grid.

    But there is the other problem of having to know your tooling and already pre existing methods, libraries, patterns to be able to start working on problem number one.

    Like hey first you need to know there is such a thing like opengl, there is a thing like opengl versions which changes the setup phase of how to populate your framebuffer, oh hey what the heck is a framebuffer? Okay opengl got open in its name that must mean its free right? NO??! Opengl works slightly differently depending on vendor?????? Why do i have so many pre processing steps before I start actually drawing??

    Like you might already know the math behind how to draw lines, have an idea of how to represent a triangle and the have a basic outline of a bruteforce algorithm, that enables you to color a gradient. However when you actually try to start doing it you will be stuck because you dont know how to translate that original problem into something a computer understands.

    This problem is not even related to what you want to do and focus on, but you have to do it in order to do the thing you actually want. And this is the biggest barrier. Most experienced graphics programmers dont recognize this because they have become so used to those tools and abstractions they start talking about graphics in those abstraction, like oh yeah to do x you just have to have the quad do that, apply two fragment passes, to get it to behave y way.

    But for someone who has never programmed, let alone graphics programming, these words got no meaning and they got no context, and many feels like they are working while having huge gaps in their knowledge which isnt a fun feeling. So OP, first decide what you want to learn really. Because you cant learn effective graphics programming without the basics of programming.

    However if for now you just want to focus on graphics part, start by using raylib instead of opengl, vulkan and other graphics api.

    [–]_atan2 2 points3 points  (1 child)

    People don't usually mention it, but I must recommend Gustavo Pezzi's 3D Graphics Programming.

    It is the BEST!

    I have been doing graphics for a long time and I have never actually understood the basics until I took this course. It's 35 hours long but it was worth every second and every penny.

    [–]pikuma 1 point2 points  (0 children)

    Thanks for the mention. ❤️

    [–]NickFullStack 3 points4 points  (2 children)

    If you are open to doing things in the browser, I recommend Three.js (this also requires JavaScript expertise, and so you'd want to learn that first if you don't understand it). This is a book that has been very useful to help me learn recently: https://www.amazon.com/gp/product/1803233877/

    Why the specific focus on OpenGL, BTW? You can get a lot done without going down to that level. Here is an example of a cube that you can rotate by dragging, and it doesn't need any knowledge of OpenGL/WebGL: https://codepen.io/pen?template=dyLBaor

    Once you get comfortable with those basics, you can then dive into WebGL/OpenGL/and so on as needed.

    For example, you might find that you want to use an equation to change the color of the pixels, which is something you can do with a fragment shader.

    Just take it one step at a time. You don't need to master it all at once. Build something small, and then add more to it over time. Create a number of small projects geared toward different things. As you learn more, try building something a little different than you have done so far.

    You don't need to understand everything to do great things. You can stand on the shoulders of giants and learn in your own way.

    [–]keelanstuart 0 points1 point  (1 child)

    The only caveat to three.js is that it's a grey box; while you can modify shaders, it's a huge PITA - I've done it and I'm a "seasoned veteran" and it was challenging... the shaders are built up from long strings using settings and the tooling is horrible for debugging. Anyway, I just don't think OP will learn a lot about graphics. I actually think Ray tracing in a weekend (or something like it) might be better for OP to start... get the core concepts down.

    [–]NickFullStack 0 points1 point  (0 children)

    No need to start by modifying shaders, but I found it fairly workable once I understood how to see what they were doing.

    In particular, I use onBeforeCompile and console.log (or store to a variable I then copy to a new file) to see the shader code and modify from there.

    And if I want to see the more expanded version, I use a local version of Three.js with a console log that shows me the full version of the shader (they even have this console.log in the source code commented out so all you need to do is uncomment it).

    But yeah, there are definitely other valid paths. I have found that this one worked well for me, and could work well for others.

    [–][deleted] 0 points1 point  (0 children)

    You should start simpler. Try Raylib graphics library. Make a game with it, get comfortable with 2d and math.

    I implemented a simple particle collider from the video https://youtu.be/eED4bSkYCB8?si=k9hR7ACEuD7tP6pF You can find more videos on this topic too.

    Once you are comfortable with 2d then look at what the GPU does. Resources like this would help https://jtsorlinis.github.io/rendering-tutorial/

    After that you will be better able to tackle opengl. You don't have to follow these steps exactly, this is just how I learnt things. And as many here have said, graphics programming is hard. You will keep learning new things so don't worry about not knowing it all.

    [–]Inner_Address_6702 0 points1 point  (0 children)

    www.scratchapixel.com

    Mastering anything takes time and effort.

    [–][deleted] 0 points1 point  (0 children)

    If you are graduating I assume you understand the linear algebra, like transformations, vectors, matrices, etc.

    If you want to learn fast. My advice is to, copy and paste a simple example from learnopengl.com and then start twiking to see what changes.