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

97 lines
9.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[video output=day569 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Raycasting from Light Probe Locations" vod_platform=youtube id=rE3RPBA7UvI annotator=Miblo]
[0:02][Recap and set the stage for the day][:speech]
[0:44][Demo the current state of our test ray casting from voxel centres, with the determination to cast rays from light probe locations][:lighting :run]
[4:28][Prepare to switch over to raycasting from light probe locations][:lighting :research]
[7:32][Introduce Frumbledygok() to contain the voxel-centre casting code from EndLightingComputation()][:lighting]
[8:47][Begin to develop the light probe-based ray casting][:lighting]
[11:33][A few words on programmable light falloff vs real life inverse-square falloff][:lighting :speech]
[14:07][Continue to develop the light probe-based ray casting, introducing TestCastFromProbes()][:lighting]
[20:58][Introduce GetVoxelIndex() to find which voxel a point in world space corresponds to][:lighting]
[25:38][Introduce GetVoxelCenterP()][:lighting]
[27:34][Make TestCastFromProbes() call our new GetVoxelIndex() and GetVoxelCenterP()][:lighting]
[29:28][Check out our initial light probe-based ray cast :lighting][:run]
[30:46][Toggle on IsTestCast in TestCastFromProbes()][:"debug visualisation" :lighting]
[31:37][See unexpected rays][:"debug visualisation" :run]
[32:16][Disable :lighting in CompileZBiasProgram()]
[32:28][Check out our rays in a shadowless world][:"debug visualisation" :lighting :run]
[33:00][Fix the HitP computation in TestCastFromProbes()][:lighting]
[33:36][Check out our correct rays in a shadowless world][:"debug visualisation" :lighting :run]
[34:44][Consider working on our voxel fill][:lighting :research]
[36:50][Introduce PushDebugBox() for RayCast() to call][:"debug visualisation" :lighting]
[39:00][Make TestCastFromProbes() draw the voxels hit by the rays][:"debug visualisation" :lighting]
[41:38][Check out our hit voxels, finding that we seem to overflow our DebugLines in lighting_solution][:"debug visualisation" :lighting :programming :run]
[43:19][The [@Molly puss] arrives][:speech]
[43:59][Hit our assertion in PushDebugLine() and investigate why][:"debug visualisation" :lighting :run]
[45:39][Increase the DebugLines array in lighting_solution from 4096 to 65536][:"data structure"]
[46:04][Check out our supposed 4096 lines][:"debug visualisation" :lighting :run]
[47:14][Step through TestCastFromProbes() to see multiple light probes set identically][:"debug visualisation" :lighting :run]
[48:45][Replace the SetLightProbePosition() call in UpdateAndRenderEntities() with a newly introduced PushLightProbe(), to prevent multiple light probes in the same location][:lighting]
[51:06][Check out our hit voxels][:"debug visualisation" :lighting :run]
[52:26][Shrink the voxel :"debug visualisation" in TestCastFromProbes()][:lighting]
[53:01][Check out our hit voxels, and determine to fill a swathe of nine voxels][:"debug visualisation" :lighting :run]
[54:35][@Molly][Meow]
[56:41][Introduce SpamVoxel() to flood our light computation into blocks of nine voxels, and a utility InLargeVoxel()][:lighting]
[1:03:17][Check out our flood filled voxels][:"debug visualisation" :lighting :run]
[1:03:37][Prevent CompileZBiasProgram() from disabling the :lighting]
[1:04:05][Check out our beautiful :lighting][:run]
[1:04:52][Make UpdateAndRenderEntities() position our light source nearer the ground][:lighting]
[1:05:20][Find that our light source still lights the area beyond a wall][:lighting :run]
[1:05:55][Disable :lighting in CompileZBiasProgram()]
[1:06:11][Note that our flood filling does not propagate through the wall at the starting location][:lighting :run]
[1:06:49][Prevent CompileZBiasProgram() from disabling the :lighting]
[1:07:14][Increase the radius of our test casting :"debug visualisation" in TestCastFromProbes()][:lighting]
[1:08:02][See our flood filling propagate through that wall at the starting location][:lighting :run]
[1:08:14][Only make TestCastFromProbes() perform the flood fill if our ray did not hit][:lighting]
[1:08:36][Find that we light slightly erroneously, because we aren't clearing voxels][:lighting :run]
[1:09:24][Decrease the radius of our test casting :"debug visualisation" in TestCastFromProbes()][:lighting]
[1:09:45][Make TestCastFromProbes() clear the voxels each frame][:lighting]
[1:11:02][Check out our :lighting][:run]
[1:11:45][Make UpdateAndRenderEntities() position our light source still nearer the ground][:lighting]
[1:12:33][Admire our fog-of-war :lighting][:run]
[1:12:49][Decrease the light falloff time (thus increasing our light radius) in SpamVoxel()][:lighting]
[1:13:12][Admire our more farsighted fog-of-war :lighting][:run]
[1:13:41][Disable IsTestCast in TestCastFromProbes()][:lighting]
[1:14:05][Admire our fog-of-war :lighting without voxel :"debug visualisation"][:run]
[1:15:04][Make UpdateAndRenderWorld() position the light source relative to GroundP][:lighting]
[1:15:34][Admire our more stable light, with the determination to handle blending and convection][:lighting :run]
[1:18:15][Q&A][:speech]
[1:19:22][@sahfortv][Q: Isn't there an hour left?]
[1:19:53][@sneakybob_wot][Q: would the :"particle system" you had (heads popping out) be affected by the shadows at the moment?]
[1:20:09][Check out the :lighting on the particles][:run]
[1:22:17][Disable Global_Lighting_ShowProbes][:lighting]
[1:22:25][Check out our cleanly lit world][:lighting :run]
[1:23:44][@vaualbus][Q: Can we enable light for the debug interface so we see the impact of the code?][:lighting :"debug system"]
[1:24:10][@tootac][Q: Are you procrastinating on doing gameplay code and inventing problems to solve? Last time I checked (\~3 months ago) you were saying you are about to start gameplay code in a couple of streams]
[1:24:56][Admire our :lighting][:run]
[1:25:39][@polijn][Just give the game code as an assignment to [@naysayer88 Jon]. Last I heard he had time to spare]
[1:25:54][@ankut][Q: Why are the debug lines a fixed sized buffer? Just 'cause it's throwaway code?][:memory]
[1:26:43][@dithinas][Q: Do you have any thoughts on the trade-offs of making your data structures directly serializable versus having intermediate serialize / deserialize steps, i.e. data structures containing pointers being converted to offsets or indices][:"data structure"]
[1:28:17][@0lpbm][Q: Are the bounces going to be computed also with the raytracer?][:lighting]
[1:29:19][Increase tCloseEnough in RayCast()][:lighting]
[1:29:42][Determine the tCloseEnough filtering to be garbage][:lighting :run]
[1:30:33][@vaualbus][Q: Can we add for a test a second bounce or it require more work?][:lighting]
[1:31:18][Temporarily make TestCastFromProbes() bounce our rays once][:lighting]
[1:34:50][Check out our hacked secondary bouncing of the ray cast :lighting][:run]
[1:36:16][Delete the secondary bounce code from TestCastFromProbes()][:lighting]
[1:36:43][Check we didn't screw anything up there][:lighting :run]
[1:37:04][@stevenlr][Q: Do you plan on adding details on how sprites are lit? Right now they are full dark when the light is behind it. Maybe normal maps or some subsurface transport? Although I guess bounces will help with that anyway][:lighting]
[1:37:45][@qiaoster][Q: It's my second year programming and it feels like there's endless stuff to catch up before I can be a competent games programmer. What might I do to help with that?]
[1:39:12][@vaualbus][Q: It should be SecCast not Cast?][:lighting]
[1:39:21][Reintroduce and fix the secondary bounce code in TestCastFromProbes()][:lighting]
[1:39:45][Check out our hacked secondary bouncing of the ray cast :lighting][:run]
[1:41:01][Make SpamVoxel() take the LightP and LightC for secondary bounces to compute specially, dimming the light][:lighting]
[1:43:42][Check out our dimmed secondary bouncing of the ray cast :lighting][:run]
[1:44:41][@nickito97][Q: How are you going to handle bouncing off of different materials?][:lighting]
[1:45:29][@timetravel1][Q: Which type of engine programming do you think the industry needs the most? Does it need more graphics programmers, or physics, or sound programmers for example?]
[1:47:43][@timetravel1][So the answer is "everything everywhere yes"]
[1:48:22][@iof_bastion][Q: Are engine programmers really as in-demand as you say? I see that most AAA games are releasing with hundreds of employees but only like 46 engine programmers]
[1:49:58][@qiaoster][Q: How much do game studios hire interns? Trying to find something for next year]
[1:50:44][@binarytoshokan][Q: Following with the theme, what would you define as the minimum requirements to be a good engine programmer?]
[1:53:57][@an0nymal][Q: Why aren't most studios willing to compensate appropriately in spite of the seemingly short supply of graphics programmers?]
[1:54:57][@centhusiast][Q: Have you heard about Valve's ACO Mesa shader compiler for AMD GPU? Apparently it is replacing LLVM and it is a great thing for Linux gaming]
[1:55:24][@an0nymal][Q: Relative to other positions on the team that may not require as extensive knowledge]
[1:57:23][@centhusiast][Q: Have you heard about Valve's ACO Mesa shader compiler for AMD GPU? Apparently it is replacing LLVM and it is a great thing for Linux gaming]
[1:58:17][@an0nymal][Q: Well, as a specific example, take Bethesda: They pay gameplay programmers 80110k, but the graphics / engine programmer is 90130k. Obviously, those numbers are from pay scale, glass door, etc, but most likely represent a decent sample size]
[2:01:28][Wrap it up][:speech]
[/video]