[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Multiresolution Light Sampling" vod_platform=youtube id=yrqpqbbe948 annotator=Miblo] [0:00][Recap and set the stage for the day working on the :lighting][:rendering :speech] [1:37][:Run the game to show our current :lighting situation whose stability is dependent on the rays][:rendering] [4:14][Wax lyrical on @serge_rgb's wonderful work on ~milton][:blackboard :speech] [5:49][:Lighting mods][:blackboard :optimisation :rendering] [7:10][1. Stratified Sampling, including white noise][:blackboard :lighting :optimisation :prng :rendering :statistics] [13:52][White vs Blue noise[ref site=Wikipedia page="Colors of noise" url=https://en.wikipedia.org/wiki/Colors_of_noise]][:blackboard :optimisation :prng :statistics] [17:33][Light perception][:biology :blackboard] [19:27][Blue noise, with a mention of the Witness Wednesday glass-planting system[ref site="Casey's Blog" page="Working on The Witness, Part 5" url=https://mollyrocket.com/casey/stream_0013.html]][:blackboard :lighting :prng :rendering :statistics] [21:47][Performing stratified sampling][:blackboard :lighting :prng :rendering :statistics] [25:18][2. "Multires sampling"][:blackboard :lighting :optimisation :rendering :statistics] [28:46][3. "Bidirectional sampling"][:blackboard :lighting :optimisation :rendering :statistics] [31:52][Make PlayWorld() generate 16 screens][:"procedural generation"] [32:23][:Run the game and inspect the profiler, with the determination to get multiresolution sampling working][:lighting :performance :statistics :rendering] [34:11][Read through the current :lighting code with a view to implementing multiresolution sampling, with synthetic light indices for neighbouring spatial partitions to use][:statistics :optimisation :rendering :research] [38:46][Introduce the notion of an ExtendedPointCount in lighting_solution, to store synthetic :lighting data][:optimisation :statistic :rendering] [45:27][Producing the data for the synthetic :lighting elements][:blackboard :geometry :rendering][quote 613] [49:48][Make SplitBox() produce the extended :lighting points from the average of all points in their box][:geometry :rendering] [1:02:15][:Run the game to see the total :lighting solution, and determine to produce some :"debug visualisation" of the spatial hierarchy][:geometry :rendering] [1:04:20][Introduce OutputLightingPointsRecurse() to produce :"debug visualisation" for the :lighting system's entire spatial hierarchy][:geometry :rendering] [1:10:47][Step in to OutputLightingPoints() to realise that we are indirected][:lighting :rendering :run] [1:13:33][Make OutputLightingPoints() and SplitBox() use GetBox()][:geometry :lighting :rendering] [1:15:11][:Run the game to see our :lighting :"debug visualisation"][:rendering] [1:16:06][Make OutputLightingPointsRecurse() size the :"debug visualisation" :lighting boxes proportionally to their depth in the hierarchy][:geometry :rendering] [1:20:06][:Run the game to see our proportionally-sized :lighting :"debug visualisation"][:geometry :rendering] [1:21:01][Provide the ability in UpdateAndRenderWorld() to adjust the depth hierarchy][:"debug visualisation" :"input handling" :lighting :rendering] [1:22:15][:Run the game and inspect our entire :lighting hierarchy][:"debug visualisation" :rendering] [1:24:03][Make SplitBox() set the AccumulatedPPS to the InitialPPS][:"debug visualisation" :geometry :lighting :rendering] [1:25:31][:Run the game and inspect our entire :lighting hierarchy][:"debug visualisation" :geometry :rendering] [1:27:06][Prevent OutputLightingPointsRecurse() from including the emission of a childless light source][:"debug visualisation" :geometry :lighting :rendering] [1:27:37][:Run the game to see that that doesn't fix our problem][:"debug visualisation" :geometry :lighting :rendering] [1:32:14][Enable RayCastRecurse() to recurse to a given depth][:geometry :lighting :optimisation :rendering] [1:33:35][:Run the game and watch the RayCastBoxCount while adjusting the depth in RayCastRecurse()][:lighting :optimisation :rendering] [1:35:01][Make PlayWorld() create larger rooms][:"procedural generation"] [1:35:33][:Run the game and again watch the RayCastBoxCount while adjusting the depth in RayCastRecurse()][:lighting :optimisation :rendering] [1:38:29][Step in to LightingTest() to inspect the PointCount][:"debug system" :lighting :rendering :run] [1:40:08][Make LightingTest() use a temporary variable for the PointCount before giving it to the DEBUG_VALUE][:"debug system"] [1:40:31][:Run the game to determine that we have a bug in how we output u16s][:"debug system"] [1:40:37][Add padding in lighting_solution after PointCount][:"debug system"] [1:41:46][:Run the game to see that that fixes it][:"debug system"] [1:42:37][Add a u16 handler in DEBUGValueSetEventData][:"debug system"] [1:45:48][:Run the game to see that our PointCount is displayed correctly, but that our RayCastBoxCount seems to be too high][:"debug system" :"debug visualisation" :geometry] [1:49:42][Augment lighting_solution with some more meaningful counters][:"debug system" :lighting :rendering] [1:56:44][:Run the game and inspect :lighting data in the profiler][:performance :rendering] [1:58:13][Force RayCastRecurse() never to recurse][:geometry :lighting :rendering] [1:58:30][:Run the game to see that TotalPartitionsTested did not go down much][:geometry :lighting :performance :rendering] [2:00:24][Read carefully through RayCastRecurse()][:geometry :lighting :rendering :research] [2:01:36][:Run the game and watch the TotalLeavesTested when recursing or not][:geometry :lighting :rendering] [2:02:52][Try making PlayWorld() create more layers][:"procedural generation"] [2:04:46][:Run the game and now watch TotalLeavesTested() when recursing or not, to see that, when it doesn't recurse, it goes down much more now that there is a layer of :geometry above use][:lighting :performance :rendering] [2:07:28][Q&A][:speech] [2:09:03][@jamoflaw][Q: Can you explain why was the debug output behaving odd with u16s?][:"debug system"] [2:12:47][@mathdaemon][Q: How likely is a lighting system GPU port still?][:hardware] [2:13:19][@graemephi][Q: (Off-topic) Did you ever find out if it's necessary for CPUs to have named registers?][:hardware] [2:15:38][@ataradov][Look at Mill CPU. It has no registers, but it is also a vaporware as far as physical implementations go][:hardware] [2:17:21][@longboolean][Q: Do you think arranging pixels on LCD monitors in a blue noise pattern would be an improvement visually, I assume the costs to manufacture would sky rocket, or are we just better off making the pixels smaller?][:prng] [2:18:20][@ataradov][Q: :Memory is slow] [2:18:35][Close down][:speech] [/video]