I have been wanting to learn graphics programming for a while, so I picked up Computer Graphics from Scratch [0] today, but found the math confusing. Can you recommend me some primer books on graphics programming which do not assume much mathematical background? What are some concepts which are absolutely necessary to know? Can you point me to some resources which might be helpful?
Thanks!
[0] https://www.gabrielgambetta.com/computer-graphics-from-scratch/
Other important things to learn are what Vector and Fragment shaders are. I think this course is a good intro for it: https://github.com/ssloy/tinyrenderer
Lastly, when you are ready to start writing real graphics code, you might want to consider using something like Metal if you are on macOS. I have found it to have a much better API than OpenGL. Here's a good book on the topic: https://gumroad.com/l/metalbyexample . I haven't used DirectX, but I imagine its probably much better than OpenGL too.
If you do want to use OpenGL, I found these to be good resources: https://open.gl and http://learnopengl.com/
Don't worry about "getting the math background" these courses should be required at any university for any engineering major, so you'll be getting the necessary math regardless of your interest.
E.g, learn an open source 3D framework like three.js and build stuff with it. Once you get good building 3D scenes and apps, learn how to extend three.js with custom functionality. Then learn the low level WebGL APIs the three.js is built on top of and implement your own graphics framework. Since three.js is open source, you can learn quite a bit by just examining the code.
You could also do something similar with the Godot Engine or any other open source 2D/3D framework.
Why not get the math background first? You're at university, now is the best time to take some math classes.
Ray tracing is a good way to start IMO, because it's easier to understand than rasterization, it's easy to write your own simple ray tracer, and it relies almost entirely on the math. So I definitely recommend finding some tutorials for that.
Peter Shirley's "ray tracing in one weekend" book is a popular one.
You could also look into doing ray marching instead of ray tracing, which is slightly more complicated, but fundamentally the same, you can actually see them in realtime on most hardware, even on mobile (examples: https://www.shadertoy.com/)
[0] https://www.youtube.com/watch?v=Y_vvC2G7vRo&list=PLEETnX-uPt...
http://blog.wolfire.com/2009/07/linear-algebra-for-game-deve...
http://blog.wolfire.com/2009/07/linear-algebra-for-game-deve...
http://blog.wolfire.com/2010/07/Linear-algebra-for-game-deve...
The RTR site is an incredible resource for anyone interested in the field. Note that their book ("Real-Time Rendering") is not an introductory text, but an intermediate overview that is best read after you've made yourself comfortable getting a few triangles on the screen using whatever API you prefer.
I think in 2021 if your looking to get in to graphics, your expected to at least know some ray tracing.
There is this ray tracing series I would recommend [0]
There are 2 different areas. One is the geometry and the math. Second is the libraries that make the graphics.
What was fun for me, was thinking of an idea eg. make a circle move along a given path. Then evaluating the different libraries to see how to achieve it. Then, when the libraries themselves needed modification, jump into the mathematics, geometry and algebra. I did not read books but just looked up articles and videos that cover the topics of interest.
Its a lot of fun that combines math, art and programming.
Wish you lotsa success and fun :-)
I find that the hardest part of graphics programming is understanding all the boilerplate, setting up GPUs, buffers, etc. So I'd recommend skipping this part as you're learning since it's hardly rewarding. If you just want to draw pixels on a screen there's a few libs that do the heavy lifting and give a frame buffer to write to:
https://crates.io/crates/pixels https://crates.io/crates/minifb
Writing to a pixel buffer is the most low level way to do graphics programming, but it can also be the slowest in comparison to sophisticated libraries or using a GPU. I'd recommend doing some sort of experiment on a frame buffer to get familiar with it since it never goes away, just abstracted.
The next step up in complexity would be using a 2d or 3d rendering library. These provide primatives like circles or spheres that you can put together to make a larger scene. Here's some I've used:
http://raylib.com/ https://crates.io/crates/tiny-skia
You can put things together pretty easily with these libs. And they also let you skip the gpu boilerplate (I should note that tiny-skia works only in the CPU).
Lastly, you have shader programming (OpenGL, Vulkan, etc.). If you're writing "production code" you'll have to do some setting up of the GPU, and the actual graphics code will be in a separate shader language. Shader languages are similar to C but with restrictions that allow for a high level of parallism, making it extremely fast. If you want to get started with this I'd recommend playing around on a site like shadertoy[1] where you can start writing shaders right away. I haven't done much of this myself but as far as Rust goes I've seen a lot of references to the gfx crate:
I hope this helps
Steven Wittens: Making WebGL Dance https://www.youtube.com/watch?v=GNO_CYUjMK8
It doesn't actually get into the math until about 12 minutes in, but it might be illuminating. Matrixes, vectors, and how they are multiplied with each other are the fundamental magic of 3D graphics.
Once that reaches it's limits I'd go to something closer to the metal. A lot of the lessons/intuitions learned will be useful here as well.
Their editor is pretty cool: http://editor.thebookofshaders.com/
https://www.amazon.com/Math-Primer-Graphics-Game-Development...
https://www.youtube.com/playlist?list=PLQ3UicqQtfNuBjzJ-KEWm...
To learn from code instead dive right into the ThreeJS examples
Best of Luck!
We had to build our own simple ray tracer from scratch. Those were some long, long all-nighters. I learned the hard way that you have to offset the rays ever, ever so slightly or you get some super bizarre effects that drove me crazy...
looking through other posts, there were definitely few or no tutorials back then, sigh.
Now I'm a UX engineer in health tech ;)
Can you be more specific about what graphics programming means to you?
Why get specific? It's an industry with dozens of specializations along the technical spectrum.