Basic Dynamic Quad Output Optimizations
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:00Plug Molly Rocket's Discord channel1
🗩
0:00Plug Molly Rocket's Discord channel1
🗩
0:00Plug Molly Rocket's Discord channel1
🗩
2:03Recap our multisampling improvements
🗩
2:03Recap our multisampling improvements
🗩
2:03Recap our multisampling improvements
🗩
4:11A few words on deferred rendering
🗩
4:11A few words on deferred rendering
🗩
4:11A few words on deferred rendering
🗩
7:10Lessening the bandwidth requirements of the lighting
🗩
7:10Lessening the bandwidth requirements of the lighting
🗩
7:10Lessening the bandwidth requirements of the lighting
🗩
8:38Determine to optimise our ground cover output
🗩
8:38Determine to optimise our ground cover output
🗩
8:38Determine to optimise our ground cover output
🗩
9:39Check out our time per frame: 10ms
🏃
9:39Check out our time per frame: 10ms
🏃
9:39Check out our time per frame: 10ms
🏃
11:16Reacquaint ourselves with DrawGroundCover()
📖
11:16Reacquaint ourselves with DrawGroundCover()
📖
11:16Reacquaint ourselves with DrawGroundCover()
📖
12:17Enable DrawGroundCover()
12:17Enable DrawGroundCover()
12:17Enable DrawGroundCover()
12:24RenderGroundCover took 0.3%, and now takes 17% of our frame time
🏃
12:24RenderGroundCover took 0.3%, and now takes 17% of our frame time
🏃
12:24RenderGroundCover took 0.3%, and now takes 17% of our frame time
🏃
13:35Hit our MaxVertexCount assertion
🏃
13:35Hit our MaxVertexCount assertion
🏃
13:35Hit our MaxVertexCount assertion
🏃
14:05Increase MaxQuadCountPerFrame fourfold
14:05Increase MaxQuadCountPerFrame fourfold
14:05Increase MaxQuadCountPerFrame fourfold
14:52Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
14:52Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
14:52Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
16:22Remove entity timing blocks
16:22Remove entity timing blocks
16:22Remove entity timing blocks
17:12Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
17:12Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
17:12Again consult the Frames breakdown and hit our MaxVertexCount assertion
🏃
18:50Investigate why we are hitting the MaxVertexCount
🏃
18:50Investigate why we are hitting the MaxVertexCount
🏃
18:50Investigate why we are hitting the MaxVertexCount
🏃
20:24Stop GetBestMatchAssetFrom() being a TIMED_FUNCTION
20:24Stop GetBestMatchAssetFrom() being a TIMED_FUNCTION
20:24Stop GetBestMatchAssetFrom() being a TIMED_FUNCTION
21:40Consult the Frames breakdown without hitting our MaxVertexCount assertion
🏃
21:40Consult the Frames breakdown without hitting our MaxVertexCount assertion
🏃
21:40Consult the Frames breakdown without hitting our MaxVertexCount assertion
🏃
22:26Rather than timing UpdateAndRenderEntities() entirely, just time DrawGroundCover
22:26Rather than timing UpdateAndRenderEntities() entirely, just time DrawGroundCover
22:26Rather than timing UpdateAndRenderEntities() entirely, just time DrawGroundCover
24:18DrawGroundCover takes 26% of our frame time
🏃
24:18DrawGroundCover takes 26% of our frame time
🏃
24:18DrawGroundCover takes 26% of our frame time
🏃
24:52Capture a frame to see that the GPU is not struggling to render our ground cover
🏃
24:52Capture a frame to see that the GPU is not struggling to render our ground cover
🏃
24:52Capture a frame to see that the GPU is not struggling to render our ground cover
🏃
26:33Plan to time DrawGroundCover(), and maybe cache PushQuad()
📖
26:33Plan to time DrawGroundCover(), and maybe cache PushQuad()
📖
26:33Plan to time DrawGroundCover(), and maybe cache PushQuad()
📖
29:34Time the "Computation" code in DrawGroundCover()
29:34Time the "Computation" code in DrawGroundCover()
29:34Time the "Computation" code in DrawGroundCover()
30:40DrawGroundCover takes 4% and the Computation takes 19% of our frame time
🏃
30:40DrawGroundCover takes 4% and the Computation takes 19% of our frame time
🏃
30:40DrawGroundCover takes 4% and the Computation takes 19% of our frame time
🏃
31:31Endeavour to speed up our DrawGroundCover Computation, using caching
📖
31:31Endeavour to speed up our DrawGroundCover Computation, using caching
📖
31:31Endeavour to speed up our DrawGroundCover Computation, using caching
📖
36:32Rework ground_cover to facilitate faster ground cover generation
36:32Rework ground_cover to facilitate faster ground cover generation
36:32Rework ground_cover to facilitate faster ground cover generation
39:55Enable DrawGroundCover() to operate on cached quads, calling OutputQuads()
39:55Enable DrawGroundCover() to operate on cached quads, calling OutputQuads()
39:55Enable DrawGroundCover() to operate on cached quads, calling OutputQuads()
45:41The freeness of the CPU moving a value into a destination + offset vs incrementing the destination itself
🗩
45:41The freeness of the CPU moving a value into a destination + offset vs incrementing the destination itself
🗩
45:41The freeness of the CPU moving a value into a destination + offset vs incrementing the destination itself
🗩
50:58Make DrawGroundCover() call explicitly indexed VertexOut() and IndexOut()
50:58Make DrawGroundCover() call explicitly indexed VertexOut() and IndexOut()
50:58Make DrawGroundCover() call explicitly indexed VertexOut() and IndexOut()
53:37Make DrawGroundCover() acquire the TextureIndex, and relieve it of getting the bitmap info
53:37Make DrawGroundCover() acquire the TextureIndex, and relieve it of getting the bitmap info
53:37Make DrawGroundCover() acquire the TextureIndex, and relieve it of getting the bitmap info
56:24Make FillUnpackedEntity() get the bitmap info, introducing v4 and v3 versions of FinalizeColor()
56:24Make FillUnpackedEntity() get the bitmap info, introducing v4 and v3 versions of FinalizeColor()
56:24Make FillUnpackedEntity() get the bitmap info, introducing v4 and v3 versions of FinalizeColor()
1:01:54Clean up PushSprite()
1:01:54Clean up PushSprite()
1:01:54Clean up PushSprite()
1:02:15Consider making PushSprite() work with pre-calculated values
📖
1:02:15Consider making PushSprite() work with pre-calculated values
📖
1:02:15Consider making PushSprite() work with pre-calculated values
📖
1:05:11Make FillUnpackedEntity() compute the ground cover's P and UV values previously done by PushSprite() and PushQuad(), introducing GetUVScaleForBitmap(), GetUVScaleForRegularTexture() and GetUVScaleForSpecialTexture()
1:05:11Make FillUnpackedEntity() compute the ground cover's P and UV values previously done by PushSprite() and PushQuad(), introducing GetUVScaleForBitmap(), GetUVScaleForRegularTexture() and GetUVScaleForSpecialTexture()
1:05:11Make FillUnpackedEntity() compute the ground cover's P and UV values previously done by PushSprite() and PushQuad(), introducing GetUVScaleForBitmap(), GetUVScaleForRegularTexture() and GetUVScaleForSpecialTexture()
1:18:27Consider why SpriteValuesForUpright() problematically takes a RenderGroup
📖
1:18:27Consider why SpriteValuesForUpright() problematically takes a RenderGroup
📖
1:18:27Consider why SpriteValuesForUpright() problematically takes a RenderGroup
📖
1:20:21Introduce a version of SpriteValuesForUpright() that takes a WorldUp, CameraUp and XAxisH, instead of a RenderGroup, for FillUnpackedEntity() to call
1:20:21Introduce a version of SpriteValuesForUpright() that takes a WorldUp, CameraUp and XAxisH, instead of a RenderGroup, for FillUnpackedEntity() to call
1:20:21Introduce a version of SpriteValuesForUpright() that takes a WorldUp, CameraUp and XAxisH, instead of a RenderGroup, for FillUnpackedEntity() to call
1:26:00Introduce indexed_vertex_output, OutputQuads(), VertexOut(), QuadIndexOut() and a version of Advance that takes an indexed_vertex_output
1:26:00Introduce indexed_vertex_output, OutputQuads(), VertexOut(), QuadIndexOut() and a version of Advance that takes an indexed_vertex_output
1:26:00Introduce indexed_vertex_output, OutputQuads(), VertexOut(), QuadIndexOut() and a version of Advance that takes an indexed_vertex_output
1:47:30Hit our assertion in the SafeTruncateToU16() call in OutputQuads()
🏃
1:47:30Hit our assertion in the SafeTruncateToU16() call in OutputQuads()
🏃
1:47:30Hit our assertion in the SafeTruncateToU16() call in OutputQuads()
🏃
1:48:09Let OutputQuads() early-out if the VertexCount and IndexCount are both 0
1:48:09Let OutputQuads() early-out if the VertexCount and IndexCount are both 0
1:48:09Let OutputQuads() early-out if the VertexCount and IndexCount are both 0
1:48:52Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:48:52Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:48:52Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:52:44Understanding the batch-fitting check in GetCurrentQuads()
📖
1:52:44Understanding the batch-fitting check in GetCurrentQuads()
📖
1:52:44Understanding the batch-fitting check in GetCurrentQuads()
📖
1:53:56Step in to OutputQuads() to see a QuadCount of 7670, which suggests we should have sunk fewer than 65752 vertices
🏃
1:53:56Step in to OutputQuads() to see a QuadCount of 7670, which suggests we should have sunk fewer than 65752 vertices
🏃
1:53:56Step in to OutputQuads() to see a QuadCount of 7670, which suggests we should have sunk fewer than 65752 vertices
🏃
1:54:51Scrutinise the indexed_vertex_output versions of Advance(), and OutputQuads() and DrawGroundCover()
📖
1:54:51Scrutinise the indexed_vertex_output versions of Advance(), and OutputQuads() and DrawGroundCover()
📖
1:54:51Scrutinise the indexed_vertex_output versions of Advance(), and OutputQuads() and DrawGroundCover()
📖
1:57:33Fix DrawGroundCover() to Advance() by 1 quad
1:57:33Fix DrawGroundCover() to Advance() by 1 quad
1:57:33Fix DrawGroundCover() to Advance() by 1 quad
1:57:49Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:57:49Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:57:49Again hit our assertion in the SafeTruncateToU16() call in OutputQuads(), and investigate why
🏃
1:59:29Step through OutputQuads() successfully for a while, concluding that it and GetCurrentQuads() may not be agreeing
🏃
1:59:29Step through OutputQuads() successfully for a while, concluding that it and GetCurrentQuads() may not be agreeing
🏃
1:59:29Step through OutputQuads() successfully for a while, concluding that it and GetCurrentQuads() may not be agreeing
🏃
2:01:43Fix OutputQuads() to increment the QuadCount
2:01:43Fix OutputQuads() to increment the QuadCount
2:01:43Fix OutputQuads() to increment the QuadCount
2:03:06Find that we are running okay, but not seeing the expected ground cover
🏃
2:03:06Find that we are running okay, but not seeing the expected ground cover
🏃
2:03:06Find that we are running okay, but not seeing the expected ground cover
🏃
2:03:28Step in to DrawGroundCover() and inspect its values
🏃
2:03:28Step in to DrawGroundCover() and inspect its values
🏃
2:03:28Step in to DrawGroundCover() and inspect its values
🏃
2:05:38Fix FillUnpackedEntity() to set the ground cover's correct P values
2:05:38Fix FillUnpackedEntity() to set the ground cover's correct P values
2:05:38Fix FillUnpackedEntity() to set the ground cover's correct P values
2:06:28See our ground cover, just with an incorrect camera up vector
🏃
2:06:28See our ground cover, just with an incorrect camera up vector
🏃
2:06:28See our ground cover, just with an incorrect camera up vector
🏃
2:06:52DrawGroundCover takes 12% of our frame time
🏃
2:06:52DrawGroundCover takes 12% of our frame time
🏃
2:06:52DrawGroundCover takes 12% of our frame time
🏃
2:07:56Step it to UpdateAndRenderWorld() to get the camera's up vector
🏃
2:07:56Step it to UpdateAndRenderWorld() to get the camera's up vector
🏃
2:07:56Step it to UpdateAndRenderWorld() to get the camera's up vector
🏃
2:09:06Fix the DEFAULT_CAMERA_UP
2:09:06Fix the DEFAULT_CAMERA_UP
2:09:06Fix the DEFAULT_CAMERA_UP
2:09:31See that our ground cover is sheared
🏃
2:09:31See that our ground cover is sheared
🏃
2:09:31See that our ground cover is sheared
🏃
2:10:03Try to fix the winding in QuadIndexOut()
2:10:03Try to fix the winding in QuadIndexOut()
2:10:03Try to fix the winding in QuadIndexOut()
2:10:41See that our ground cover remains wrong
🏃
2:10:41See that our ground cover remains wrong
🏃
2:10:41See that our ground cover remains wrong
🏃
2:10:51Scrutinise QuadIndexOut(), and wonder if a P value is wrong
📖
2:10:51Scrutinise QuadIndexOut(), and wonder if a P value is wrong
📖
2:10:51Scrutinise QuadIndexOut(), and wonder if a P value is wrong
📖
2:12:08Fix FillUnpackedEntity() to set the ground cover's correct P[3]
2:12:08Fix FillUnpackedEntity() to set the ground cover's correct P[3]
2:12:08Fix FillUnpackedEntity() to set the ground cover's correct P[3]
2:12:16Admire our more performant ground cover
🏃
2:12:16Admire our more performant ground cover
🏃
2:12:16Admire our more performant ground cover
🏃
2:13:25Q&A2
🗩
2:13:25Q&A2
🗩
2:13:25Q&A2
🗩
2:14:00x13pixels Q: Should OutputQuads() (line ~1078) use a '&&' rather than '||' to check that both vertex / index counts are nonzero?
🗪
2:14:00x13pixels Q: Should OutputQuads() (line ~1078) use a '&&' rather than '||' to check that both vertex / index counts are nonzero?
🗪
2:14:00x13pixels Q: Should OutputQuads() (line ~1078) use a '&&' rather than '||' to check that both vertex / index counts are nonzero?
🗪
2:15:11vaualbus Q: So next step to optimize that is to do instancing rendering for the ground cover?
🗪
2:15:11vaualbus Q: So next step to optimize that is to do instancing rendering for the ground cover?
🗪
2:15:11vaualbus Q: So next step to optimize that is to do instancing rendering for the ground cover?
🗪
2:17:47pragma Q: Maybe it would be easier to do the upright sprite calculaiton in the vertex shader instead?
🗪
2:17:47pragma Q: Maybe it would be easier to do the upright sprite calculaiton in the vertex shader instead?
🗪
2:17:47pragma Q: Maybe it would be easier to do the upright sprite calculaiton in the vertex shader instead?
🗪
2:18:43Ryan Q: Speaking of getting the compiler to output the right instructions, I have been toying with a lower level 'language' (assembly without the friction really). Would love to hear your thoughts (super simple example)3
🗪
2:18:43Ryan Q: Speaking of getting the compiler to output the right instructions, I have been toying with a lower level 'language' (assembly without the friction really). Would love to hear your thoughts (super simple example)3
🗪
2:18:43Ryan Q: Speaking of getting the compiler to output the right instructions, I have been toying with a lower level 'language' (assembly without the friction really). Would love to hear your thoughts (super simple example)3
🗪
2:23:33frostyNinja Q: Do you ever feel like the verbosity of passing around an often-used pointer like game_assets in Handmade Hero is too much hassle or do you find it's more beneficial in the long run over a global?
🗪
2:23:33frostyNinja Q: Do you ever feel like the verbosity of passing around an often-used pointer like game_assets in Handmade Hero is too much hassle or do you find it's more beneficial in the long run over a global?
🗪
2:23:33frostyNinja Q: Do you ever feel like the verbosity of passing around an often-used pointer like game_assets in Handmade Hero is too much hassle or do you find it's more beneficial in the long run over a global?
🗪
2:26:27ssd Q: I think you might have missed pragma's question above? Or maybe I missed the answer?
🗪
2:26:27ssd Q: I think you might have missed pragma's question above? Or maybe I missed the answer?
🗪
2:26:27ssd Q: I think you might have missed pragma's question above? Or maybe I missed the answer?
🗪
2:26:32platin21 Q: How would you go about breakable surfaces, not like in a voxel style?4
🗪
2:26:32platin21 Q: How would you go about breakable surfaces, not like in a voxel style?4
🗪
2:26:32platin21 Q: How would you go about breakable surfaces, not like in a voxel style?4
🗪
2:32:47simpalaxy Q: Early in the series, you said you wanted to try to make your own math functions. Have you gotten around to doing that yet?
🗪
2:32:47simpalaxy Q: Early in the series, you said you wanted to try to make your own math functions. Have you gotten around to doing that yet?
🗪
2:32:47simpalaxy Q: Early in the series, you said you wanted to try to make your own math functions. Have you gotten around to doing that yet?
🗪
2:33:49Wrap it up with a plug of Molly Rocket's Discord channel5 and glimpse into the future of lighting
🗩
2:33:49Wrap it up with a plug of Molly Rocket's Discord channel5 and glimpse into the future of lighting
🗩
2:33:49Wrap it up with a plug of Molly Rocket's Discord channel5 and glimpse into the future of lighting
🗩