Handmade Hero»Episode Guide
Visualizing Lighting Values
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:01Note Twitch's latest twitchiness1
🗩
0:01Note Twitch's latest twitchiness1
🗩
0:01Note Twitch's latest twitchiness1
🗩
1:26Determine to do a lighting quality pass
🗩
1:26Determine to do a lighting quality pass
🗩
1:26Determine to do a lighting quality pass
🗩
4:50Debugging the lighting: 1) Trial-and-error eyeballing
🗩
4:50Debugging the lighting: 1) Trial-and-error eyeballing
🗩
4:50Debugging the lighting: 1) Trial-and-error eyeballing
🗩
5:28Debugging the lighting: 2) Create and validate against our own definition of correct lighting behaviour
🗩
5:28Debugging the lighting: 2) Create and validate against our own definition of correct lighting behaviour
🗩
5:28Debugging the lighting: 2) Create and validate against our own definition of correct lighting behaviour
🗩
7:48Regret not having gained much experience with lighting
🗩
7:48Regret not having gained much experience with lighting
🗩
7:48Regret not having gained much experience with lighting
🗩
8:27Demo our ability to debug the raycaster
🏃
8:27Demo our ability to debug the raycaster
🏃
8:27Demo our ability to debug the raycaster
🏃
10:19ComputeLightPropagationWork cycle use: 82%
🏃
10:19ComputeLightPropagationWork cycle use: 82%
🏃
10:19ComputeLightPropagationWork cycle use: 82%
🏃
11:23Approaching lighting transfer
🏃
11:23Approaching lighting transfer
🏃
11:23Approaching lighting transfer
🏃
13:52Approaching lighting transfer: Draw lines through the centre of each grid cube, derived from the octahedral map, with brighter directions drawn longer
🏃
13:52Approaching lighting transfer: Draw lines through the centre of each grid cube, derived from the octahedral map, with brighter directions drawn longer
🏃
13:52Approaching lighting transfer: Draw lines through the centre of each grid cube, derived from the octahedral map, with brighter directions drawn longer
🏃
15:59Try increasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
15:59Try increasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
15:59Try increasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
16:23Demo the slow, but feeding back, lighting transfer, with the determination to step the lighting frame-by-frame
🏃
16:23Demo the slow, but feeding back, lighting transfer, with the determination to step the lighting frame-by-frame
🏃
16:23Demo the slow, but feeding back, lighting transfer, with the determination to step the lighting frame-by-frame
🏃
17:49Determine to draw those octahedral lines in a smaller secondary debug bounds
🏃
17:49Determine to draw those octahedral lines in a smaller secondary debug bounds
🏃
17:49Determine to draw those octahedral lines in a smaller secondary debug bounds
🏃
19:34Introduce DebugDrawOctahedralValues() for UpdateLighting() to call
19:34Introduce DebugDrawOctahedralValues() for UpdateLighting() to call
19:34Introduce DebugDrawOctahedralValues() for UpdateLighting() to call
21:05Note that the diffuse blur is probably providing too much power to the system
🗩
21:05Note that the diffuse blur is probably providing too much power to the system
🗩
21:05Note that the diffuse blur is probably providing too much power to the system
🗩
22:23Make DebugDrawOctahedralValues() draw out our desired debug bounds
22:23Make DebugDrawOctahedralValues() draw out our desired debug bounds
22:23Make DebugDrawOctahedralValues() draw out our desired debug bounds
29:44Introduce a version of * that takes a v3s and s32, and fix compile errors
29:44Introduce a version of * that takes a v3s and s32, and fix compile errors
29:44Introduce a version of * that takes a v3s and s32, and fix compile errors
31:00Check out our debug boxes
🏃
31:00Check out our debug boxes
🏃
31:00Check out our debug boxes
🏃
31:37Make DebugDrawOctahedralValues() draw our octahedral lines
31:37Make DebugDrawOctahedralValues() draw our octahedral lines
31:37Make DebugDrawOctahedralValues() draw our octahedral lines
39:13Check out our octahedral lines
🏃
39:13Check out our octahedral lines
🏃
39:13Check out our octahedral lines
🏃
40:00Make PushLightingRenderValues() Clamp01() the Color
40:00Make PushLightingRenderValues() Clamp01() the Color
40:00Make PushLightingRenderValues() Clamp01() the Color
42:46The octahedral lines do not remain white
🏃
42:46The octahedral lines do not remain white
🏃
42:46The octahedral lines do not remain white
🏃
43:10Fix PushLightingRenderValues() to Clamp01() the Line->Color and pass the resulting Color to PushLineSegment()
43:10Fix PushLightingRenderValues() to Clamp01() the Line->Color and pass the resulting Color to PushLineSegment()
43:10Fix PushLightingRenderValues() to Clamp01() the Line->Color and pass the resulting Color to PushLineSegment()
43:24Our octahedral lines still do not remain white
🏃
43:24Our octahedral lines still do not remain white
🏃
43:24Our octahedral lines still do not remain white
🏃
43:49Fix PushLightingRenderValues() to pass the clamped Color to PushLineSegment() for both ends
43:49Fix PushLightingRenderValues() to pass the clamped Color to PushLineSegment() for both ends
43:49Fix PushLightingRenderValues() to pass the clamped Color to PushLineSegment() for both ends
44:01Our octahedral lines now remain white
🏃
44:01Our octahedral lines now remain white
🏃
44:01Our octahedral lines now remain white
🏃
44:20Determine to support stepping the lighting frame-by-frame
🏃
44:20Determine to support stepping the lighting frame-by-frame
🏃
44:20Determine to support stepping the lighting frame-by-frame
🏃
44:58Prevent UpdateAndRenderWorld() from calling UpdateLighting()
44:58Prevent UpdateAndRenderWorld() from calling UpdateLighting()
44:58Prevent UpdateAndRenderWorld() from calling UpdateLighting()
46:08We get no lighting
🏃
46:08We get no lighting
🏃
46:08We get no lighting
🏃
46:19Make UpdateAndRenderWorld() call UpdateLighting() when we press F9
46:19Make UpdateAndRenderWorld() call UpdateLighting() when we press F9
46:19Make UpdateAndRenderWorld() call UpdateLighting() when we press F9
47:58Step the lighting frame-by-frame with F9
🏃
47:58Step the lighting frame-by-frame with F9
🏃
47:58Step the lighting frame-by-frame with F9
🏃
49:25Delete moonlight variables from GridRayCast()
49:25Delete moonlight variables from GridRayCast()
49:25Delete moonlight variables from GridRayCast()
50:41Our system contains no moonlight, yet our octahedral maps are seeing more light from above
🏃
50:41Our system contains no moonlight, yet our octahedral maps are seeing more light from above
🏃
50:41Our system contains no moonlight, yet our octahedral maps are seeing more light from above
🏃
52:11Make PushLight() draw the light
52:11Make PushLight() draw the light
52:11Make PushLight() draw the light
53:55Check out our lights, and see that our octahedral maps are not really responding to them
🏃
53:55Check out our lights, and see that our octahedral maps are not really responding to them
🏃
53:55Check out our lights, and see that our octahedral maps are not really responding to them
🏃
55:38Move the DebugGridIndex and DebugRayIndex DEBUG_VALUE() initialisers from UpdateLighting() to PushLightingRenderValues()
55:38Move the DebugGridIndex and DebugRayIndex DEBUG_VALUE() initialisers from UpdateLighting() to PushLightingRenderValues()
55:38Move the DebugGridIndex and DebugRayIndex DEBUG_VALUE() initialisers from UpdateLighting() to PushLightingRenderValues()
56:43Edit our DebugGridIndex and DebugRayIndex to 17912 and 100
🏃
56:43Edit our DebugGridIndex and DebugRayIndex to 17912 and 100
🏃
56:43Edit our DebugGridIndex and DebugRayIndex to 17912 and 100
🏃
58:30Make UpdateLighting() set DebugGridIndex and DebugRayIndex to 17912 + (SpatialGrid.CellCount.x × SpatialGrid.CellCount.y) and 100
58:30Make UpdateLighting() set DebugGridIndex and DebugRayIndex to 17912 + (SpatialGrid.CellCount.x × SpatialGrid.CellCount.y) and 100
58:30Make UpdateLighting() set DebugGridIndex and DebugRayIndex to 17912 + (SpatialGrid.CellCount.x × SpatialGrid.CellCount.y) and 100
58:55Edit our DebugGridIndex and DebugRayIndex to 17912 and 99
🏃
58:55Edit our DebugGridIndex and DebugRayIndex to 17912 and 99
🏃
58:55Edit our DebugGridIndex and DebugRayIndex to 17912 and 99
🏃
1:02:10Make UpdateLighting() set DebugGridIndex to 17912
1:02:10Make UpdateLighting() set DebugGridIndex to 17912
1:02:10Make UpdateLighting() set DebugGridIndex to 17912
1:02:31Edit our DebugRayIndex to 156, and wonder if we are writing back into the wrong parts of the octahedral map
🏃
1:02:31Edit our DebugRayIndex to 156, and wonder if we are writing back into the wrong parts of the octahedral map
🏃
1:02:31Edit our DebugRayIndex to 156, and wonder if we are writing back into the wrong parts of the octahedral map
🏃
1:04:21Make UpdateLighting() set DebugRayIndex to 156
1:04:21Make UpdateLighting() set DebugRayIndex to 156
1:04:21Make UpdateLighting() set DebugRayIndex to 156
1:04:30Edit our DebugRayIndex to 155
🏃
1:04:30Edit our DebugRayIndex to 155
🏃
1:04:30Edit our DebugRayIndex to 155
🏃
1:05:35Make UpdateLighting() set DebugRayIndex to 155
1:05:35Make UpdateLighting() set DebugRayIndex to 155
1:05:35Make UpdateLighting() set DebugRayIndex to 155
1:05:42Try making FullCast() pass an Ignored buffer to GridRayCast(), to rule out the debug system interfering with the SpecAtlas
1:05:42Try making FullCast() pass an Ignored buffer to GridRayCast(), to rule out the debug system interfering with the SpecAtlas
1:05:42Try making FullCast() pass an Ignored buffer to GridRayCast(), to rule out the debug system interfering with the SpecAtlas
1:08:57Our problem remains
🏃
1:08:57Our problem remains
🏃
1:08:57Our problem remains
🏃
1:09:38Make FullCast() draw the ExpectedDirection that our rays point into their octahedral map
1:09:38Make FullCast() draw the ExpectedDirection that our rays point into their octahedral map
1:09:38Make FullCast() draw the ExpectedDirection that our rays point into their octahedral map
1:15:38Our rays and octahedral directions are closely aligned
🏃
1:15:38Our rays and octahedral directions are closely aligned
🏃
1:15:38Our rays and octahedral directions are closely aligned
🏃
1:16:52Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:16:52Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:16:52Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:17:16Step through the lighting
🏃
1:17:16Step through the lighting
🏃
1:17:16Step through the lighting
🏃
1:17:43Make DebugDrawOctahedralValues() increase the length of our octahedral lines
1:17:43Make DebugDrawOctahedralValues() increase the length of our octahedral lines
1:17:43Make DebugDrawOctahedralValues() increase the length of our octahedral lines
1:18:34Step through the lighting
🏃
1:18:34Step through the lighting
🏃
1:18:34Step through the lighting
🏃
1:19:07Make DebugDrawOctahedralValues() draw the diffuse atlas lines, introducing DebugDrawColorDir()
1:19:07Make DebugDrawOctahedralValues() draw the diffuse atlas lines, introducing DebugDrawColorDir()
1:19:07Make DebugDrawOctahedralValues() draw the diffuse atlas lines, introducing DebugDrawColorDir()
1:22:03Step through the lighting, to see that the diffuse atlas grows quickly
🏃
1:22:03Step through the lighting, to see that the diffuse atlas grows quickly
🏃
1:22:03Step through the lighting, to see that the diffuse atlas grows quickly
🏃
1:23:06Temporarily prevent DebugDrawOctahedralValues() from drawing the diffuse atlas lines
1:23:06Temporarily prevent DebugDrawOctahedralValues() from drawing the diffuse atlas lines
1:23:06Temporarily prevent DebugDrawOctahedralValues() from drawing the diffuse atlas lines
1:23:19Step through the lighting, and note the upwards bias
🏃
1:23:19Step through the lighting, and note the upwards bias
🏃
1:23:19Step through the lighting, and note the upwards bias
🏃
1:23:54Prevent GridRayCast() from transferring the light for non-hits
1:23:54Prevent GridRayCast() from transferring the light for non-hits
1:23:54Prevent GridRayCast() from transferring the light for non-hits
1:27:16Our SpecAtlas is getting light from the wrong directions
🏃
1:27:16Our SpecAtlas is getting light from the wrong directions
🏃
1:27:16Our SpecAtlas is getting light from the wrong directions
🏃
1:28:14Prevent GridRayCast() from transferring the light for hits
1:28:14Prevent GridRayCast() from transferring the light for hits
1:28:14Prevent GridRayCast() from transferring the light for hits
1:28:32We correctly see no light
🏃
1:28:32We correctly see no light
🏃
1:28:32We correctly see no light
🏃
1:29:00Our bug possibilities: 1) False hit reports; 2) Incorrectly writing the direction; 3) Incorrect debug drawing
🗩
1:29:00Our bug possibilities: 1) False hit reports; 2) Incorrectly writing the direction; 3) Incorrect debug drawing
🗩
1:29:00Our bug possibilities: 1) False hit reports; 2) Incorrectly writing the direction; 3) Incorrect debug drawing
🗩
1:30:41Scrutinise FullCast() for write-back errors
📖
1:30:41Scrutinise FullCast() for write-back errors
📖
1:30:41Scrutinise FullCast() for write-back errors
📖
1:33:38Check out our apparent ray hit
🏃
1:33:38Check out our apparent ray hit
🏃
1:33:38Check out our apparent ray hit
🏃
1:33:56Prevent GridRayCast() from transferring the light for non-hits
1:33:56Prevent GridRayCast() from transferring the light for non-hits
1:33:56Prevent GridRayCast() from transferring the light for non-hits
1:34:21Our target ray is correctly not drawn
🏃
1:34:21Our target ray is correctly not drawn
🏃
1:34:21Our target ray is correctly not drawn
🏃
1:34:55Move the debug line drawing branch in GridRayCast() outside of the SomethingHit condition
1:34:55Move the debug line drawing branch in GridRayCast() outside of the SomethingHit condition
1:34:55Move the debug line drawing branch in GridRayCast() outside of the SomethingHit condition
1:35:25Check out our misinformed octahedral lines
🏃
1:35:25Check out our misinformed octahedral lines
🏃
1:35:25Check out our misinformed octahedral lines
🏃
1:37:00Edit our DebugGridIndex to 17788
🏃
1:37:00Edit our DebugGridIndex to 17788
🏃
1:37:00Edit our DebugGridIndex to 17788
🏃
1:38:08Make UpdateLighting() set DebugGridIndex to 17788
1:38:08Make UpdateLighting() set DebugGridIndex to 17788
1:38:08Make UpdateLighting() set DebugGridIndex to 17788
1:38:29Edit our DebugRayIndex, hopefully towards a light
🏃
1:38:29Edit our DebugRayIndex, hopefully towards a light
🏃
1:38:29Edit our DebugRayIndex, hopefully towards a light
🏃
1:42:01Try decreasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
1:42:01Try decreasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
1:42:01Try decreasing the W modification from ×0.75 to ×0.1 in BuildDiffuseLightMaps()
1:42:51Edit our DebugRayIndex to 325, directly towards a light
🏃
1:42:51Edit our DebugRayIndex to 325, directly towards a light
🏃
1:42:51Edit our DebugRayIndex to 325, directly towards a light
🏃
1:43:31Make UpdateLighting() set DebugRayIndex to 325
1:43:31Make UpdateLighting() set DebugRayIndex to 325
1:43:31Make UpdateLighting() set DebugRayIndex to 325
1:44:16Check out our direct hit
🏃
1:44:16Check out our direct hit
🏃
1:44:16Check out our direct hit
🏃
1:45:16Rename ControlMask to FPControlMask in SetDefaultFPBehavior()2
1:45:16Rename ControlMask to FPControlMask in SetDefaultFPBehavior()2
1:45:16Rename ControlMask to FPControlMask in SetDefaultFPBehavior()2
1:46:40uplinkcoder Q: Maybe just have one light source?
🗪
1:46:40uplinkcoder Q: Maybe just have one light source?
🗪
1:46:40uplinkcoder Q: Maybe just have one light source?
🗪
1:47:07Temporarily prevent GenerateRoom() from adding lamps
1:47:07Temporarily prevent GenerateRoom() from adding lamps
1:47:07Temporarily prevent GenerateRoom() from adding lamps
1:47:26Check out our one light
🏃
1:47:26Check out our one light
🏃
1:47:26Check out our one light
🏃
1:47:53Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:47:53Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:47:53Try increasing the W modification from ×0.1 to ×0.75 in BuildDiffuseLightMaps()
1:48:00Our octahedral maps are still seeing light from the wrong directions
🏃
1:48:00Our octahedral maps are still seeing light from the wrong directions
🏃
1:48:00Our octahedral maps are still seeing light from the wrong directions
🏃
1:48:38A few words on languages with non-helpful "error-catching" features
🏃
1:48:38A few words on languages with non-helpful "error-catching" features
🏃
1:48:38A few words on languages with non-helpful "error-catching" features
🏃
1:50:56Consider our problem to be an indexing one
🏃
1:50:56Consider our problem to be an indexing one
🏃
1:50:56Consider our problem to be an indexing one
🏃
1:53:12Q&A
🗩
1:53:12Q&A
🗩
1:53:12Q&A
🗩
1:53:29uplinkcoder Q: Try moving the light
🗪
1:53:29uplinkcoder Q: Try moving the light
🗪
1:53:29uplinkcoder Q: Try moving the light
🗪
1:53:42Step through the lighting
🏃
1:53:42Step through the lighting
🏃
1:53:42Step through the lighting
🏃
1:53:57Make UpdateAndRenderWorld() offset the debug light in X
1:53:57Make UpdateAndRenderWorld() offset the debug light in X
1:53:57Make UpdateAndRenderWorld() offset the debug light in X
1:54:23See how that affects our octahedral lines
🏃
1:54:23See how that affects our octahedral lines
🏃
1:54:23See how that affects our octahedral lines
🏃
1:55:01Make UpdateAndRenderWorld() offset the debug light the opposite direction in X
1:55:01Make UpdateAndRenderWorld() offset the debug light the opposite direction in X
1:55:01Make UpdateAndRenderWorld() offset the debug light the opposite direction in X
1:55:17See how that affects our octahedral lines
🏃
1:55:17See how that affects our octahedral lines
🏃
1:55:17See how that affects our octahedral lines
🏃
1:56:32Prevent UpdateAndRenderWorld() from offsetting the debug light
1:56:32Prevent UpdateAndRenderWorld() from offsetting the debug light
1:56:32Prevent UpdateAndRenderWorld() from offsetting the debug light
1:57:02miltondts Q: Why are there two lit areas in the map with only one light source?
🗪
1:57:02miltondts Q: Why are there two lit areas in the map with only one light source?
🗪
1:57:02miltondts Q: Why are there two lit areas in the map with only one light source?
🗪
1:57:14The lighting gets tiled around the world
🏃
1:57:14The lighting gets tiled around the world
🏃
1:57:14The lighting gets tiled around the world
🏃
1:58:37Disable LIGHTING_USE_GRID
1:58:37Disable LIGHTING_USE_GRID
1:58:37Disable LIGHTING_USE_GRID
1:58:53Our debug visualisation is wrong
🏃
1:58:53Our debug visualisation is wrong
🏃
1:58:53Our debug visualisation is wrong
🏃
1:59:27Let UpdateAndRenderWorld() call UpdateLighting() every frame
1:59:27Let UpdateAndRenderWorld() call UpdateLighting() every frame
1:59:27Let UpdateAndRenderWorld() call UpdateLighting() every frame
1:59:40Our debug visualisation is wrong
🏃
1:59:40Our debug visualisation is wrong
🏃
1:59:40Our debug visualisation is wrong
🏃
2:00:01Scrutinise DebugDrawOctahedralValues() and related functions for bugs
📖
2:00:01Scrutinise DebugDrawOctahedralValues() and related functions for bugs
📖
2:00:01Scrutinise DebugDrawOctahedralValues() and related functions for bugs
📖
2:06:11Check out our octahedral lines while moving the light
🏃
2:06:11Check out our octahedral lines while moving the light
🏃
2:06:11Check out our octahedral lines while moving the light
🏃
2:07:41Let LIGHT_ATLAS_ASSERT() actually Assert()
2:07:41Let LIGHT_ATLAS_ASSERT() actually Assert()
2:07:41Let LIGHT_ATLAS_ASSERT() actually Assert()
2:09:51Happily fail to hit any LIGHT_ATLAS_ASSERT()
🏃
2:09:51Happily fail to hit any LIGHT_ATLAS_ASSERT()
🏃
2:09:51Happily fail to hit any LIGHT_ATLAS_ASSERT()
🏃
2:11:03uplinkcoder Q: PushDebugLine() parameter order maybe?
🗪
2:11:03uplinkcoder Q: PushDebugLine() parameter order maybe?
🗪
2:11:03uplinkcoder Q: PushDebugLine() parameter order maybe?
🗪
2:12:05uplinkcoder Q: Direction inverted?
🗪
2:12:05uplinkcoder Q: Direction inverted?
🗪
2:12:05uplinkcoder Q: Direction inverted?
🗪
2:12:11Eyeball the octahedral lines, not seeing inversion
🏃
2:12:11Eyeball the octahedral lines, not seeing inversion
🏃
2:12:11Eyeball the octahedral lines, not seeing inversion
🏃
2:13:35Briefly scrutinise DirectionFromTxTy() for bugs
📖
2:13:35Briefly scrutinise DirectionFromTxTy() for bugs
📖
2:13:35Briefly scrutinise DirectionFromTxTy() for bugs
📖
2:14:29vaualbus Q: Does this not pass through the thing we did for having the 3D texture? Maybe we are tilting the line in the shader
🗪
2:14:29vaualbus Q: Does this not pass through the thing we did for having the 3D texture? Maybe we are tilting the line in the shader
🗪
2:14:29vaualbus Q: Does this not pass through the thing we did for having the 3D texture? Maybe we are tilting the line in the shader
🗪
2:15:17Thank you, everyone
🗩
2:15:17Thank you, everyone
🗩
2:15:17Thank you, everyone
🗩