We recap a bunch of new features and tweaks that got added during our weeklong vacation away from the stream: there’s a new shader and interface for handling 3D debug draw, a few of the most annoying bugs have gone away, and the code got refactored a bit for ease of use. Next, we decide to try adding lighting, after spending several sessions talking about it but not actually doing it. We spend most of the time learning to use Blender and tweaking our models. Once that’s out of the way, we’re amazed to discover how little code it takes to get the lighting working.
- Do people eat Pokemon? https://kotaku.com/no-one-knows-if-people-eat-pokemon-1826423766
- Figuring out what you’re clicking on in a 3D scene is known as “object picking” or just “picking”. There are various techniques for doing this. I used some math from Van Verth and Bishop, but there are plenty of tutorials elsewhere.
- Here’s a neat analysis of Cyberpunk’s deferred shading pipeline, which admittedly we don’t understand very well: http://c0de517e.blogspot.com/2020/12/hallucinations-re-rendering-of.html
- Vulkan replaces OpenGL as a more modern, lower-level graphics programming standard. Here’s a tutorial: https://vulkan-tutorial.com/Introduction
- The web is unlikely to get Vulkan directly, but there is a new standard called “WebGPU” in the works: https://en.wikipedia.org/wiki/WebGPU
- Rendering opaque stuff is easy, because you can let the depth buffer figure out what’s visible and what’s hidden. Unfortunately, it’s a lot trickier with transparent stuff: https://developer.nvidia.com/content/transparency-or-translucency-rendering
- Keyframe animation: https://en.wikipedia.org/wiki/Key_frame
- Fast approximations of spherical linear interpolation (slerp): http://number-none.com/product/Hacking%20Quaternions/index.html
- We learned a lot reading this concise postmortem for Voidcall, a 13kb 3D browser game: https://phoboslab.org/log/2019/09/voidcall-making-of
- The glTF 3D object format: https://www.khronos.org/gltf/
- A more detailed explanation of diffuse lighting: https://learnopengl.com/Lighting/Basic-Lighting