294 points · by BigJono · 9y ago · 76 comments
Are the old recommendations still relevant? Or are there newer books which are more relevant to someone looking to get into the field today?
A lot of the theory from classic books is still valid, so even a copy of Computer Graphics: Principles and Practice will look fine on your desk. "Real Time Rendering" by Moller/Haines and "Physically Based Rendering" by Pharr are excellent. "Game Engine Architecture" by Gregory and "Mathematics for 3D Game Programming and Computer Graphics" by Lengyel will probably prove very useful and relevant to you as well.
Online resources, the free https://learnopengl.com/ and the $10 http://graphicscodex.com/ are both fantastic. Make sure to read https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-..., and also study the techniques used for the craziest entries in https://www.shadertoy.com/
And then, lots and lots of papers and presentations from the past 5 or 10 years of Game Developers Cconference and Siggraph.
It makes advanced techniques infinitely easier. There is stuff you just couldn't do on the fixed function pipeline without a vendor-specific extension. But it makes for a huge learning curve for simple stuff.
For that reason, I general suggest people start with a game engine like Unity or PlayCanvas, or if they are already experienced programmers, a scene graph like Three.js.
Why would you this though? You'll restrict yourself to a comparatively tiny market (10% PC market share, 20% smartphone market share), and your low level knowledge will be somewhat nontransferable.
This is better than starting directly in Vulkan/DX12, quickly getting overwhelmed and giving up. Plus it makes the step from GL/DX11 easier.
I bought an iPad last month just so I can play with Metal on an actual iOS device at home :)
I don't think hobbyists care about market share that much; they want to get hands-on and learn, and Metal is a rather fun API to work with.
My copy of CGPnP is from 1993. Math doesn't get old, we just build more on top of it ;-)
When I first started out, I chased book after book looking for knowledge. "Someone must know how to make things look real, right? Everyone is talking so authoritatively on the topic." No, no one knows. There's no source of knowledge that represents the cutting edge of the field, because the cutting edge is whatever happens to look pretty good today. And that's mostly thanks to very good art, not very good techniques.
Just dive in and start doing geometric puzzles. Look at it like a game, not like a quest for knowledge. If you have fun with it you'll go further than any book will take you.
The trend in film rendering is, across the board, graduating from "tricks" that work to physically based processes, to whatever degree it is feasible. The setups are getting simpler, not more complex. The surface modeling, material modeling, color processing, lighting and rendering have all moved by leaps and bounds in last 10 years. It is is the process of shifting from art to physics, and the job of CG lighting technicians is becoming closer to the job of stage lighting technicians, because the lighting and rendering is physically based now.
It's possible there are developments you don't know about. It's also possible you're suffering from evidence of Sturgeon's law and not seeing the top 10% clearly; there is plenty of crappy CG that doesn't look real, the vast majority of it doesn't look real. But the best of it is realistic and getting better every single year, and the people studying it do know some ways (and are currently adding more) to improve the realism when the computational power arrives.
I'll give you a simple way to defeat any question of whether we know how to make something look real: What does it mean to multiply two colors?
If you chase down the logic, the true answer is "It's meaningless. It just happens to be an approximation that looks good in most cases." But it has nothing to do with how light works in real life. Yet every engine multiplies colors because the alternative is too computationally expensive -- and it still wouldn't produce realistic results because we don't source our art from real life. Artists typically control the content, and any art-driven pipeline is doomed to look pretty good but not real.
I've written about this before:
https://news.ycombinator.com/item?id=13892671
https://news.ycombinator.com/item?id=12461883
https://news.ycombinator.com/item?id=13893305
The only technique that we know produces realistic video is if you mix actual, real footage with simulated content. That's very effective, but it's unsatisfying for obvious reasons. I think it hints at a way toward fully simulated realistic video, though.
There are so many interesting aspects of modern computer graphics that have nothing to do with rendering realism. My favorite is visualization, or using graphics to create a visualization of a process that is not visible normally like fluid dynamics. But there are lots of others.
I think that if you start from the most featured APIs you end up jumping in with a hugely steep learning curve that really hinders learning. Starting from the basics, very simple OpenGL or WebGL rendering, learning the algebra behind projections so you can think about what you want to see, and then the notions of texturing and shading, all help get from not knowing anything to knowing something much more efficiently.
Unpopular? By whom? Computer graphics is a crafty bag of tricks sprinkled on top of very concrete linear algebra and computational geometry.
That said, it's actually hard to create appealing images just in plain old photography, so anyone thinking computer graphics would facilitate any artistic aspects is in for disappointment.
The math needs to work, but you need artistic talents to make anything look good/real.
Yeah. Computer graphics is all smoke and mirrors... except smoke and mirrors, because those are difficult :-)
The real world is high dynamic range, but human vision is much more limited, but also spacially variant and adaptive. So we get multiple optimized "snap shots" of a scene rendered in real time and mapped into what our brain considers one scene. Look toward high key high brightness area of a scene, retina gain function clamps down the iris closes and you get properly rendered details in those areas, look toward a tree shaded bench at a rock under that bench and iris opens, gain function increases and again the shadow details are rendered. Cameras are just starting to do this.
But that's capture. It's still HDR. Now you have to re-render all of that if you're going to reproduce it on a lower dynamic range device like a computer display. There aren't that many HDR screens on the market yet but those are also coming, and it means we don't have to do that next stage re-rendering which is a lot more subjective and still actively researched why some renderings look real and others look cartoonish.
And the same would be true for computer generated graphics rather than captures.
---
Vulkan is pretty boring to be honest. I'm very doubtful that you want to bother with it if you're just starting. Using these APIs is like filling out tax forms, but Vulkan is a lot more effort than OpenGL (but, OpenGL is weird...) Learning shaders in OpenGL will be pretty transferable knowledge. Vulkan uses a lower-level assembly-like language, SPIR-V that doesn't pretend to be C (like GLSL) but there are GLSL to SPIR-V compilers. I can't comment on DX (I haven't used it.)
Here's a tutorial on drawing you first triangle: https://software.intel.com/en-us/articles/api-without-secret... . Note that there is a lottttt of code to do this (this is part 3...) I really think you could learn more about modern graphics with glBegin(GL_TRIANGLES) and writing GLSL shaders than boring yourself with Vulkan.
If you do want to play with Vulkan there is this book (piggy-backing off the rep from the old "OpenGL Bible") https://www.amazon.com/Vulkan-Programming-Guide-Official-Lea... . I can't give it an honest review because I got bored; I plan to pick it up again later...
Taking for example OpenGL, in the old days you could just download a NeHe project to use as a framework to learn from. To render basics you just specified triangles by their vertices with e.g. glBegin(GL_TRIANGLES) as Jacob says. In a small number of days you could have been close to the front tier of graphics development.
But then it became far more complicated as graphics cards added tons of optimisations to improve speed. Instead of just specifying triangles you then had to create lists, indirect lists, bindings etc. Now as per his example, you have to add a ton of extra boilerplate to just render a simple triangle. And if it doesn't just work it's very hard to figure out why.
What you can also do is use an engine like Unity, then just set it up so that you add some direct OpenGL calls in to create and render objects (I use it in this manner for some dynamics things, when I don't want to create GameObjects for Unity to manage). But that's not a very "pure" way of learning graphics development. I guess it also comes down to what you want to do with the knowledge in the end.
It's true the modern OpenGL pipeline is a bit more boilerplatey.
But that small amount of extra code means it's vastly more flexible. Rather than programming stuff into a fixed pipeline that can only do a limited set of predetermined things, everything is centred around shaders you write, and they can do anything you want. The boilerplate is just needed to compile the shaders, and feed information to them.
Also, while it's slightly more code you're writing, the amount of code executed on the CPU is less, because mostly you just set up a draw call and let the GPU do the rest. Much more efficient.
And the boilerplate is small, if a little intimidating. This stars effect is 156 lines of JS code (of which only about half is actual WebGL stuff), and 24 lines of GLSL shader code: https://hoshi.noyu.me/
(I should add that I used to feel the same way and really didn't get modern OpenGL, but after a few abortive attempts I finally grokked the basic concepts, and once you have those, it's plain sailing, because most things are just small changes to shaders.)
1. What's all this matrix crap? I can take object and camera coords and calculate out a screen coordinate easily with some simple algebra and trig.
2. Oh, OK. Use matrices properly, and you can get rid of some repeated operations.
3. Classic GL mostly takes care of the matrix operations for me, and leaves me with a simple-ish interface for modifying the state machine (goodness, there's a lot of data to feed into it though).
4. Modern OpenGL: Erghh, boilerplate!
5. Build some utility functions and bootstrap yourself out of there, and the interface is so much more powerful. Sure, you have to explicitly specify some more things. Another way to put that is that you can change things that used to be implicitly defined. It's a wonderful bit of freedom, actually.
Rendering a triangle to the screen is easy; it takes understanding the unique way these tools work, but at the end of the day it's not complicated stuff.
The playlist for WebGL is https://www.youtube.com/playlist?list=PLPqKsyEGhUnaOdIFLKvdk...
I'm also covering 3D Math fundamentals now.
My channel https://www.youtube.com/user/iamdavidwparker
- The siggraph courses on shading [1]. The 2017 course will be on 30th of July [2]. Current techniques from AAA engines.
- Papers from JCGT [3].
- Plus the paper collection from Ke-Sen Huang linking all graphics related conferences [4]
have fun reading
[0] http://www.realtimerendering.com/book.html
[1] http://blog.selfshadow.com/publications/s2016-shading-course
[2] http://blog.selfshadow.com/publications/s2017-shading-course...
https://learn-anything.xyz/computer-graphics
The basics node has the best resources for learning the subject.
If there was a genuine interest in helping the transition to the newer API's, the different parties writing and implementing today's API's would publicly make available the code for emulation layers to the older API's.
If you're interested in computer graphics in general, and googling "modern computer graphics", then the Vulkan/DX12 APIs aren't super important, the fundamentals of CG have not changed at all. The paradigm shift with those APIs is centered on performance, not on new concepts. You can learn vast amounts of computer graphics by writing a ray tracer or animation program or using off the shelf renderers, and never touch Vulkan or DX12.
There are definitely lots of great suggestions here, but it's a wide variety, because it all depends on what you envision or hope to do. It doesn't have to be fully formed or thought out, but if you had some inking like 'hey I saw this awesome procedural animation on Vimeo and I want to learn how to do that' or 'I'd love to work for Valve someday... what steps do I have to start taking?' or 'I was thinking I should add some 3d to my website' or 'I want to be a film animator', if we had a little more insight on what you're hoping, we can definitely get answers that will be more focused and helpful.
I also have a secondary goal, which is to move to another industry, as I'm starting to get a bit disillusioned with front-end web development. That's in the future though, and CG would be only one of many different fields I'd be considering.
For non-real-time there is: http://www.pbrt.org/
For real-time there is this: http://www.realtimerendering.com/
Neither book gets into the details of the specific API, they are theoretical.
Real-time techniques change nearly complete about every 10 years because GPUs get faster and render more techniques possible and obsolete the older less good looking techniques.
https://github.com/EpicGames/UnrealEngine/tree/release/Engin...
You need to join the org first, https://github.com/EpicGames/Signup
1) To make games (commercial games) or other realtime graphics application?
2) To make 3D rendering software or other semi-non-realtime software?
3) To have fun / learn?
4) Etc.
If you just want to learn/have fun, my personal recommendation is to write your own software, from the ground up. Ignore DirectX and OpenGL (unless you need them for a context to get pixels on the screen). Use a fast, native language like C/C++.
Teaching yourself and exploring is 100x more fun than reading a book, IMO (at the same time, you may learn faster using a book).
Try working with a naive projection algorithm to get 3d points on the screen. Like y' = y +/- z (Zelda-esque bird's eye view). When you are comfortable with matrices and vectors, learn "real" projection algorithms.
https://www.amazon.co.uk/dp/B00LAMQYF2/ref=cm_sw_r_cp_dp_T2_...
https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-eb...
It's a great overview of the subject. I /really/ like that each chapter is fairly short, you have a working example at the end of each one, he explains both the concept and why he approaches a certain way in code.
I should also mention, learning raytracing won't directly help if you're trying to learn realtime computer graphics.
Do any of these new Vulkan (or Metal or DX12) techniques actually exist yet?
Edit: Maybe covered WebGL too.