[video output=day442 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Getting NSight Working" vod_platform=youtube id=Vodii00nBrA annotator=Miblo]
[0:01][Recap and set the stage for the day][:speech]
[0:25][Note that NVIDIA replied to our crash report from the previous stream to let us know that the crash occurred in wglGetProcAddress() inside the old Graphics Driver][:speech]
[2:18][Gather further information for NVIDIA, to affirm that it crashes on Graphics Driver 391.01][:admin]
[5:10][Perform a clean install of the NVIDIA Graphics Driver 391.01][:admin]
[6:53][A few words on the beauty of coffee as a psychoactive drug][:speech]
[8:32][Reboot and lose audio][:admin]
[10:19][:afk]
[10:37][Return to write: "The NVIDIA installer just popped up and said it "couldn't continue" because "other installers were running"??" and wait, apparently in vain, for the installation to proceed][:speech]
[13:02][Try to uninstall everything NVIDIA related: Nsight / Driver / VS Plugin, and reinstall with palpable excitement][:admin]
[17:27][Request a reminder as to how we got ourselves to a place where "installation" doesn't just mean copying a file onto a drive][:speech]
[17:38][Confirm our NVIDIA Graphics Driver version and enable the mic][:admin]
[17:56][Install NVIDIA Nsight Graphics v1.0][:admin]
[21:09][Launch the game successfully inside Nsight][:run]
[23:19][Explore Nsight, noting the plentiful glDraw*() and glBind*() calls reported in the Events View][:run]
[31:54][@internal_static_void_][@handmade_hero You have to close it in Nsight]
[32:24][@praet_a51][Can someone summarize how the issue was fixed?]
[32:46][Load up the code, :run the game and consider how to wrap up the :lighting][:rendering :statistics]
[42:31][Reacquaint ourselves with our OpenGL code, and specify our goal to recombine a scattered set of :lighting samples to shade our scene][:hardware :rendering :research :statistics]
[47:14][See if there's any liquid][:admin]
[47:26][:afk]
[47:34][Return with liquid and set up our Day number][:admin]
[49:01][@AsafGartner][Q: It's 442]
[49:09][Interpolating :lighting samples across continuous walls][:blackboard :rendering]
[52:28][:Lighting entities like the trees and hero appropriately][:blackboard :rendering]
[55:13][Distributing a fixed network of :lighting points][:blackboard :rendering]
[1:02:17][Consider changing SumLight() to operate on a fixed network on :lighting points][:rendering :research]
[1:03:14][Conceptualising cube :lighting vertices vs points for interpolation purposes][:blackboard :rendering]
[1:07:42][:Run the game to see that we run at \~28ms per frame][:lighting :performance :rendering]
[1:08:42][Prevent LightingTest() from drawing the hemisphere sampling :"debug visualisation"][:lighting :rendering]
[1:09:37][:Run the game to see our expected :performance difference at different zoom levels][:lighting :rendering]
[1:10:24][Make CompileZBiasProgram hard set the LightCount to 4][:hardware :lighting :rendering]
[1:11:20][:Run the game to see a little :performance improvement][:hardware :lighting :rendering]
[1:11:44][Consider regularising CompileZBiasProgram()][:hardware :lighting :rendering :research]
[1:12:37][Packing sampling points in a square chunk of :memory][:blackboard :lighting :rendering]
[1:13:58][Consider how to interpolate square-packed :lighting points in CompileZBiasProgram()][:hardware :rendering :research]
[1:15:47][Sketch out a version of lighting_textures packed as a pair of v3 values][:lighting :rendering]
[1:21:02][Change textured_vertex removing LightCount and Emission and adding UV and LightUV, and propagate the removals][:lighting :rendering]
[1:28:31][:Run the game to see nothing different][:lighting :rendering]
[1:28:47][Introduce FetchAndSum() for SumLight() to call with a view to performing UV-based interpolation][:hardware :lighting :rendering]
[1:33:50][:Run to see no :performance problems][:hardware :lighting :rendering]
[1:34:06][Consider how to change FetchAndSum() to operate on square-packed :lighting points][:rendering :research]
[1:36:00][:Run the game to double-check that we're okay so far][:lighting :rendering]
[1:37:41][Temporarily pack the lighting_textures in a square chunk of :memory for ready fetching][:lighting :rendering]
[1:40:06][Add PackIndex to lighting_point to specify where :lighting samples should be packed][:memory :rendering]
[1:43:11][:Run the game to see the same :performance][:lighting :memory :rendering]
[1:43:34][Pack the lighting_textures in a square chunk of :memory for ready fetching, and propagate this more prescriptive change to OutputLightingTextures() and SplitBox(), considering lofting out the notion of a BaseLightIndex to higher level][:lighting :memory :rendering]
[1:49:15][Revert our recent changes with the determination to figure out how to generate the information as to how :lighting sampling points go together][:rendering]
[1:50:16][Sampling the :lighting as faces][:blackboard :rendering]
[1:51:19][Q&A][:speech]
[1:51:59][@Kknewkles][Q: Hi [@cmuratori Casey]! Can you please remind the good people on the stream 1) why templates are bad, 2) what use cases templates can be considered for, which they are good and bad for 3) and what can they be replaced with even then? (I'm gonna take a gander it's :METAPROGRAMMING)][:language]
[1:52:40][@frostyninja][Q: Has getting Nsight working boosted your morale back and recovered some hope?]
[1:55:01][@frostyninja][Q: or are you still moving to Montana]
[1:55:03][@krismeld][Q: Do you have any plans for doing shadows in the game?][:lighting :rendering]
[1:55:12][:Run the game to show the shadows][:lighting :rendering]
[1:56:01][Show shadowing irrelevance in the good-looking Horizon: Zero Dawn, and photos of the real world][:lighting :rendering :research]
[2:00:36][@longboolean][Q: Is the cause over brightness merely a change in the algorithm makes the light brightness value different or is there an actual bug?][:lighting :rendering]
[2:01:21][@vateferfout][Q: Will sprites be simply flat-lighted, or do you plan to implement something to give them some kind of fake 3D :lighting?][:rendering]
[2:01:36][@lucid_frost][Q: How similar is this :lighting model to something you would find in other game engines?[ref
    author="Sam Martin (Geomerics) and Per Einarsson (DICE)"
    title="A Real-Time Radiosity Architecture for Video Games"
    url="http://advances.realtimerendering.com/s2010/Martin-Einarsson-RadiosityArchitecture(SIGGRAPH%202010%20Advanced%20RealTime%20Rendering%20Course).pdf"]][:rendering]
[2:04:35][@internal_static_void_][Q: Why use Nsight in the application for graphics debugging when you already use Visual Studio for CPU code debugging? Why not just use Nsight in Visual Studio?]
[2:05:57][@internal_static_void_][Q: Have you considered baking shadows?][:lighting :rendering]
[2:06:26][@oaeui][Q: Do you think that the number of small draw calls might be causing GPU occupancy issues? Can't remember if we saw occupancy statistics in Nsight][:lighting :performance :rendering]
[2:07:08][@phobichngarl][Can you show what game looks like now?]
[2:07:18][Show the game][:run]
[2:10:00][@longboolean][Q: Do you plan on having 3D objects for things like gates or doors?][:art]
[2:10:29][Wrap it up with a glimpse into the future of world generation][:"procedural generation" :speech]
[/video]
