[video output=day589 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Aligning Sampling Spheres with the Octahedral Map" vod_platform=youtube id=w-Yyg-mw1-s annotator=Miblo]
[0:03][Welcome to the stream][:speech]
[0:09][Demo our more tightly bound :lighting region, at 33ms per frame][:lighting :performance :run]
[1:59][Determine to optimise the :lighting ray caster, then improve the quality][:optimisation :run]
[3:11][80% frame time (40ms per frame) spent in FullCast()][:lighting :performance :run]
[4:31][Check the :lighting :performance :statistics][:run]
[5:13][Remove all mention of light probes from the :"entity system"][:"data structure" :lighting]
[9:35][Check the :lighting :performance :statistics, with the determination to simplify the full cast][:run]
[12:47][Add a RaysPerProbe DEBUG_VALUE in EndLightingComputation()][:"debug system" :lighting]
[14:18][RaysPerProbe: 72][:lighting :performance :run]
[14:40][Determine to perform 64-ray stratified :sampling][:lighting :run]
[17:25][Set up to make FullCast() light the texels directly][:lighting :research :sampling]
[19:19][Modify FullCast() to load and store back to the texels directly, introducing StoreF32_4X()][:lighting :sampling :simd]
[40:02][Consider welding the texel loading / storing into RayCast()][:lighting :research :sampling]
[40:46][Weld FullCast()'s texel loading / storing into RayCast(), removing raycast_result and TestCast()][:"data structure" :lighting :sampling]
[51:37][The light seems to accumulate infinitely][:lighting :run]
[52:20][Consider relieving RayCast() of computing the normal][:lighting :research :sampling]
[54:41][Try making FullCast() cast rays in known directions][:lighting :sampling]
[57:22][The :lighting accumulates stably][:run :sampling]
[58:10][Introduce GeneratePoissonLightingPattern() and GenerateOctahedralLightingPattern() based on GenerateLightingPattern(), and InterleaveDirections()][:lighting :sampling]
[1:05:15][Plan to generate a blue noise sphere to be evaluated within each tile][:lighting :research :sampling]
[1:07:34][Introduce GeneratePoissonDistribution()][:lighting :sampling]
[1:21:31][Invoke hhsphere 16 16 sphere_test.inl][:admin :lighting :sampling]
[1:23:25][Peek at our :lighting][:run :sampling]
[1:24:23][Fix GenerateOctahedralLightingPattern() to pick from the octahedral map correctly][:lighting :sampling]
[1:24:31][Invoke hhsphere 16 16 handmade_sampling_spheres.inl][:admin :lighting :sampling]
[1:25:35][See no noise reappear][:lighting :run :sampling]
[1:25:49][Double-check GenerateOctahedralLightingPattern() for bugs][:lighting :research :sampling]
[1:26:48][The light has accumulated infinitely][:lighting :run :sampling]
[1:27:04][Make EndLightingComputation() draw the :sampling spheres][:"debug visualisation" :lighting]
[1:31:26][See the submerged :sampling sphere][:"debug visualisation" :lighting :run]
[1:31:37][Make EndLightingComputation() elevate the :sampling spheres][:"debug visualisation" :lighting]
[1:32:02][Admire our 2D :sampling sphere][:"debug visualisation" :lighting :run]
[1:32:28][Fix GenerateOctahedralLightingPattern() to set the Pick before marking the Check as used][:lighting :sampling]
[1:32:52][Invoke hhsphere 16 16 handmade_sampling_spheres.inl][:admin :lighting :sampling]
[1:33:31][Admire our correctly 3D :sampling sphere][:"debug visualisation" :lighting :run]
[1:34:08][Make EndLightingComputation() colourise the :sampling sphere by region][:"debug visualisation" :lighting]
[1:34:34][Admire our coloured :sampling sphere][:"debug visualisation" :lighting :run]
[1:35:01][Toggle off the :sampling sphere drawing in EndLightingComputation()][:"debug visualisation" :lighting]
[1:35:18][75% frame time (30ms per frame) spent in FullCast()][:performance :run :sampling]
[1:36:02][Scour RayCast() and FullCast() for :sampling bugs][:lighting :research]
[1:37:15][Assert in FullCast() that RayBundleIndex <= LIGHT_SAMPLING_RAY_BUNDLES_PER_SPHERE][:lighting :sampling]
[1:37:44][Fail to hit that assertion][:lighting :run :sampling]
[1:37:52][Assert in FullCast() that DirSampleIndex < LIGHT_SAMPLING_SPHERE_COUNT][:lighting :sampling]
[1:38:02][Fail to hit that assertion][:lighting :run :sampling]
[1:38:11][Continue to scour FullCast() and RayCast() for :sampling bugs][:lighting :research]
[1:40:19][Fix RayCast() to correctly set S1 and S2][:lighting :sampling]
[1:40:29][Admire our correct :lighting][:run :sampling]
[1:41:21][Q&A][:speech]
[1:42:04][@thetamiel][Q: When will brogramming return?]
[1:42:41][@mycon_][Q: I don't really use "static" anywhere and I've been fine without it. Am I doing something wrong?][:language]
[1:44:42][@czapa10][Q: Is 3D shear transformation useful in graphics programming for games? How to construct 4x4 shear matrix?][:geometry :mathematics]
[1:46:48][Shear Matrix][:blackboard :geometry :mathematics]
[1:52:38][@czapa10][Q: Yeah, makes sense. Thank you]
[1:52:41][@mattiamanzati][Q: Which kind of light does [~hero Handmade Hero] support? Did I assume right it supports any as long you put light correctly? Maybe moon light can be a planar light put over rooms marked as "outside"][:lighting]
[1:53:45][@xxthebigfoxx][Q: Can you check how much slower the build is if you define internal to nothing?]
[1:54:06][4.887 seconds -O2 build][:admin]
[1:54:23][2.203 seconds -Od build][:admin]
[1:54:56][#define internal to nothing][:language]
[1:55:07][2.360 seconds -Od build, without internal][:admin]
[1:55:22][Remove hhsphere.cpp from the compilation][:language]
[1:55:34][2.000 seconds -Od build, without internal or hhsphere.cpp][:admin]
[1:55:43][#define internal static][:language]
[1:55:51][1.969 seconds -Od build, without hhsphere.cpp][:admin]
[1:56:09][#define internal to nothing][:language]
[1:56:13][2.000 seconds -Od build, without internal or hhsphere.cpp][:admin]
[1:56:23][#define internal static][:language]
[1:56:29][4.375 seconds -O2 build, without hhsphere.cpp][:admin]
[1:56:53][#define internal to nothing][:language]
[1:56:56][4.657 seconds -O2 build, without internal or hhsphere.cpp (with an "unresolved external symbol memcpy" error)][:admin :language]
[1:57:03][Investigate the "unresolved external symbol memcpy" error][:language :research]
[1:58:54][Mark Copy() as static rather than internal][:language]
[1:58:57][Build and still hit that "unresolved external symbol memcpy" error][:admin :language]
[1:59:06][Mark Copy() as internal][:language]
[1:59:42][#define internal static][:language]
[1:59:44][4.390 seconds -O2 build, without hhsphere.cpp][:admin]
[2:00:06][@redine_not_eu][Q: You REM'd something and forgot to unREM it?]
[2:00:44][Wrap it up][:speech]
[/video]
