[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Push Buffer Rendering" vod_platform=youtube id=zbufcZ_JBbU annotator=Miblo annotator=dspecht annotator=ZedZull] [0:37][Investigate possible bug in the collision detector] [3:02][Pass TestP to SpeculativeCollide and also base MoverGroundPoint off TestP] [3:27][Make a version of GetEntityGroundPoint that takes ForEntityP] [4:36][Walk around in-game] [5:00][Put the stairs back in and try colliding with them] [5:59][Increase GroundBufferCount from 32 to 64] [7:02][Think about sorting entities in a render list and scaling bitmaps] [8:48][Look at the TODO list] [9:31][Create handmade_render_group.h] [9:53][Consider sorting and translating the coordinate systems] [10:53][Take a look at how the buffering currently works] [11:22][Pull out entity_visible_piece and entity_visible_piece_group into handmade_render_group.h] [12:23][#include handmade_render_group.h and handmade_render_group.cpp in handmade.cpp] [12:50][Expand the notion of the PieceGroup so that it tracks everything] [14:31][Move the rendering outside] [15:35][Now all the pieces are in one giant buffer, and we have no idea which one goes with which entity] [16:07][Introduce render_basis] [17:06][Enable setting the render_basis after moving the entities around] [20:16][Set the DefaultBasis and point to it] [21:48][View the results in-game] [23:15][Move PieceGroup up and give it its own memory] [24:40][Change all of the draw calls to operate off the PieceGroup] [26:19][Check it out in-game] [26:39][The inversion and scaling is all still happening erroneously] [27:19][Look at what the Push functions are doing] [28:05][Try and regularise how the rendering works] [29:40][See how it looks in-game] [30:16][Investigate why the Bitmaps aren't being drawn in the correct places] [35:00][It's drawing the same Bitmap] [35:21][Moment of realisation: Rather than sending the whole loaded_bitmap down, we were using one on the stack] [36:32][Consider ways to pass the correct Bitmaps] [37:13][Send the whole Bitmap to ground_buffer] [38:55][See if that fixes our problem] [39:40][Get rid of that other DrawRectangle call] [40:31][Rename entity_visible_piece_group to render_group] [41:17][Consider how we want to extend the notion of render_group so that you can have multiple things pushed onto this render stack] [41:56][Consider linked list vs packed set] [42:43][Add PushBufferBase, PushBufferSize and MaxPushBufferSize to render_group] [43:52][Introduce AllocateRenderGroup in handmade_render_group.cpp] [45:18][#define PushSize macro] [45:40][Allocate MaxPushBufferSize and store it in PushBufferBase] [45:55][Initialise all of the fields of the render_group] [46:16][Call AllocateRenderGroup and set MaxPushBufferSize to 4MB] [46:52][Make the DefaultBasis get allocated and initialise it] [47:21][Store MetersToPixels rather than GameState and pass it to AllocateRenderGroup] [48:06][Initialise MaxPushBufferSize and PushBufferSize] [48:36][Now we've got a problem: When we do PushPiece we can't get one because we don't know where that piece is anymore] [48:44][Attend to the other issues] [50:11][Straighten out the PushBuffer situation] [54:07][See if it works in-game] [54:46][Blackboard: PieceGroup] [56:23][Blackboard: Compression Oriented Programming] [56:57][Blackboard: render_group] [58:19][Q&A][:speech] [59:16][@miblo][Will things like filters end up in the render_group?] [1:00:55][@cezonezor][How long will the renderer take?] [1:02:29][@poohshoes][Could you give us examples of what some of the simpler things will be in the render_group?] [1:02:47][@gplwhite][Are there any static code analysis tools for C / Visual Studio that will help pick up bugs like unused variables, etc?] [1:04:38][@d7samurai][So are you planning on abstracting away the renderer as a layer, similar to how we separated the platform from the game code, so that the various renderers will be operating on the same data structures?] [1:05:48][@ezioauditorerevs][If you were going to write an algorithm to generate Sudoku puzzles, how would it work?] [1:06:03][@mr4thdimention][Unused variables are a warning on my compiler. Did you turn that warning off? I use an allow local macro when I want it to ignore the variable] [1:06:56][@jfcatalan][Would it make sense for the render_group to contain render groups itself?] [1:07:44][@d7samurai][I meant whether you plan for the data describing what needs to be rendered to be in a format such that it's suitable for both software and hardware rendering] [1:08:45][@boondoggle42][Will our hero always be taller than the treetops?] [1:09:58][We've finished early... or have we?] [1:10:19][@abnercoimbre][Are we keeping the 5PM schedule?] [1:12:06][Wrap it up with a recap and closing remarks][:speech] [/video]