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

85 lines
6.2 KiB
Plaintext
Raw 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=day559 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Experimenting with Fragment Light Sampling" vod_platform=youtube id=21rMO0e8FXg annotator=Miblo]
[0:00][Plug Molly Rocket's Discord channel[ref
site=Discord
page=MollyRocket
url=https://discord.gg/mollyrocket] and note that the twitch player on the Watch Page[ref
site="Handmade Hero"
page="Watch"
url=https://handmadehero.org/watch] is broken][:speech]
[1:19][Recap and set the stage for the day, initially fixing a bug in assigning light probe indices][:"entity system" :lighting :speech]
[5:07][Hit our assertion in AssignIndices()][:"entity system" :lighting :run]
[9:45][Add a "conditional break point" in AssignIndices() and RemoveIndices() when the LightProbeIndex is 101][:"entity system" :lighting]
[11:59][Break in to AssignIndices() and RemoveIndices() for LightProbeIndex 101][:"entity system" :lighting :run]
[15:58][Scrutinise EnsureRegionIsUnpacked()][:"entity system" :lighting :research]
[16:59][Add an assertion in EnsureRegionIsUnpacked() that LightProbeIndex is 0][:"entity system" :lighting]
[17:13][Break in to AssignIndices() for LightProbeIndex 101, and fail to hit our new assertion in EnsureRegionIsUnpacked()][:"entity system" :lighting :run]
[18:34][Add an assertion in AcquireUnpackedEntitySlot() that LightProbeIndex is 0][:"entity system" :lighting]
[19:26][Break in to AssignIndices() for LightProbeIndex 101, and successfully hit our new assertion in AcquireUnpackedEntitySlot()][:"entity system" :lighting :run]
[20:39][Realise that we never clear the Entity data when removing from unpacked][:"entity system" :lighting :research]
[21:54][Fix EnsureRegionIsUnpacked() to clear stale data when unpacking entities][:"entity system"]
[22:52][Hit our assertion in AcquireUnpackedEntitySlot()][:"entity system" :lighting :run]
[23:12][Remove our assertion from AcquireUnpackedEntitySlot()][:"entity system" :lighting]
[23:29][We have solved that light probe index assigning bug][:"entity system" :lighting :run]
[23:49][Make UpdateAndRenderEntities() colour the light probes by their index][:"debug visualisation" :lighting]
[24:29][Our light probes remain stably indexed][:"entity system" :lighting :run]
[26:01][Storing light probe positions][:"entity system" :lighting :research]
[28:04][Augment game_render_commands with a LightProbePosition buffer, introducing SetLightProbePosition() for UpdateAndRenderEntities() to call][:"data structure" :"entity system" :lighting]
[32:30][Implement SetLightProbePosition()][:"entity system" :lighting]
[38:00][Wonder if we should treat light probes as points and directions, rather than cubes][:lighting :speech]
[38:38][Introduce light_probe_irradiance for game_render_commands and open_gl to contain][:"data structure" :lighting]
[40:11][Consider converting the light_probe_spatial_index to use our voxel][:"data structure" :lighting :research]
[41:13][Crash in SetLightProbePosition()][:lighting :run]
[41:30][Augment open_gl with a LightProbePosition array for OpenGLBeginFrame() to populate][:"data structure" :lighting]
[42:38][Our SetLightProbePosition() crash is fixed][:lighting :run]
[43:30][:Sampling light probes][:lighting :research]
[51:46][Enable :lighting in CompileZBiasProgram()][:sampling]
[53:20][Calculate our light probe bandwidth requirements (22 GB/sec)[ref
site=Wikipedia
page="List of Nvidia graphics processing units"
url=https://en.wikipedia.org/wiki/List_of_Nvidia_graphics_processing_units]][:lighting :research :sampling]
[58:45][Note that we only need to sample one face of a light probe, requiring 3 GB/sec][:lighting :research :sampling]
[1:02:37][Consider :sampling our light probes as a 2D texture: light probe count × direction][:lighting :research]
[1:03:53][Consider :sampling our light probes as a cube map[ref
site="Khronos Wiki"
page="Cubemap Texture"
url=https://www.khronos.org/opengl/wiki/Cubemap_Texture][ref
site="Khronos Wiki"
page="Sampler (GLSL)"
url=https://www.khronos.org/opengl/wiki/Sampler_(GLSL)][ref
site="OpenGL Registry"
page="The OpenGL Shading Language 1.50 Quick Reference Card"
url=https://www.khronos.org/files/opengl-quick-reference-card.pdf]][:lighting :research]
[1:07:47][Make CompileZBiasProgram() sample the light probes as a 2D texture[ref
site="OpenGL Registry"
page="The OpenGL Shading Language 1.50 Quick Reference Card"
url=https://www.khronos.org/files/opengl-quick-reference-card.pdf]][:lighting :sampling]
[1:37:07][Consider instead :sampling our light probes as a cube map[ref
site="Khronos Wiki"
page="Cubemap Texture"
url=https://www.khronos.org/opengl/wiki/Cubemap_Texture][ref
site="OpenGL Hardware Database"
url=https://opengl.gpuinfo.org/]][:lighting :research]
[1:42:23][Begin to prepare CompileZBiasProgram() to sample our light probes as a cube map][:lighting :sampling]
[1:43:21][Continue to consider :sampling our light probes as a cube map[ref
site="Khronos Wiki"
page="Cubemap Texture"
url=https://www.khronos.org/opengl/wiki/Cubemap_Texture][ref
site="OpenGL Registry"
page="The OpenGL Shading Language 1.50 Quick Reference Card"
url=https://www.khronos.org/files/opengl-quick-reference-card.pdf][ref
site="OpenGL Registry"
page="The OpenGL Shading Language 4.40 Quick Reference Card"
url=https://www.khronos.org/files/opengl44-quick-reference-card.pdf]][:lighting :research]
[1:48:25][:Lighting Atlas][:blackboard :sampling]
[1:52:29][Blending the eight octants of a cube][:blackboard :lighting :sampling]
[1:57:15][Disable :lighting in CompileZBiasProgram()][:sampling]
[1:57:32][One last view of the game][:run]
[1:57:41][Q&A][:speech]
[1:58:13][@Longboolean][@cmuratori Would you want to do a debug ~Milton stream?]
[1:59:30][@derpzerker][Q: Does this still work on XP?][:"operating system"]
[2:01:01][@Nick12][Q: If you had to draw text in Arabic, Chinese, Korean, etc in a game, how would you do text shaping?][:font]
[2:02:12][@xxthebigfoxx][Q: Would it make sense to store the whole cube of voxels as six 3D textures, one for each direction, and then use hardware trilinear filtering?][:lighting :sampling]
[2:04:32][@4bitlightning][Q: Would you overestimate side F on the cube map?][:lighting :sampling]
[2:05:28][Wind it down][:speech]
[/video]