[video output=day650 member=cmuratori stream_platform=twitch stream_username=handmade_hero  project=code title="Debugging Light Sampling Locations" vod_platform=youtube id=_CCjCvS88QM annotator=Miblo]
[0:02][Recap and set the stage for the day debugging our light contamination bug][:lighting :run]
[2:16][Describe ValidateTexelComponent()][:lighting :research]
[3:12][Make ValidateTexelComponent() consider a component greater than or equal to 0 to be valid, enabling LIGHT_ATLAS_ASSERT][:lighting]
[3:28][:Run without producing an invalid texel component][:lighting]
[4:06][Make ValidateTexelComponent() consider a component of between 0 and 100 to be valid][:lighting]
[4:21][:Run without producing an invalid texel component][:lighting]
[4:58][Force ValidateTexelComponent() to consider all components to be invalid][:lighting]
[5:05][Trap on SetLightAtlasTexels(), proving that ValidateTexelComponent() is being called][:lighting :run]
[5:17][Revert ValidateTexelComponent() to validate normally][:lighting]
[5:22][Traverse the orphanage and never produce an invalid texel component][:lighting :run]
[6:04][Restrict ValidateTexelComponent() to consider a component of between 0 and 10 to be valid][:lighting]
[6:15][:Run without producing an invalid texel component][:lighting]
[6:24][Restrict ValidateTexelComponent() to consider a component of between 0 and 1 to be valid][:lighting]
[6:42][Trap on PushLight() in an -O2 build][:lighting :run]
[6:53][Trap on VALIDATE_TEXEL() within PushLight() in an -Od build][:lighting :run]
[7:25][Expand ValidateTexelComponent() to consider a component of between 0 and 5 to be valid][:lighting]
[7:43][Trap on VALIDATE_TEXEL() within PushLight(), and inspect the Emission][:lighting :run]
[8:12][Reacquaint ourselves with StandardLightingPattern() and AddPieceLight()][:lighting :research]
[10:11][Restrict ValidateTexelComponent() to consider a component of between 0 and 1.1 to be valid][:lighting]
[10:25][Trap on VALIDATE_TEXEL() within PushLight()][:lighting :run]
[10:34][Make StandardLightingPattern() reduce the Emission value passed to AddPieceLight() from 10 to 1][:lighting]
[10:45][:Run without trapping][:lighting]
[10:57][:Run an -O2 build without trapping for a while, before trapping on PushLight() in UpdateAndRenderEntities()][:lighting]
[12:26][Revert StandardLightingPattern() to pass an Emission value of 10 to AddPieceLight()][:lighting]
[12:38][Trap on VALIDATE_TEXEL() within PushLight()][:lighting :run]
[12:48][Expand ValidateTexelComponent() to consider a component of between 0 and 10 to be valid][:lighting]
[12:54][Consider the possibility of this being an artifact of the way our system convects light][:lighting :run]
[13:44][Questions of our :lighting system: 1. Why do our lights have falloff? It's the inverse-square law, as an artifact of :sampling][:lighting :run]
[15:19][Questions of our :lighting system: 2. Why do we have over-brighting?][:lighting :run]
[16:04][Let GridRayCast() walk the grid all the way to the SPATIAL_GRID_NODE_TERMINATOR][:lighting]
[17:10][We still get over-brighting][:lighting :run]
[17:38][Make GridRayCast() walk the grid only eight steps, and zero out the HitRefColor if it gets that far][:lighting]
[18:24][We no longer get over-brighting indoors, but we do in some exteriors][:lighting :run]
[20:24][Make DebugDrawSpatialGrid() draw the occluders, and toggle on the call to it in UpdateLighting()][:"debug visualisation" :lighting]
[20:56][Over-brighting outdoors is affected by the player's position][:lighting :run]
[27:25][Toggle on DebugDrawOctahedralValues() and off DebugDrawSpatialGrid() in UpdateLighting()][:"debug visualisation" :lighting]
[28:04][The interior lighting gets tinted green when the lighting bounds do not encompass the exterior wall][:lighting :run]
[29:59][Make StandardLightingPattern() colour the lights a non-random pure grey][:lighting]
[30:23][The interior lighting no longer gets tinted green][:lighting :run]
[31:13][We no longer get over-brighting outdoors][:lighting :run]
[32:15][Make StandardLightingPattern() colour the lights a more powerful grey][:lighting]
[32:29][We do get our over-brighting bug again][:lighting :run]
[33:11][Remove cruft from GridRayCast()][:lighting]
[34:55][Investigate why the light only leaks on the quarters][:lighting :research]
[36:47][Begin to illustrate our leaking case][:lighting :run]
[37:20][Plug the Qualcomm Keynote from CES 2013[ref
    author=CES
    title="2013 CES: Dr. Paul E. Jacobs, Qualcomm Inc. Keynote"
    publisher=YouTube
    url=https://youtu.be/Vn8qxSUbOko?t=430]][:research]
[42:23][Light leaking clues: 1. Exterior light probes beyond the wall unexpectedly pick up light][:lighting :run]
[45:18][Light leaking clues: 2. Enclosed light probes can suddenly pick up light][:lighting :run]
[46:20][Plan our light leak investigations][:lighting :run]
[51:21][@felkcraft][I don't know how that code works, but I see an x value be used for y variable called somethingY][:lighting]
[53:06][Reorient SteppingDeltaX as a negative offset in GridRayCast()][:lighting]
[54:49][@justslavic][Shouldn't there be a minus sign somewhere then?]
[55:16][Take a close look at our enclosed light probes suddenly picking up light][:lighting :run]
[58:31][Find the Owl][:admin]
[59:12][:Owl of Shame Parade]
[1:01:04][Light leaks below the world][:lighting :run]
[1:03:29][Reacquaint ourselves with GenerateApron()][:"procedural generation" :research]
[1:05:35][@tk_dev][Somewhere else Microsoft is receiving packages full of owls, but they don't know what they're for]
[1:05:43][Recommend Microsoft to build a giant Owl of Shame on their new campus[ref
    site="Microsoft Stories"
    page="New Redmond campus plan unveiled"
    url=https://news.microsoft.com/announcement/new-redmond-campus-plan-unveiled/]][:research]
[1:06:32][@dedknd][They have the same bug]
[1:06:44][Recommend Microsoft to put the Owl of Shame on a rotating base[ref
    site="Microsoft Stories"
    page="New Redmond campus plan unveiled"
    url=https://news.microsoft.com/announcement/new-redmond-campus-plan-unveiled/]][:research]
[1:07:45][Consider whether to enclose the world with floors or clamp the light ray cast's movement in Z][:lighting :research]
[1:11:27][Why not clamp the light ray cast's movement in Z][:lighting :run]
[1:12:48][Start to make GenerateApron() always generate ground cover][:"procedural generation"]
[1:15:20][Note the uneven ground outside generated rooms][:"procedural generation" :run]
[1:15:45][Make GenerateApron() reduce the vertical placement of overlapping entities by 1][:"procedural generation"]
[1:16:21][Light no longer leaks below the world][:lighting :"procedural generation" :run]
[1:17:26][Make GenerateApron() also reduce the vertical placement of overlapping entities besides trees][:"procedural generation"]
[1:17:50][The ground cover's vertical placement appears to be low][:"procedural generation" :run]
[1:17:58][Make GenerateApron() further decrease the vertical placement from 1 to 5][:"procedural generation"]
[1:18:09][The apron seems the same][:"procedural generation" :run]
[1:18:19][Make GenerateApron() further decrease the vertical placement from 5 to 10][:"procedural generation"]
[1:18:55][Nothing sticks out the bottom][:"procedural generation" :run]
[1:19:22][Put the P.z offsetting on its own line in GenerateApron() and build in -Od][:"procedural generation"]
[1:19:39][Break in to GenerateApron() and inspect its values][:"procedural generation" :run]
[1:23:03][Move the P.z offsetting below the Vol initialisation line in GenerateApron()][:"procedural generation"]
[1:23:31][Build in -O2]
[1:23:49][@fayyden][Is everything overlapped?]
[1:23:57][Overlapped entities now below the spatial partition][:"procedural generation" :run]
[1:24:13][Make GenerateApron() decrease the vertical placement less from 10 to 2][:"procedural generation"]
[1:24:24][Overlapped entities are back][:"procedural generation" :run]
[1:24:46][Overflow our entity count in EnsureRegionIsUnpacked()][:"entity system" :run]
[1:25:13][Temporarily increase MAX_SIM_REGION_ENTITY_COUNT from 2*8192 to 4*8192][:"entity system"]
[1:26:29][We report non-overlapped entities as overlapped][:"procedural generation" :run]
[1:27:04][Revert MAX_SIM_REGION_ENTITY_COUNT to 2*8192, and remove the overlapped entity offsetting in GenerateApron()][:"entity system" :"procedural generation"]
[1:27:23][Scour OverlappingEntitiesExist() and GenerateApron() for bugs][:"procedural generation" :research]
[1:29:07][Toggle on collision volume drawing in UpdateAndRenderEntities()][:"debug visualisation" :"entity system"]
[1:29:40][Our room boundaries are wrong][:"debug visualisation" :"entity system" :"procedural generation" :run]
[1:30:24][Make GenRoomVolume() offset the dimensions down by half][:"entity system" :"procedural generation"]
[1:31:58][Our room boundaries remain wrong][:"debug visualisation" :"entity system" :"procedural generation" :run]
[1:32:39][Fix GenRoomVolume() to offset the dimensions down by half a TileDim][:"entity system" :"procedural generation"]
[1:33:33][Our rooms are now correctly aligned][:"debug visualisation" :"entity system" :"procedural generation" :run]
[1:33:56][Our light still leaks][:lighting :"procedural generation" :run]
[1:35:12][Reacquaint ourselves with the occluder generation code][:"entity system" :"procedural generation" :research]
[1:39:56][Provoke the position-dependent interior light leak bug][:lighting :run]
[1:40:20][Make GenerateApron() call AddPieceOccluder() to generate a ceiling for each tile][:"entity system" :"procedural generation"]
[1:44:46][Traverse the orphanage][:"entity system" :"procedural generation" :run]
[1:45:04][Toggle off collision volume drawing in UpdateAndRenderEntities()][:"debug visualisation" :"entity system"]
[1:45:17][Successfully provoke the position-dependent interior light leak bug][:lighting :run]
[1:45:37][Toggle on DebugDrawSpatialGrid() and off DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[1:46:16][With floors and ceilings, our enclosed light probes correctly no longer pick up light][:lighting :run]
[1:51:38][Make GenerateRoom() generate a ceiling light indoors][:"entity system" :"procedural generation"]
[1:52:57][Provoke the position-dependent interior light leak bug][:lighting :run]
[1:54:53][Disable StandardLightingPattern()][:lighting :"procedural generation"]
[1:55:51][The exterior area gets light from its ceiling tiles, but the interior does not][:lighting :"procedural generation" :run]
[1:56:42][Fix GenerateRoom() to generate the ceiling light outdoors, and the ceiling occluder indoors][:"entity system" :"procedural generation"]
[1:57:40][The interior now gets light][:lighting :"procedural generation" :run]
[1:59:15][Re-enable overhead light placement StandardLightingPattern()][:lighting :"procedural generation"]
[1:59:46][Briefly :run the game]
[1:59:51][Toggle off DebugDrawSpatialGrid() in UpdateLighting()][:"debug visualisation" :lighting]
[2:00:06][Admire the lighting where it isn't buggy][:lighting :run]
[2:02:41][@alphalionmale][What graphics engine are you using?]
[2:03:02][The apron is not sealed][:lighting :"procedural generation" :run]
[2:03:46][@teamrandb][You could blame younger you]
[2:04:33][Wonder if the unsealed apron affects our light bleed bug][:lighting :"procedural generation" :run]
[2:05:10][@alphalionmale][Are trees 2D?]
[2:06:31][Ponder our position-dependent light feedback bug][:lighting :run]
[2:07:35][@salaryboi][New here, do you plan on making a full game to play or just focusing on the engine?]
[2:08:11][Plug [@naysayer88 Jonathan Blow]'s stream[ref
    site=Twitch
    page=j_blow
    url=https://twitch.tv/j_blow]]
[2:08:33][Provoke our position-dependent light bleed bug outdoors][:lighting :run]
[2:09:10][@salaryboi][It could be educational to watch someone learn :"game design"]
[2:09:31][Z cannot be implicated in the position-dependent light bleed bug indoors][:lighting :run]
[2:12:01][@dieteetasse][Can the ray escape through the door into nothingness?][:lighting]
[2:13:43][@ablindorphan][Is there any way to prevent the wrapping, so it can't sample from the wrapped region?][:lighting :sampling]
[2:14:23][@felkcraft][I don't understand how bypassing some light barriers would lead to the kind of positive feedback loop we're seeing in some places][:lighting]
[2:14:35][The enclosed light bug is back][:lighting :run]
[2:14:57][The inverse-square law applies when hitting a light, but not when :sampling indirect light. Is that wrong?][:lighting :run]
[2:16:16][Make GridRayCast() zero out the HitEmission upon walking the distance][:lighting]
[2:16:48][Walls are oddly lit on every other shift of the lighting voxel][:lighting :run]
[2:17:58][@ablindorphan][Does this happen with pure white / pure red lights?][:lighting]
[2:18:12][Make StandardLightingPattern() colour the interior light pure \[5, 5, 5\] white][:lighting :"procedural generation"]
[2:18:21][The position-dependent interior light leak bug is gone][:lighting :run]
[2:18:41][Make StandardLightingPattern() colour the interior light a brighter \[7, 7, 7\] white][:lighting :"procedural generation"]
[2:18:58][The position-dependent interior light leak bug is back][:lighting :run]
[2:19:07][Make StandardLightingPattern() colour the interior light a dimmer \[6, 6, 6\] white][:lighting :"procedural generation"]
[2:19:21][The position-dependent interior light leak bug remains][:lighting :run]
[2:19:45][Make StandardLightingPattern() colour the interior light a dimmer \[5, 5, 5\] white][:lighting :"procedural generation"]
[2:19:58][The position-dependent interior light leak bug is gone][:lighting :run]
[2:21:26][Consider the value sensitivity of our position-dependent light leak bug][:lighting :run]
[2:22:19][@spotnag][Why is the light bottom-left in that room brighter than the others?][:lighting]
[2:23:39][Inspect the ray casting on the brighter bottom-left tile][:"debug visualisation" :lighting :run]
[2:26:21][@felkcraft][The light source box looks bigger than one tile, like it's 1.0 and not "tile sized"]
[2:26:52][Toggle on drawing of the lights in UpdateAndRenderEntities()][:"debug visualisation" :lighting]
[2:27:07][Check out our lights][:"debug visualisation" :lighting :run]
[2:27:26][Make UpdateAndRenderEntities() draw the lights at their correct size][:"debug visualisation" :lighting]
[2:29:08][Check out our lights][:"debug visualisation" :lighting :run]
[2:30:00][@spacenaming][There was a TODO in CalcBasePForOffset that said it still needed to be implemented]
[2:30:10][@spotnag][The brighter one is closer to other lights that are behind walls. Could it be that the walls are not stopping it picking up light? So it has itself plus the other two next to it the other side of the walls?][:lighting]
[2:31:31][CalcBasePForOffset() doesn't matter][:"entity system" :"procedural generation" :research]
[2:32:11][We have position-dependent brightening in the non-traversable outdoors][:lighting :run]
[2:36:03][Scour GridRayCast() for the ramifications of hitting tTerminate and zeroing HitRefColor][:lighting :research]
[2:38:54][Check out the rays cast in the brighter non-traversable outdoors][:lighting :run]
[2:39:23][Toggle on DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[2:39:42][The light apparently comes through the wall][:lighting :run]
[2:41:20][Scour GridRayCast() for bugs in getting the light atlas][:lighting :research]
[2:44:22][Reproduce our position-dependent brightening][:lighting :run]
[2:44:53][Rename Grid to AtlasGrid in GridRayCast()[ref
    author=CES
    title="2013 CES: Dr. Paul E. Jacobs, Qualcomm Inc. Keynote"
    publisher=YouTube
    url=https://youtu.be/Vn8qxSUbOko?t=430]][:lighting]
[2:48:05][Check our region alignments][:"debug visualisation" :lighting :run]
[2:48:51][PushLightingRenderValues() draws the HotVoxelRect in cyan and the SpatialGrid in green][:"debug visualisation" :lighting :research]
[2:50:10][Our light :sampling reads and writes are misaligned][:lighting :run]
[2:51:57][Vote for a quick break][:admin]
[2:52:52][:afk]
[2:56:43][Return][:admin]
[2:57:08][@thesandvichmaker][No! Brain-parasite music!]
[2:57:17][Fanfare][:admin]
[2:57:58][@tk_dev][Maybe you should let Cody handle the second part of the stream, then you don't need a break]
[2:58:45][@dedknd][@niftywifty *Will Smith approaching...*]
[3:01:53][@thesandvichmaker][Will the [~hero Handmade Hero] awards have exciting moments? Maybe you can invite and then slap a Microsoft employee]
[3:02:51][Investigate our :sampling read–write misalignment][:lighting :research]
[3:04:38][@ryanfleury][Keep! My struct's name! Out your fuckin' mouth!!!]
[3:04:58][The GetCellCenterP() call in ComputeLightPropagationWork() is horse poop][:lighting :research]
[3:05:17][We're eating Peanut Butter Pretzels from Costco][:admin]
[3:06:15][@ablindorphan][Would you like me to talk to Mr Costco for you?]
[3:06:28][Change ComputeLightPropagationWork() to set BoxCenterP using GetCellBounds().Min][:lighting]
[3:08:30][The octahedral value drawings are now positioned wrong][:"debug visualisation" :lighting :run]
[3:08:54][Rename BoxCenterP to CastFromP in ComputeLightPropagationWork()][:lighting]
[3:09:40][Fix DebugDrawOctahedralValues() to position the drawings at the Bounds.Min][:"debug visualisation" :lighting]
[3:10:49][We have light probes unable to pick up light around the perimeter][:"debug visualisation" :lighting :run]
[3:12:00][Our light leaking is now more pronounced][:"debug visualisation" :lighting :run]
[3:13:43][Reacquaint ourselves with the atlas grid and spatial grid creation code in UpdateLighting() and MakeLightAtlas()][:lighting :research]
[3:17:44][Make UpdateLighting() shrink the atlas grid by one in all dimensions][:lighting]
[3:18:40][Our light probes now fill the atlas grid][:lighting :run]
[3:20:18][Make UpdateLighting() position the light atlas at half a VoxCellDim in Z][:lighting]
[3:21:11][The light atlas is too high][:lighting :run]
[3:21:42][Stop UpdateLighting() from repositioning the light atlas in Z][:lighting]
[3:21:52][The light atlas is a little too low][:lighting :run]
[3:22:13][Make UpdateLighting() offset the light atlas upwards in Z by half a VoxCellDim][:lighting]
[3:22:23][The light atlas is better positioned and aligned][:lighting :run]
[3:23:30][Reacquaint ourselves with the light sample read–write alignment in PushLightingRenderValues() and SampleLighting()][:lighting :research :sampling]
[3:27:58][Prevent SumLight() from offsetting VoxR by -0.5 in all dimensions, and make SampleLighting() clamp our lookups within the lighting voxel][:lighting :sampling]
[3:30:34][Our floors are now lit][:lighting :run]
[3:32:03][Scour GridRayCast() for :sampling bugs][:lighting :research]
[3:36:07][Our debug ray picking is now broken][:"debug system" :lighting :run]
[3:37:03][Fix FullCast() to clamp the ray picker's atlas index to the full cell count][:"debug system" :lighting]
[3:37:35][Our debug ray picking remains broken][:"debug system" :lighting :run]
[3:38:16][Temporarily prevent FullCast() from clamping the ray picker's atlas index][:"debug system" :lighting]
[3:38:28][Our debug ray picking remains broken][:"debug system" :lighting :run]
[3:38:45][Let FullCast() clamp the ray picker's atlas index][:"debug system" :lighting]
[3:38:53][Investigate our ray picking bug][:"debug system" :lighting :research]
[3:39:24][Make UpdateLighting() compute an offset AtlasGridCellCount to prevent the light map from being reset every frame][:lighting]
[3:40:29][Our debug ray picking works again][:"debug system" :lighting :run]
[3:41:04][Inspect our rays to determine that they are offset][:"debug visualisation" :lighting :run]
[3:43:32][Scour FullCast() for alignment bugs][:lighting :research]
[3:46:47][Make FullCast() map the light probes into the spatial grid, using GetIndexForP()][:lighting]
[3:48:03][Briefly :run the game][:lighting]
[3:48:13][Remove AtlasToSpatialGridIndexOffset from lighting_solution][:"data structure" :lighting]
[3:49:06][We still have casting bugs][:lighting :run]
[3:49:43][@said6289][Why is there no timer?]
[3:50:02][Start the timer][:admin]
[3:50:20][Glance at UpdateLighting() for bugs][:lighting :research]
[3:51:05][Consider the lighting bounds placement to be correct][:lighting :run]
[3:51:57][Scour UpdateLighting() and FullCast() for bugs][:lighting :research]
[3:54:01][Rename the VoxCenterP argument to LightProbeP in FullCast()][:lighting]
[3:54:17][Scour GridRayCast() for bugs][:lighting :research]
[3:55:33][Delete CellDim4 and related code in GridRayCast()][:lighting]
[3:56:38][Scour GridRayCast() for bugs (cont.)][:lighting :research]
[3:57:57][Toggle off DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[3:58:11][The spatial partition and lighting voxel are oddly aligned][:lighting :run]
[3:59:18][Make UpdateLighting() offset the spatial grid by half a VoxCellDim in x and y][:lighting]
[4:00:08][Inspect our rays to determine that they seem pretty good][:"debug visualisation" :lighting :run]
[4:01:44][Our lighting is more stable, but the lighting voxel slides relative to the spatial grid][:"debug visualisation" :lighting :run]
[4:02:36][Investigate our lighting voxel sliding bug][:lighting :research]
[4:09:29][Make UpdateLighting() set the HotDim to the AtlasGrid's dimensions][:lighting]
[4:11:03][Our lighting now flickers, and has black spots][:lighting :run]
[4:11:55][Revert the HotDim initialisation in UpdateLighting()][:lighting]
[4:12:10][The flicker and black spots have gone][:lighting :run]
[4:12:44][Toggle on DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[4:13:22][The octahedrons don't shift, only their values alter][:lighting :run]
[4:14:47][Toggle on DebugDrawSpatialGrid() and off DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[4:14:55][The spatial grid looks pretty solid[ref
    author=CES
    title="2013 CES: Dr. Paul E. Jacobs, Qualcomm Inc. Keynote"
    publisher=YouTube
    url=https://youtu.be/Vn8qxSUbOko?t=430]][:"debug visualisation" :lighting :run]
[4:15:37][Toggle on DebugDrawOctahedralValues() and off DebugDrawSpatialGrid() in UpdateLighting()][:"debug visualisation" :lighting]
[4:15:49][Eyeball the light probes and realise that our scale is wrong][:"debug visualisation" :lighting :run]
[4:16:17][Reacquaint ourselves with the scaling in PushLightingRenderValues() and SumLight()][:lighting :research]
[4:21:07][Make SumLight() contract the LIGHT_LOOKUP_VOXEL_DIM by 1 in all dimensions when setting VoxR][:lighting]
[4:21:34][Our scaling now seems right][:"debug visualisation" :lighting :run]
[4:21:54][Toggle off drawing of the lights in UpdateAndRenderEntities() and DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[4:22:24][The light seems pretty stable][:lighting :run]
[4:23:56][Consider aligning the lighting region such that the camera remains well within it][:lighting :research]
[4:24:43][The lighting region is biased][:lighting :run]
[4:25:28][Increase the LIGHT_LOOKUP_VOXEL_DIM_X from 24 to 28, and LIGHT_LOOKUP_VOXEL_DIM_Y from 16 to 20][:lighting]
[4:25:52][The lighting region remains biased][:lighting :run]
[4:26:38][Toggle off the camera bounds drawing in UpdateAndRenderWorld()][:camera :"debug visualisation"]
[4:27:32][Traverse the orphanage as if playing the game][:run]
[4:28:39][Decrease tUpdateBlend from 1 to 15/60 in UpdateLighting()][:lighting]
[4:29:18][Traverse the orphanage][:run]
[4:29:27][Move the ray debug drawing out of the way in UpdateLighting()][:"debug visualisation" :lighting]
[4:29:47][Traverse the orphanage as if playing the game, and admire the :lighting][:run]
[4:30:24][Toggle off LIGHT_ATLAS_ASSERT and GRID_RAY_CAST_DEBUGGING][:lighting]
[4:31:05][\~41ms per frame][:lighting :performance :run]
[4:32:08][Toggle off HANDMADE_INTERNAL and HANDMADE_SLOW, and stub out DIAGRAM_SetOrigin() and RenderDiagrams()][:"debug visualisation"]
[4:34:13][Feel the :performance][:lighting :run]
[4:34:29][Delete WalkTableOffset from light_sample_directions][:"data structure" :lighting :metaprogramming]
[4:35:30][Run hhsphere with an octahedron texel count and ray per texel of 8][:admin :lighting]
[4:36:33][Feel the :performance with 8 rays per texel][:lighting :run]
[4:36:49][Toggle on HANDMADE_INTERNAL and stub out world and world_position][:"data structure"]
[4:37:56][\~23ms per frame][:lighting :performance :run]
[4:38:18][Toggle on HANDMADE_SLOW]
[4:38:27][\~26ms per frame][:lighting :performance :run]
[4:38:47][Determine to toggle off the diffuse blend][:lighting :research]
[4:39:21][\~29ms per frame][:lighting :performance :run]
[4:39:27][Toggle off the diffuse blend in ComputeLightPropagationWork()][:lighting]
[4:39:32][\~29ms per frame][:lighting :performance :run]
[4:39:54][Toggle on the diffuse blend in ComputeLightPropagationWork()][:lighting]
[4:40:03][\~29ms per frame][:lighting :performance :run]
[4:40:13][Toggle off FullCast() in ComputeLightPropagationWork()][:lighting]
[4:40:21][\~16ms per frame][:lighting :performance :run]
[4:40:42][Toggle on FullCast() in ComputeLightPropagationWork()][:lighting]
[4:40:52][Admire our excellent interior :lighting][:run]
[4:41:59][Consider specially handling light probes embedded in geometry][:lighting :run]
[4:43:32][Toggle on the player's light in UpdateAndRenderWorld()][:lighting]
[4:44:50][Lights produce a glow when eclipsing a light probe][:lighting :run]
[4:45:19][Toggle on DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[4:45:29][Our player's light occludes the light probes, removing light from the system][:lighting :run]
[4:45:49][Darken the player's light from 10 to 5, and increase its size in Z from 0.5 to 1][:lighting]
[4:46:13][Check out the player's light][:lighting :run]
[4:46:26][Revert the player's light size, and elevate it from 2 to 2.5][:lighting]
[4:46:42][The player's light still occludes the light probe][:lighting :run]
[4:46:44][Elevate the player's light from 2.5 to 3][:lighting]
[4:46:50][The player's light no longer occludes the light probe][:lighting :run]
[4:46:57][Toggle off DebugDrawOctahedralValues() in UpdateLighting()][:"debug visualisation" :lighting]
[4:47:06][Traverse the orphanage admiring the light][:lighting :run]
[4:47:17][Brighten the player's light from 5 to 8][:lighting]
[4:47:24][Traverse the orphanage admiring the light][:lighting :run]
[4:47:56][Toggle off StandardLightingPattern()][:lighting :"procedural generation"]
[4:48:26][Illustrate the checkerboard patterning from the :sampling sphere][:lighting :run]
[4:49:42][Prevent GridRayCast() from zeroing out HitRefColor and HitEmission upon walking the distance][:lighting]
[4:50:34][See no difference in the :lighting, but admire it nevertheless][:performance :run]
[4:51:41][Switch GridRayCast() from the sample table lookup to :sampling in a white noise pattern][:lighting]
[4:55:28][The light flickers with this white noise :sampling][:lighting :run]
[4:56:01][Make GridRayCast() cast 32 rays][:lighting :sampling]
[4:56:19][The light goes over-bright][:lighting :run :sampling]
[4:56:25][Make GridRayCast() cast 32 rays correctly weighted][:lighting :sampling]
[4:57:22][The light flickers less with 32 rays][:lighting :run :sampling]
[4:58:17][Decrease the RayCount from 32 to 16 in GridRayCast()][:lighting :sampling]
[4:58:26][The light flickers more with 16 rays][:lighting :run :sampling]
[4:58:30][Increase the RayCount from 16 to 64 in GridRayCast()][:lighting :sampling]
[4:58:39][The light barely flickers with 64 rays][:lighting :run :sampling]
[4:59:02][Decrease the RayCount from 64 to 8 in GridRayCast(), and decrease tUpdateBlend from 15/60 to 6/60 in UpdateLighting()][:lighting :sampling]
[4:59:31][The light looks pretty good][:lighting :run :sampling]
[5:00:26][Toggle on the room lights in StandardLightingPattern()][:lighting :"procedural generation"]
[5:00:43][We barely notice flicker, and can get over-brighting indoors with many lights][:lighting :run]
[5:03:01][Toggle off the player's light in UpdateAndRenderWorld()][:lighting]
[5:03:12][@ponkkiz][I think the darker one looked awesome][:lighting]
[5:03:23][The interior does not over-brighten without the player light][:lighting :run]
[5:03:35][Toggle off AddPattern() on the MainRoom in CreateOrphanage()][:lighting :"procedural generation"]
[5:04:04][Traverse the orphanage to the unlit main room][:lighting :run]
[5:04:23][Make MoveEntity() move the entity and then leave][:"entity system"]
[5:05:43][Hit our DiagramDepth == 0 assertion in RenderDiagrams()][:"debug system" :run]
[5:05:55][Make MoveEntity() call DIAGRAM_End() after moving the entity][:"debug system" :"entity system"]
[5:06:38][Make MoveEntity() return after moving the entity :"entity system"]
[5:06:49][Our glove now moves with us][:"entity system" :run]
[5:07:10][Make AddPlayer() call AddPieceLight() on the Glove][:"entity system" :lighting]
[5:09:09][Our light convects too much][:lighting :run]
[5:09:16][Make GridRayCast() zero out HitRefColor and HitEmission upon walking the distance][:lighting]
[5:09:53][Our light still convects too much][:lighting :run]
[5:09:59][Prevent GridRayCast() from zeroing out HitRefColor and HitEmission upon walking the distance][:lighting]
[5:10:25][Darken the glove's light from 5 to 1 in AddPlayer()][:"entity system" :lighting]
[5:10:26][Take our dim green glove light into the main room][:lighting :run]
[5:10:47][Brighten the glove's light from 1 to 3 in AddPlayer()][:"entity system" :lighting]
[5:10:57][Our light feeds back when we stand still][:lighting :run]
[5:12:45][Prevent FullCast() from blacking out light probes inside geometry][:lighting]
[5:13:32][Our light no longer blacks out when a light probe is inside geometry][:lighting :run]
[5:14:14][Consider our over-brighting bug][:lighting :run]
[5:15:01][Let FullCast() cast rays from inside geometry][:lighting]
[5:15:23][The light goes over-bright][:lighting :run :sampling]
[5:15:33][Consider our over-brighting bug][:lighting :research :sampling]
[5:17:06][Make FullCast() blacken rather than cast rays from inside geometry][:lighting]
[5:18:04][Determine to add an exposure curve and make all lights between 0 and 1 brightness][:lighting :research]
[5:18:45][@thesandvichmaker][@handmade_hero I like this super basic neutral exposure curve as a default[ref
    site=Desmos
    page="Natural shoulder tonemap"
    url=https://www.desmos.com/calculator/zsxj2jbvdb]][:lighting]
[5:19:40][@teamrandb][@handmade_hero Greetings [@cmuratori Casey]! May you update SendOwl code download, please? It seems stuck on Day 346 with no updates]
[5:20:26][One last look at our light contamination][:lighting :run]
[5:20:52][@floorislava][handmade_hero_646_source.zip is what I'm showing]
[5:21:01][One last look at our light contamination (cont.)][:lighting :run]
[5:21:47][End it here for today][:speech]
[5:22:01][@teamrandb][Sorry, I wrote it wrong. 646. But 646 is February 28th]
[5:22:46][Call it there][:speech]
[/video]
