[video output=day564 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Improving Trilinear Sampling Results" vod_platform=youtube id=kv2LxJNcQfs annotator=Miblo]
[0:02][Recap and set the stage for the day debugging our :lighting pipeline][:speech]
[2:57][Demo our mostly unlit world][:lighting :run]
[5:00][Scrutinise EndLightingComputation() for bugs][:lighting :research]
[6:32][Expand the radius of our light falloff in EndLightingComputation()][:lighting]
[6:54][See some visible :lighting, with "watery" artifacts as we apparently get full brightness in voxels lacking a light probe][:run]
[8:40][Increase the light intensity from 0.025 to 0.1 of the max][:lighting]
[9:45][See fuller light in the center region][:lighting :run]
[10:39][Fix EndLightingComputation() to omit the zero light probe from our spatial index][:lighting]
[13:55][See that our :lighting brightness artifact is fixed, but that the :sampling needs improving][:run]
[17:03][Visualise the location of light probes within their voxels, using our checkerboard pattern and disabling the trilinear filtering][:"debug visualisation" :lighting]
[19:57][Check the location of our light probes][:"debug visualisation" :lighting :run]
[20:48][Make EndLightingComputation() override all the lights with our checkerboard][:"debug visualisation" :lighting]
[21:40][Check the location of our light probes in the voxels][:"debug visualisation" :lighting :run]
[22:32][Disable the checkerboard in EndLightingComputation()][:"debug visualisation" :lighting]
[22:56][See that our non-trilinear sampled :lighting looks more or less correct, and consider factoring in the light probe position to our lighting equation][:run]
[26:13][Begin to make CompileZBiasProgram() factor in the light probe position to our :lighting equation]
[29:59][Consider how we could adjust the light based on its position][:lighting :speech]
[32:37][Consider a cleaner way to interpolate between light probe voxels, using a signed distance field][:lighting :speech]
[37:14][Revert our light position code, and re-enable trilinear filtering][:lighting]
[38:29][Take a close look at our light falloff artifacts][:lighting :run]
[40:22][Rounded Falloff][:blackboard :lighting]
[44:35][Distance-based Falloff][:blackboard :lighting]
[48:01][Try to encode our :lighting alpha and intensity as a signed distance field, before reverting]
[56:36][Make sure that it still runs][:lighting :run]
[56:39][Make EndLightingComputation() stuff :lighting values directly into the voxels]
[59:20][See our test light sphere][:lighting :run]
[59:36][Encode our light values as a signed distance field in EndLightingComputation()][:lighting]
[1:03:55][Find that our trilinear interpolation is more round than it was][:lighting :run]
[1:05:49][Prevent EndLightingComputation() from normalising the incoming light, and only apply the West light][:lighting]
[1:08:19][Check out the high quality of our :lighting falloff][:run]
[1:09:37][Reinstate all our light directions in EndLightingComputation()][:lighting]
[1:11:56][See light beyond our falloff boundary, and that the roundedness has gone again][:lighting :run]
[1:13:54][Consider if we can put our sampled :lighting into a signed distance field construction at voxelisation time][:speech]
[1:18:10][Walk through our :lighting equation in EndLightingComputation(), noting the problematic interaction of multiple normalisations with a signed distance field][:research]
[1:22:59][Prevent EndLightingComputation() from factoring in the light direction normals][:lighting]
[1:23:18][See our non-round falloff interpolation artifact][:lighting :run]
[1:23:48][Reduce the light intensity in EndLightingComputation()][:lighting]
[1:24:37][Still see our falloff interpolation artifact][:lighting :run]
[1:24:41][Make EndLightingComputation() only apply the West light][:lighting]
[1:25:31][See that our falloff interpolation artifact has gone][:lighting :run]
[1:26:12][Make EndLightingComputation() also apply the South light][:lighting]
[1:27:19][See that our falloff still looks fine][:lighting :run]
[1:27:31][Make EndLightingComputation() also apply the Down light][:lighting]
[1:28:01][Start to see falloff interpolation artifact return][:lighting :run]
[1:28:48][Make EndLightingComputation() only apply the West light][:lighting]
[1:29:37][See our smooth falloff][:lighting :run]
[1:29:44][Make EndLightingComputation() clamp the light values from 0 to 1][:lighting]
[1:30:01][See falloff interpolation artifacts][:lighting :run]
[1:30:40][Reinstate the signed distance field in EndLightingComputation()][:lighting]
[1:30:46][Consider the box-directionality of our light probes to be the problem][:lighting :run]
[1:36:35][Prevent EndLightingComputation() from applying the light from all directions][:lighting]
[1:37:31][See some light][:lighting :run]
[1:37:36][Try making EndLightingComputation() set all light directions to -1][:lighting]
[1:39:00][See black, as expected][:lighting :run]
[1:39:12][Consider correctly handling zero light (in a signed distance field)][:lighting :speech]
[1:42:38][Force CompileZBiasProgram() to falloff the light to zero, and let EndLightingComputation() apply the West light][:lighting]
[1:43:05][See our smooth radial falloff, to black][:lighting :run]
[1:45:02][Determine to factor in the light direction to our :lighting equation][:speech]
[1:46:09][Make CompileZBiasProgram() factor in the light direction to our :lighting equation]
[1:51:06][See that our light reflections look correct][:lighting :run]
[1:52:12][Make CompileZBiasProgram() reconstruct light directions more precisely][:lighting]
[1:52:57][Admire our light reconstruction][:lighting :run]
[1:54:12][Q&A][:speech]
[1:55:15][@ankut][Q: Are you ever going to upgrade the stream ~4coder to the latest one you and [@mr4thdimention Allen] were working on?]
[1:56:12][For us latecomers, what helped smooth the voxel-like outline of the :lighting?][:authored]
[2:03:21][Demo our smooth radial falloff][:lighting :run]
[2:03:49][Make EndLightingComputation() encode the light as 0 to 1 values][:lighting]
[2:04:20][Watch the falloff interpolation artifact return][:lighting :run]
[2:04:54][Reinstate the signed distance field in EndLightingComputation()][:lighting]
[2:05:04][Watch the falloff interpolation smooth][:lighting :run]
[2:05:14][Plug Chris Green's article 'Improved Alpha-Tested Magnification for Vector Textures and Special Effects'[ref
    author="Chris Green"
    title="Improved Alpha-Tested Magnification for Vector Textures and Special Effects"
    publisher="Valve"
    url=https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf]][:research]
[2:07:18][Consider encoding our light from -0.2 to 1][:lighting]
[2:08:54][@Spiney][Q: What's the reason you want to keep with the light probes approach instead of using light entities?][:lighting]
[2:10:21][@Spiney][Q: Light source][:lighting]
[2:13:12][@centhusiast][Q: Could you explain about the real time fluid simulations for games. For example, how to simulate swirling smoke in the game? Have you read the paper by Jos Stam on the real time fluid solver for games? It is really interesting in my opinion. Thanks[ref
    author="Jos Stam"
    title="Stable Fluids"
    publisher="Alias | wavefront"
    url=http://movement.stanford.edu/courses/cs448-01-spring/papers/stam.pdf]]
[2:14:38][@centhusiast][Q: This paper[ref
    author="Jos Stam"
    title="Real-Time Fluid Dynamics for Games"
    publisher="Alias | wavefront"
    url=https://pdfs.semanticscholar.org/847f/819a4ea14bd789aca8bc88e85e906cfc657c.pdf]]
[2:20:46][Backwards Integration][:blackboard :simulation]
[2:33:28][Shut it down][:speech]
[/video]
