cinera_handmade.network/cmuratori/hero/code/code420.hmml

69 lines
6.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[video output=day420 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Pushing Lighting Information Directly" vod_platform=youtube id=ATBQfmQMdVk annotator=Miblo]
[0:05][Recap and set the stage for the day streaming on YouTube[ref
site=YouTube
page="Handmade Hero Live Stream"
url=https://www.youtube.com/c/HandmadeHero/live] for the first time][:speech]
[1:43][:Run the game to see our current, slow :lighting solution][:rendering]
[2:27][Make PlayWorld() generate only one room][:"procedural generation"]
[2:43][:Run the game to see the :lighting at a more playable rate][:rendering]
[3:06][A few initial words on algorithmic :optimisation][:speech]
[4:52][ComputeLightPropagation() TODO(casey): Before moving on, be sure to index allocation management in the renderer][:lighting :memory :rendering]
[7:03][:Lighting Work][:blackboard :optimisation :rendering]
[10:39][Reducing emitters × surface O(n²)][:blackboard :lighting :optimisation :rendering]
[16:10][Spatial partitioning][:blackboard :lighting :optimisation :rendering]
[19:09][Multiresolution approach][:blackboard :lighting :optimisation :rendering]
[21:04][Multigrid approach][:blackboard :lighting :optimisation :rendering]
[21:49][Comparing and combining these approaches][:blackboard :lighting :optimisation :rendering]
[25:53][Cubes - or, rather, axis-aligned bounding boxes (AABB) - as :lighting elements][:blackboard :optimisation :rendering]
[28:06][The steps to produce this AABB-based :lighting solution][:blackboard :optimisation :rendering]
[33:05][The difficulty in handling the transfer of light between tightly bound ground cubes][:blackboard :lighting :optimisation :rendering]
[38:11][Check the time][:admin]
[38:27][@insobot][38 minutes into the main stream. 82 until Q&A. (based on NOTE)]
[38:34][Consider our proposed approach][:blackboard :lighting :optimisation :rendering]
[41:39][:Run the game to inspect the :lighting][:rendering]
[42:08][Determine to modify our :lighting to use AABBs][:optimisation :rendering :speech]
[43:24][Introduce (a commented out) lighting_box, and add SurfaceCount and Surfaces to game_render_commands][:lighting :optimisation :rendering]
[49:41][Add LightPointCount and Lights to game_render_commands][:lighting :optimisation :rendering]
[52:31][Determine to pare down ExtractReflectorsFromQuads() and consider how to enable :lighting points and surfaces to correspond][:optimisation :rendering :speech]
[56:15][:Run the game to illustrate the notion of sharing :lighting information across boundaries][:optimisation :rendering]
[57:40][Enable PushCube() to push onto a lighting_surface array][:lighting :optimisation :rendering]
[1:01:20][Positioning the surface at the most negative corner of an axis-aligned cube][:blackboard :geometry :lighting :optimisation :rendering]
[1:02:03][Continue to enable PushCube() to push onto a lighting_surface array][:lighting :optimisation :rendering]
[1:03:17][Generating the surface normals][:blackboard :geometry :lighting :optimisation :rendering]
[1:03:41][Make PushCube() push all six surfaces][:lighting :optimisation :rendering]
[1:05:43][Understanding XAxis and YAxis in a right-handed coordinate system][:blackboard :geometry :lighting :optimisation :rendering]
[1:06:02][Make PushCube() set the XAxis and YAxis][:lighting :optimisation :rendering]
[1:09:04][Make PushCube() set the LightIndex and LightCount][:lighting :optimisation :rendering]
[1:10:19][Understanding Width and Height][:blackboard :geometry :lighting :optimisation :rendering]
[1:10:56][Make PushCube() set the Width and Height][:lighting :optimisation :rendering]
[1:13:17][Make PushCube() generate the :lighting points on the surfaces][:optimisation :rendering]
[1:15:39][Discover a potential bug with PushCube() erroneously resetting the AverageDirectionToLight][:lighting :rendering]
[1:16:54][Temporarily comment out our recent changes to try][:lighting :optimisation :rendering]
[1:17:41][:Run the game to see the old :lighting][:rendering]
[1:17:52][Try to prevent PushCube() from clearing the AverageDirectionToLight][:lighting :rendering]
[1:19:10][Continue with our new PushCube() solution, adding EmitC0 to the lighting_point][:lighting :optimisation :rendering]
[1:27:00][Allocate these :lighting points per surface][:memory :optimisation :rendering]
[1:34:28][:Run the game to see our :lighting solution][:rendering]
[1:35:13][Toggle off most of ExtractReflectorsFromQuads() to start to use the :lighting surfaces and points instead][:optimisation :rendering]
[1:39:03][:Run the game to see that we are slower, but working][:lighting :optimisation :rendering]
[1:39:56][Replace ExtractReflectorsFromQuads() with inline operations in LightingTest()][:lighting :optimisation :rendering]
[1:43:00][Replace static arrays in lighting_solution with pointers][:lighting :optimisation :rendering]
[1:43:35][:Run the game to see that it works][:lighting :optimisation :rendering]
[1:44:05][Add a TIMED_FUNCTION in OutputLightingTextures(), OutputLightingPoints(), LightingTest() and ComputeLightPropagation()][:"debug system" :lighting :profiling :rendering]
[1:44:41][:Run the game and inspect the profiler][:lighting :optimisation :profiling :rendering]
[1:45:30][Add a DEBUG_VALUE to LightingTest()][:"debug system" :lighting :profiling :rendering]
[1:46:22][:Run the game and inspect the SurfaceCount and PointCount in the profiler][:lighting :profiling :rendering]
[1:48:05][Note that we could propagate light across frames][:lighting :rendering :speech]
[1:48:54][Glimpse into the future of passing AABBs down directly][:lighting :optimisation :rendering :speech]
[1:49:23][Q&A][:speech]
[1:50:11][@Kknewkles][Q: How come Bink2 isn't used, prevalently at that, in video playback across all of the video-playbacking use cases? Why is it the incumbent sovereign only in video games?][:codec]
[1:52:46][@derpzerker][Q: Was there a bug with light leaking behind the walls that was newly added?][:lighting :rendering]
[1:52:56][:Run the game to look for light leaking][:lighting :rendering]
[1:54:30][@derpzerker][Q: Maybe not, I thought I saw the light leak through the bottom wall][:lighting :rendering]
[1:55:24][@AsafGartner][Q: I'm getting pretty frequent audio popping. Other people noticed it as well. I recorded a sample]
[1:56:03][@qq][Q: When you write code in an exploratory fashion, and you end up with something that works well but is too large and complex to fit in your head at once, how do you simplify it back into something manageable?]
[1:57:21][@Jim0_o][Q: Will you continue (dual) streaming to YouTube?]
[1:58:05][@qq][Q: Are you concerned with compile times at all so far? I saw CTIME reporting 2.7 seconds. Time to pop in a threadripper?]
[1:59:22][End the stream for today][:speech]
[/video]