cinera_handmade.network/cmuratori/hero/code/code563.hmml

85 lines
6.8 KiB
Plaintext
Raw Permalink Normal View History

[video output=day563 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Using the Light Probe Spatial Index" vod_platform=youtube id=4NnMdLZfpgg annotator=Miblo]
2019-10-23 17:27:21 +00:00
[0:00][Recap and set the stage for the day][:speech]
[0:26][Demo our current :lighting :sampling, with the trilinear blend artifacts][:run]
[3:07][Determine to move on to light transmission][:lighting :run]
[6:01][Reacquaint ourselves with BeginLightingComputation() and EndLightingComputation()][:lighting :research]
[9:02][Admire our :sampling sphere][:lighting :run]
[9:40][Remove the SampleTable from EndLightingComputation() and lighting_solution][:"data structure" :lighting]
[10:33][Walk through the rest of EndLightingComputation()][:lighting :research]
[11:57][Determine to store persistent information in the light probes][:lighting :speech]
[13:20][Determine to specify and track light sources][:lighting :speech]
[14:55]["Bias" in the context of :rendering vs :sampling][:speech]
[16:59][Summarise our determination regarding light probes and tracking of light sources][:lighting :speech]
[17:34][Prepare EndLightingComputation() to implement persistent light probes][:lighting]
[21:00][Reacquaint ourselves with the light probe data in game_render_commands and lighting_solution][:"data structure" :lighting :research]
[23:35][Remove light_probe and the LightProbes buffer from lighting_solution][:"data structure" :lighting]
[23:59][Consider handling variable amounts of light from the six directions, by using a uniform :sampling pattern, pre-multiplied based on the rays-per-face][:"data structure" :lighting :speech]
[26:59][Make EndLightingComputation() accumulate light persistently across frames][:lighting]
[35:26][Probe Accumulation][:blackboard :lighting :mathematics]
[39:58][Make EndLightingComputation() blend the accumulated light using our equation, rather than pre-multiplying in a first pass][:lighting]
[44:28][Prepare to voxelise our light probes][:lighting :research]
[45:39][Consider the :performance of our voxel :sampling and trilinear blending][:lighting :run]
[46:34][Determine to use our voxel spatial indexing for now][:lighting :speech]
[47:39][Make EndLightingComputation() call AddProbeToSpatialIndex() on all light probes, making the latter take the ProbeP and Radius to save it having to look up the light_probe][:lighting]
[54:58][Make EndLightingComputation() accumulate the irradiance of light probes during voxelisation, introducing IrradiancePack()][:lighting]
[1:05:05][Reacquaint ourselves with GetCornerLightIndex() and GetProbeLightingFor(), noting a positional bug][:lighting :research]
[1:08:54][Make EndLightingComputation() call GetCornerLightIndex()][:lighting]
[1:10:19][Make EndLightingComputation() stuff some test irradiance into our light probes][:lighting]
[1:15:11][Make InitLighting() and BeginLightingComputation() set up our light probe voxel grid, and EndLightingComputation() clear the ProbeIndexPtr (while meaning to clear the ProbeIndex)][:lighting]
[1:32:47][Switch ComputeLightPropagation() and friends to our new implementation of light probes, augmenting the lighting_solution with LightProbeP and LightProbeIrradiance pointers][:lighting]
[1:42:59][Make EndLightingComputation() set the solution's light probe data][:lighting]
[1:44:14][Crash in AddProbeToSpatialIndex()][:lighting :run]
[1:44:57][Fix MapIntoGrid() to clamp the light probe voxel cell coordinates][:lighting]
[1:49:29][See something totally wrong][:lighting :run]
[1:50:12][Q&A][:speech]
[1:51:12][@roam00010011][@handmade_hero Why does the [~hero Handmade Hero] channel not have the "game development" and "programming" tags?]
[1:52:35][@Brian][Q: The debug text still not working? I'm guessing yes for I've not seen it, but was curious if I just missed it). I did see earlier that you have begin / end lighting][:"debug system"]
[1:53:04][@mindfulkid][Q: Do you have any examples of good written software (open source) that you would recommend someone to study or that you yourself studied in the past?]
[1:54:38][@eddiesutrecht][Q: Where's puss?]
[1:55:01][@dragoonx6][Q: " @jhucktemp: Does his color scheme have a name? It's very pleasing to the eye"]
[1:55:33][@altoverflow][Q: How can we improve the web?]
[1:58:14][@Brian][Q: Someone had mentioned during the stream perhaps you needed 1.0f - IrrBlendU? (You had 1 - IrrBlendU). Perhaps you have already addressed this][:lighting]
[1:59:09][@npcxx][Q: Is DirectX dependent on the C runtime? Can it be used without it?][:api :library]
[2:01:13][@Brian][Q: I would guess so, because it might cast it to a integer. I had just read the chat][:language]
[2:01:23][Walk through the IrrBlendV initialisation in terms of int-to-float conversion][:language]
[2:04:31][Test int-to-float conversion][:language]
[2:08:52][Compile and see our int-to-float conversion warning][:language]
[2:10:40][Confirm the compiler's reluctance to warn when converting int-to-float in the IrrBlendV initialisation][:language]
[2:12:00][Use 1.0f in the IrrBlendV initialisation][:language :lighting]
[2:12:14][Step to our int-to-float test code and inspect these values][:language :run]
[2:15:05][Representing 5 as an int and a float][:blackboard :language]
[2:17:56][Continue to describe our test int-to-float values][:language :run]
[2:19:44][Floating-point hexadecimal to binary][:blackboard :language]
[2:20:42][Check the IEEE 754 floating-point format[ref
site=Wikipedia
page="IEEE 754"
url=https://en.wikipedia.org/wiki/IEEE_754][ref
site=Wikipedia
page="Single-precision floating-point format"
url=https://en.wikipedia.org/wiki/Single-precision_floating-point_format]][:language :research]
[2:23:00][Inspect TestFloat in memory][:language :run]
[2:24:07][Convert TestFloat from hexadecimal to binary, and understand its floating-point representations[ref
site=Wikipedia
page="Single-precision floating-point format"
url=https://en.wikipedia.org/wiki/Single-precision_floating-point_format]][:blackboard :language]
[2:30:04][Step through our int-to-float conversion of 5][:language :run]
[2:30:57][Increase TestVal from 5 to 1 << 26][:language]
[2:31:18][Step through our int-to-float conversion of 1 << 26][:language :run]
[2:31:27][Why 1 << 26 fits in a float][:blackboard :language]
[2:32:03][Set TestVal to (1 << 26) | 1][:language]
[2:32:46][Step through our int-to-float conversion of (1 << 26) | 1, to see our truncation problem][:language :run]
[2:34:54][@dragoonx6][Q: What debugger is that?[ref
site=itch.io
page=RemedyBG
url=https://remedybg.itch.io/remedybg]]
[2:35:37][Demo the sheer speed of ~remedybg, and praise its installation and the productivity of its writer @x13pixels[ref
site=itch.io
page=RemedyBG
url=https://remedybg.itch.io/remedybg]][:run]
[2:37:12][@ryuukk_][Q: Have you tried CLion?[ref
site="Jet Brains"
page=CLion
url=https://jetbrains.com/clion] Its debugger is awesome]
[2:41:50][Wind it down][:speech]
[/video]