Debugging Lighting Flicker
?
?

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:01Recap and set the stage for the day doing lighting optimisation
🗩
0:01Recap and set the stage for the day doing lighting optimisation
🗩
0:01Recap and set the stage for the day doing lighting optimisation
🗩
2:37Run the game to see our current lighting situation
🏃
2:37Run the game to see our current lighting situation
🏃
2:37Run the game to see our current lighting situation
🏃
4:10Determine to enable OpenGLRenderCommands() to correctly clear the backbuffer
📖
4:10Determine to enable OpenGLRenderCommands() to correctly clear the backbuffer
📖
4:10Determine to enable OpenGLRenderCommands() to correctly clear the backbuffer
📖
6:16Step in to OpenGLRenderCommands() to see that it may be clearing the wrong render target
6:16Step in to OpenGLRenderCommands() to see that it may be clearing the wrong render target
6:16Step in to OpenGLRenderCommands() to see that it may be clearing the wrong render target
7:02Read through OpenGLRenderCommands(), to see if we are indeed clearing the wrong target
📖
7:02Read through OpenGLRenderCommands(), to see if we are indeed clearing the wrong target
📖
7:02Read through OpenGLRenderCommands(), to see if we are indeed clearing the wrong target
📖
8:05Step through OpenGLRenderCommands() watching the OnPeelIndex
🏃
8:05Step through OpenGLRenderCommands() watching the OnPeelIndex
🏃
8:05Step through OpenGLRenderCommands() watching the OnPeelIndex
🏃
8:37Make OpenGLRenderCommands() increment the HeaderAt pointer inside the commands loop
8:37Make OpenGLRenderCommands() increment the HeaderAt pointer inside the commands loop
8:37Make OpenGLRenderCommands() increment the HeaderAt pointer inside the commands loop
10:49Run the game to see that the clear is back to the correct behaviour
🏃
10:49Run the game to see that the clear is back to the correct behaviour
🏃
10:49Run the game to see that the clear is back to the correct behaviour
🏃
12:31Read through the lighting code with a view to optimising it
📖
12:31Read through the lighting code with a view to optimising it
📖
12:31Read through the lighting code with a view to optimising it
📖
15:33Run the game and point out that we are not leveraging our previously computed lighting
🏃
15:33Run the game and point out that we are not leveraging our previously computed lighting
🏃
15:33Run the game and point out that we are not leveraging our previously computed lighting
🏃
16:27Enable LightingTest() to use the previously computed lighting emission
16:27Enable LightingTest() to use the previously computed lighting emission
16:27Enable LightingTest() to use the previously computed lighting emission
20:36Run the game to see flickering lighting
🏃
20:36Run the game to see flickering lighting
🏃
20:36Run the game to see flickering lighting
🏃
21:07Make LightingTest() save the new lighting emission back
21:07Make LightingTest() save the new lighting emission back
21:07Make LightingTest() save the new lighting emission back
22:30Run the game to see that we're a lot slower
🏃
22:30Run the game to see that we're a lot slower
🏃
22:30Run the game to see that we're a lot slower
🏃
22:51Reduce the RayCount in ComputeLightPropagation()
22:51Reduce the RayCount in ComputeLightPropagation()
22:51Reduce the RayCount in ComputeLightPropagation()
23:16Run the game to see that the lighting is still very flickery
🏃
23:16Run the game to see that the lighting is still very flickery
🏃
23:16Run the game to see that the lighting is still very flickery
🏃
24:03Increase the RetainedEmissionCoefficient in LightingTest()
📖
24:03Increase the RetainedEmissionCoefficient in LightingTest()
📖
24:03Increase the RetainedEmissionCoefficient in LightingTest()
📖
24:16Run the game to see the light spreading
🏃
24:16Run the game to see the light spreading
🏃
24:16Run the game to see the light spreading
🏃
25:24Change ComputeLightPropagation() to use a power-decaying scheme
25:24Change ComputeLightPropagation() to use a power-decaying scheme
25:24Change ComputeLightPropagation() to use a power-decaying scheme
27:50Run the game to see more reasonable lighting
🏃
27:50Run the game to see more reasonable lighting
🏃
27:50Run the game to see more reasonable lighting
🏃
28:01Tweak the BlendAmount, RayCount and IterationCount in ComputeLightPropagation()
28:01Tweak the BlendAmount, RayCount and IterationCount in ComputeLightPropagation()
28:01Tweak the BlendAmount, RayCount and IterationCount in ComputeLightPropagation()
29:32Run the game and consider that a single pass on the lighting may be usable
🏃
29:32Run the game and consider that a single pass on the lighting may be usable
🏃
29:32Run the game and consider that a single pass on the lighting may be usable
🏃
30:39Determine to rework ComputeLightPropagation() to compute the lighting in a single pass
📖
30:39Determine to rework ComputeLightPropagation() to compute the lighting in a single pass
📖
30:39Determine to rework ComputeLightPropagation() to compute the lighting in a single pass
📖
33:52Rework ComputeLightPropagation() to compute the lighting using a single-pass point collection-style scheme
33:52Rework ComputeLightPropagation() to compute the lighting using a single-pass point collection-style scheme
33:52Rework ComputeLightPropagation() to compute the lighting using a single-pass point collection-style scheme
47:31Resolving discontinuities caused by snapping the lighting samples to spatial partitions
🖌
47:31Resolving discontinuities caused by snapping the lighting samples to spatial partitions
🖌
47:31Resolving discontinuities caused by snapping the lighting samples to spatial partitions
🖌
53:09Enable ComputeLightPropagation() to blend the lighting emission by the DistanceSq
53:09Enable ComputeLightPropagation() to blend the lighting emission by the DistanceSq
53:09Enable ComputeLightPropagation() to blend the lighting emission by the DistanceSq
55:43Describe the InvDistanceSq computation – (1 / (1 + x²)) – via a graph1
📖
55:43Describe the InvDistanceSq computation – (1 / (1 + x²)) – via a graph1
📖
55:43Describe the InvDistanceSq computation – (1 / (1 + x²)) – via a graph1
📖
58:06Continue to enable ComputeLightPropagation() to accumulate, blend and attenuate the light
58:06Continue to enable ComputeLightPropagation() to accumulate, blend and attenuate the light
58:06Continue to enable ComputeLightPropagation() to accumulate, blend and attenuate the light
1:16:47Run the game to see that we get a little grey lighting, and step through ComputeLightPropagation()
🏃
1:16:47Run the game to see that we get a little grey lighting, and step through ComputeLightPropagation()
🏃
1:16:47Run the game to see that we get a little grey lighting, and step through ComputeLightPropagation()
🏃
1:18:03Remove NextFree from lighting_point
1:18:03Remove NextFree from lighting_point
1:18:03Remove NextFree from lighting_point
1:18:30Continue to step through ComputeLightPropagation() inspecting the lighting values
🏃
1:18:30Continue to step through ComputeLightPropagation() inspecting the lighting values
🏃
1:18:30Continue to step through ComputeLightPropagation() inspecting the lighting values
🏃
1:22:06Increase the Power value in ComputeLightPropagation()
1:22:06Increase the Power value in ComputeLightPropagation()
1:22:06Increase the Power value in ComputeLightPropagation()
1:22:48Run the game to see that the lighting is still flickering
🏃
1:22:48Run the game to see that the lighting is still flickering
🏃
1:22:48Run the game to see that the lighting is still flickering
🏃
1:24:24Make ComputeLightPropagation() propagate forwards the previously computed lighting
1:24:24Make ComputeLightPropagation() propagate forwards the previously computed lighting
1:24:24Make ComputeLightPropagation() propagate forwards the previously computed lighting
1:25:30Run the game and still see flicker, due to the unpredictable moonlight sampling
🏃
1:25:30Run the game and still see flicker, due to the unpredictable moonlight sampling
🏃
1:25:30Run the game and still see flicker, due to the unpredictable moonlight sampling
🏃
1:28:09Enable the BlendAmount in ComputeLightPropagation() to work as expected
1:28:09Enable the BlendAmount in ComputeLightPropagation() to work as expected
1:28:09Enable the BlendAmount in ComputeLightPropagation() to work as expected
1:31:10Run the game without the skylight, to find that BlendAmount works as expected
🏃
1:31:10Run the game without the skylight, to find that BlendAmount works as expected
🏃
1:31:10Run the game without the skylight, to find that BlendAmount works as expected
🏃
1:31:55Reconsider the problem in light of the fact that a lower BlendAmount does not reduce the flicker
📖
1:31:55Reconsider the problem in light of the fact that a lower BlendAmount does not reduce the flicker
📖
1:31:55Reconsider the problem in light of the fact that a lower BlendAmount does not reduce the flicker
📖
1:36:38Make ComputeLightPropagation() and AccumulateSample() sum the lighting identically
1:36:38Make ComputeLightPropagation() and AccumulateSample() sum the lighting identically
1:36:38Make ComputeLightPropagation() and AccumulateSample() sum the lighting identically
1:38:37Run the game to see that it is exactly as it was, and step through ComputeLightPropagation()
🏃
1:38:37Run the game to see that it is exactly as it was, and step through ComputeLightPropagation()
🏃
1:38:37Run the game to see that it is exactly as it was, and step through ComputeLightPropagation()
🏃
1:40:50Enable ComputeLightPropagation() to measure the total light removed and distributed
1:40:50Enable ComputeLightPropagation() to measure the total light removed and distributed
1:40:50Enable ComputeLightPropagation() to measure the total light removed and distributed
1:42:30Step through ComputeLightPropagation() to see that TotalAdded is less than TotalRemoved, and that a very low BlendAmount still fails to prevent the flicker
🏃
1:42:30Step through ComputeLightPropagation() to see that TotalAdded is less than TotalRemoved, and that a very low BlendAmount still fails to prevent the flicker
🏃
1:42:30Step through ComputeLightPropagation() to see that TotalAdded is less than TotalRemoved, and that a very low BlendAmount still fails to prevent the flicker
🏃
1:49:04Read carefully through LightingTest() to double-check our assumptions
📖
1:49:04Read carefully through LightingTest() to double-check our assumptions
📖
1:49:04Read carefully through LightingTest() to double-check our assumptions
📖
1:50:23Make ComputeLightPropagation() sum in (and not clear) the AverageDirectionToLight
1:50:23Make ComputeLightPropagation() sum in (and not clear) the AverageDirectionToLight
1:50:23Make ComputeLightPropagation() sum in (and not clear) the AverageDirectionToLight
1:51:47Run the game to see the flicker-free lighting
🏃
1:51:47Run the game to see the flicker-free lighting
🏃
1:51:47Run the game to see the flicker-free lighting
🏃
1:52:20Work on the transmission amount in ComputeLightPropagation()
1:52:20Work on the transmission amount in ComputeLightPropagation()
1:52:20Work on the transmission amount in ComputeLightPropagation()
1:59:12Run the game and consider that we have a bug in the light removal
🏃
1:59:12Run the game and consider that we have a bug in the light removal
🏃
1:59:12Run the game and consider that we have a bug in the light removal
🏃
2:01:30Q&A
🗩
2:01:30Q&A
🗩
2:01:30Q&A
🗩
2:03:04hengo Q: I don't think your lighting approach (it's kinda like photon mapping but in weird) will work. I think it's worth to rethink your whole idea
🗪
2:03:04hengo Q: I don't think your lighting approach (it's kinda like photon mapping but in weird) will work. I think it's worth to rethink your whole idea
🗪
2:03:04hengo Q: I don't think your lighting approach (it's kinda like photon mapping but in weird) will work. I think it's worth to rethink your whole idea
🗪
2:03:33vateferfout Q: Doesn't a surface need a hit to have its light reduced? If nothing hits the surface, the light will remain constant
🗪
2:03:33vateferfout Q: Doesn't a surface need a hit to have its light reduced? If nothing hits the surface, the light will remain constant
🗪
2:03:33vateferfout Q: Doesn't a surface need a hit to have its light reduced? If nothing hits the surface, the light will remain constant
🗪
2:04:47enyo_enev Q: EmitC += Weight*ContribC, isn't that wrong? It should be RemovedC I think. I may be wrong of course
🗪
2:04:47enyo_enev Q: EmitC += Weight*ContribC, isn't that wrong? It should be RemovedC I think. I may be wrong of course
🗪
2:04:47enyo_enev Q: EmitC += Weight*ContribC, isn't that wrong? It should be RemovedC I think. I may be wrong of course
🗪
2:05:21steplery Q: What editor are you using?
🗪
2:05:21steplery Q: What editor are you using?
🗪
2:05:21steplery Q: What editor are you using?
🗪
2:05:28printf_armin Q: Is the RPI still a thing?
🗪
2:05:28printf_armin Q: Is the RPI still a thing?
🗪
2:05:28printf_armin Q: Is the RPI still a thing?
🗪
2:05:41Consider the bidirectional nature of the lighting
📖
2:05:41Consider the bidirectional nature of the lighting
📖
2:05:41Consider the bidirectional nature of the lighting
📖
2:07:14hengo Q: I study game engineering, so I had some courses about rendering and lighting. What you try is kinda over the top for a live game. I would advise to look into radiosity
🗪
2:07:14hengo Q: I study game engineering, so I had some courses about rendering and lighting. What you try is kinda over the top for a live game. I would advise to look into radiosity
🗪
2:07:14hengo Q: I study game engineering, so I had some courses about rendering and lighting. What you try is kinda over the top for a live game. I would advise to look into radiosity
🗪
2:08:46jamoflaw Q: Raspberry Pi
🗪
2:08:46jamoflaw Q: Raspberry Pi
🗪
2:08:46jamoflaw Q: Raspberry Pi
🗪
2:10:00Determine to make ComputeLightPropagation() bidirectional, using one array, tomorrow2
📖
2:10:00Determine to make ComputeLightPropagation() bidirectional, using one array, tomorrow2
📖
2:10:00Determine to make ComputeLightPropagation() bidirectional, using one array, tomorrow2
📖
2:13:26hengo Q: I thought radiosity approximates the light for one area and not trace single rays to the areas
🗪
2:13:26hengo Q: I thought radiosity approximates the light for one area and not trace single rays to the areas
🗪
2:13:26hengo Q: I thought radiosity approximates the light for one area and not trace single rays to the areas
🗪
2:14:27kareshikraise Q: McGuire's 2016 paper "Deep G Buffer for Stable Global Illumination"3 has a very good implementation of radiosity and his implementation of a deep g buffer is analogous to the depth peeling you are using in Handmade Hero
🗪
2:14:27kareshikraise Q: McGuire's 2016 paper "Deep G Buffer for Stable Global Illumination"3 has a very good implementation of radiosity and his implementation of a deep g buffer is analogous to the depth peeling you are using in Handmade Hero
🗪
2:14:27kareshikraise Q: McGuire's 2016 paper "Deep G Buffer for Stable Global Illumination"3 has a very good implementation of radiosity and his implementation of a deep g buffer is analogous to the depth peeling you are using in Handmade Hero
🗪
2:16:51inlibertate Are you implementing transparency?
🗪
2:16:51inlibertate Are you implementing transparency?
🗪
2:16:51inlibertate Are you implementing transparency?
🗪
2:17:33Reenable the particles and run the game to show the transparency
🏃
🖮
2:17:33Reenable the particles and run the game to show the transparency
🏃
🖮
2:17:33Reenable the particles and run the game to show the transparency
🏃
🖮
2:18:18enyo_enev Q: When you remove the light of the current frame RemoveC after, say, 5 frames, you have to in some way clear DestC and add only SourceC and restart the blend, otherwise it will add forever? Very small portions will get added constantly. Did I misunderstand something?
🗪
2:18:18enyo_enev Q: When you remove the light of the current frame RemoveC after, say, 5 frames, you have to in some way clear DestC and add only SourceC and restart the blend, otherwise it will add forever? Very small portions will get added constantly. Did I misunderstand something?
🗪
2:18:18enyo_enev Q: When you remove the light of the current frame RemoveC after, say, 5 frames, you have to in some way clear DestC and add only SourceC and restart the blend, otherwise it will add forever? Very small portions will get added constantly. Did I misunderstand something?
🗪
2:20:07Try to make ComputeLightPropagation() accumulate to a constant amount of light
2:20:07Try to make ComputeLightPropagation() accumulate to a constant amount of light
2:20:07Try to make ComputeLightPropagation() accumulate to a constant amount of light
2:24:31Run the game to see that this doesn't seem to be working, and step through it to see why
🏃
2:24:31Run the game to see that this doesn't seem to be working, and step through it to see why
🏃
2:24:31Run the game to see that this doesn't seem to be working, and step through it to see why
🏃
2:26:25Try hard-setting SourceSum
2:26:25Try hard-setting SourceSum
2:26:25Try hard-setting SourceSum
2:27:40Run the game to see the effects of this
🏃
2:27:40Run the game to see the effects of this
🏃
2:27:40Run the game to see the effects of this
🏃
2:31:53Double-check in ComputeLightPropagation() that the light is being clamped
2:31:53Double-check in ComputeLightPropagation() that the light is being clamped
2:31:53Double-check in ComputeLightPropagation() that the light is being clamped
2:32:49Run the game to determine that we still have issues
🏃
2:32:49Run the game to determine that we still have issues
🏃
2:32:49Run the game to determine that we still have issues
🏃
2:34:53Consider that we are close to this working reliably
🗩
2:34:53Consider that we are close to this working reliably
🗩
2:34:53Consider that we are close to this working reliably
🗩
2:36:22staythirsty90 Q: What comes after lighting? Any ideas?
🗪
2:36:22staythirsty90 Q: What comes after lighting? Any ideas?
🗪
2:36:22staythirsty90 Q: What comes after lighting? Any ideas?
🗪
2:37:10inlibertate Q: How big is the current codebase, loc wise?4
🗪
2:37:10inlibertate Q: How big is the current codebase, loc wise?4
🗪
2:37:10inlibertate Q: How big is the current codebase, loc wise?4
🗪
2:39:23naysayer88 cmuratori Can you work Yakety Sax into this program somehow?
🗪
2:39:23naysayer88 cmuratori Can you work Yakety Sax into this program somehow?
🗪
2:39:23naysayer88 cmuratori Can you work Yakety Sax into this program somehow?
🗪
2:40:25naysayer88 cmuratori Change one note, like Vanilla Ice did
🗪
2:40:25naysayer88 cmuratori Change one note, like Vanilla Ice did
🗪
2:40:25naysayer88 cmuratori Change one note, like Vanilla Ice did
🗪
2:41:01Shut it down
🗩
2:41:01Shut it down
🗩
2:41:01Shut it down
🗩