diff --git a/cmuratori/hero/code/code581.hmml b/cmuratori/hero/code/code581.hmml new file mode 100644 index 0000000..1573291 --- /dev/null +++ b/cmuratori/hero/code/code581.hmml @@ -0,0 +1,96 @@ +[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Preparing for Octahedral Indirect Lighting" vod_platform=youtube id=axbGjkYgXO4 annotator=Miblo] +[0:04][Recap our new radial interpolation of :lighting samples and set the stage for the day][:speech] +[3:43][This is @Molly Bean][:speech] +[4:58][Determine to: 1) Use the ray caster in the octahedral light maps, and 2) Streamline the :lighting voxels intermediate storage out of the equation][:speech] +[8:55][Demo the current state of the :lighting, noting our artifacts when a light passes through a probe, and the persistent flower shape due to texel interpolation][:run] +[11:14][Toggle off the light probe drawing in EndLightingComputation()][:"debug visualisation" :lighting] +[11:31][Traverse the garden without visible light probes][:lighting :run] +[12:06][Toggle off EDGE_COLORING in EndLightingComputation() and the light and depth map viewers in OpenGLEndFrame()][:"debug visualisation" :lighting] +[12:51][Traverse the clean garden, with the determination to bounce light around][:lighting :run] +[13:19][Set up to use the ray caster in the octahedral light maps][:lighting :research] +[14:36][Remove the accumulation data from light_voxel_cell, for EndLightingComputation() to update the light directly, enabling TEST_LIGHT_TRANSFER][:"data structure" :lighting] +[17:26][See a data-less world][:lighting :run] +[17:37][Remove SpamVoxel() and trim down SpamVoxelSlice()][:lighting] +[20:36][Consider casting rays from locations other than at light probes][:lighting :speech] +[22:23][Rename SpamVoxelSlice() to SpamVoxel() and make it blend in the :lighting directly, augmenting lighting_solution with tUpdateBlend][:"data structure" :lighting] +[28:36][Make TestCastFromProbes() pass an octahedral light map location to SpamVoxel(), introducing GetOctahedralOffset()][:lighting] +[39:30][See some :lighting][:run] +[41:40][Investigate our apparent voxel spamming bug][:lighting :research] +[44:05][Make TestCastFromProbes() always call SpamVoxel(), whether or not we hit a light][:lighting] +[44:25][See that we mostly write out a tile's :lighting only once we stand on it][:lighting :run] +[45:03][Investigate our light writing bug][:lighting :research] +[46:31][Scrutinise OctahedralFromUnitVector() and GetOctahedralOffset() for bugs][:lighting :research] +[49:45][Break in to GetOctahedralOffset() and inspect its values][:lighting :run] +[54:25][Make SpamVoxel() write structured art into the voxel][:"debug visualisation" :lighting] +[56:28][See no structured art in the voxels][:"debug visualisation" :lighting :run] +[57:05][Scrutinise EndLightingComputation() for bugs][:lighting :research] +[58:47][Make SpamVoxel() write red everywhere][:"debug visualisation" :lighting] +[59:02][Only see red in voxels we land on][:"debug visualisation" :lighting :run] +[59:15][Wonder why we're apparently not spamming the voxels][:"debug visualisation" :lighting :research] +[1:00:41][Break in to SpamVoxel() and watch it write to all the voxels][:"debug visualisation" :lighting :run] +[1:02:25][Try making TestCastFromProbes() pass an upward-pointing OctOffset vector to SpamVoxel()][:lighting] +[1:03:16][See red spammed as expected][:"debug visualisation" :lighting :run] +[1:03:43][Revert SpamVoxel() to use the computed :lighting values] +[1:04:02][Find that moving the light around does not change the intensity][:lighting :run] +[1:04:40][Make TestCastFromProbes() fall-off the light][:lighting] +[1:05:44][See our lighting fall-off work correctly][:lighting :run] +[1:06:28][Revert TestCastFromProbes() to only call SpamVoxel() if we hit a light][:lighting] +[1:06:38][Find that we fail to light into newly visible corners][:lighting :run] +[1:06:59][Make TestCastFromProbes() always call SpamVoxel(), but blank out the LightC it we didn't hit a light][:lighting] +[1:07:44][Find that our light interpolation is pretty fast][:lighting :run] +[1:08:24][Try reducing the tUpdateBlend in EndLightingComputation()][:lighting] +[1:08:38][Find that our light fades out slower than it fades in][:lighting :run] +[1:09:38][Try further reducing the tUpdateBlend in EndLightingComputation()][:lighting] +[1:09:46][Watch the speed of light fading][:lighting :run] +[1:11:09][Prevent TestCastFromProbes() from boosting the light brightness][:lighting] +[1:11:19][Briefly watch our light fade][:lighting :run] +[1:11:34][Increase the tUpdateBlend in TestCastFromProbes()][:lighting] +[1:11:50][Consider our light fade in and out to be more uniform][:lighting :run] +[1:12:08][Reduce the tUpdateBlend in TestCastFromProbes()][:lighting] +[1:12:10][Find that our light fades out slower than it fades in][:lighting :run] +[1:13:45][Hunt the code for other pieces of non-linearity in the light fade in / out][:lighting :research] +[1:16:54][Make a note in SpamVoxel() to hunt down the attack / decay non-linearity][:lighting] +[1:17:37][Our faster attack may happen if two out of three probes switch from 0 to 1][:lighting :speech] +[1:18:36][Make GenerateRoom() generate one, rather than two, light probes per tile][:lighting :"procedural generation"] +[1:19:17][Find that our light still fades out slower than it fades in][:lighting :run] +[1:20:11][Make GenerateRoom() generate zero light probes per tile][:lighting :"procedural generation"] +[1:20:24][See no :lighting][:run] +[1:20:27][Make GenerateRoom() generate one light probe per tile][:lighting :"procedural generation"] +[1:20:44][Find that our light still fades out slower than it fades in][:lighting :run] +[1:21:02][Revert GenerateRoom() to generate two light probes per tile][:lighting :"procedural generation"] +[1:21:06][Consider how to investigate our fading speed discrepancy][:lighting :speech] +[1:21:48][Begin to plot our :lighting update equation in Desmos[ref + site=Desmos + page="Untitled Graph" + url=https://desmos.com/calculator]][:mathematics :research] +[1:24:29][Set the day][:admin] +[1:25:26][:Lighting Linear Blend Per Frame: In vs Out][:blackboard :mathematics] +[1:33:46][Further study: Perceptual rate of fading in vs out][:blackboard :lighting :mathematics] +[1:35:25][Remove Frumbledygok(), and toggle from TestCastFromProbes() to ComputeLightPropagation() in EndLightingComputation()][:lighting] +[1:37:26][Make ComputeLightPropagationWork() call SpamVoxel() and cast our real rays into the octahedral light map][:lighting] +[1:42:34][Begin to update ComputeVoxelIrradianceAt() to sample the octahedral light map][:lighting :sampling] +[1:45:47][Diffuse :Sampling][:blackboard :lighting] +[1:49:47][Consult 'Dynamic Diffuse Global Illumination with Ray-Traced Irradiance Fields'[ref + title="Dynamic Diffuse Global Illumination with Ray-Traced Irradiance Fields" + author="Jean-Philippe Guertin, Derek Nowrouzezahrai, Morgan McGuire" + url=http://jcgt.org/published/0008/02/01/] on diffuse :sampling][:research] +[1:52:22][Consult 'Real-Time Global Illumination using Precomputed Light Field Probes'[ref + author="Morgan McGuire, Michael Mara, Derek Nowrouzezahrai, David Luebke" + title="Real-Time Global Illumination using Precomputed Light Field Probes" + url=https://casual-effects.com/research/McGuire2017LightField/] on diffuse :sampling][:lighting :research] +[2:03:13][Spec out specular :sampling in ComputeVoxelIrradianceAt()][:lighting] +[2:05:24][Glimpse the (broken) specular :lighting][:run :sampling] +[2:05:32][Defer figuring out diffuse :sampling of the octahedral map][:lighting :speech] +[2:06:24][Q&A][:speech] +[2:07:50][@xxthebigfoxx][Q: Is the diffuse component going to be computed on the CPU or the GPU then?][:lighting :sampling] +[2:08:33][@relvet][Q: Since :hardware standards move quickly, have you considered doing a pass on the codebase to move to newer versions of OpenGL and SSE? The optimization implications alone should be worth it, or?] +[2:09:56][@cerdus][What is the current OpenGL version?] +[2:10:38][@philliptrudeau][Q: Did the paper[ref + title="Dynamic Diffuse Global Illumination with Ray-Traced Irradiance Fields" + author="Jean-Philippe Guertin, Derek Nowrouzezahrai, Morgan McGuire" + url=http://jcgt.org/published/0008/02/01/] say that they compute a separate cosine-weighted radiance for every probe? Where do they store that information?] +[2:12:10][@erdomina][Q: Any pointers on reading research papers effectively?] +[2:12:35][@philliptrudeau][Is this a "research paper"?] +[2:13:25][@philliptrudeau][Journal of Fluffy Opinion Papers] +[2:13:58][Wrap it up][:speech] +[/video]