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

58 lines
4.8 KiB
Plaintext

[video output=day366 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Adding Cubes to the Renderer" vod_platform=youtube id=W5tnnhe8TK4 annotator=Miblo]
[0:08][Recap and set the stage for the day]
[1:28][Run the game to demo the trees always facing the camera]
[5:13][Blackboard: Camera-Facing Cards]
[9:37][Blackboard: Talking about X/Y planes in camera space]
[11:06][handmade_render_group.cpp: Show the PushBitmap() code which maps the world space positions into camera space]
[12:01][Run the game to demo the camera tilt, and consider sorting and the concept of a debug camera]
[15:17][handmade_render_group.h: Introduce camera_transform_flag to aid implementing a debug camera]
[17:43][handmade_world_mode.cpp: Enable UpdateAndRenderWorld() to call SetCameraTransform() twice with different arguments]
[23:53][Run the game to try toggling between the two cameras, and consider how to handle sprite cards intersecting]
[33:28][Blackboard: Introducing a cube primitive]
[38:23][handmade_render_group.h: Introduce render_entry_cube struct]
[41:11][handmade_render_group.cpp: Introduce PushCube() and remove RendersInBackground]
[46:59][Run the game and see that nothing has happened]
[49:05][Investigate where we're placing the hero, and why tweaking the P.Offset_.z causes it to fail]
[56:33][Determine that we're not doing the room sizing stuff correctly]
[58:49][handmade_entity.cpp: Enable UpdateAndRenderEntities() to call PushCube() for the traversables]
[1:05:43][handmade_world_mode.cpp: Introduce an AddPiece() that takes a Height and translates it to a V2]
[1:06:53][handmade_world_mode.cpp: Make AddStandardRoom() call AddPiece() for the traversables]
[1:11:26][handmade_opengl.cpp: Enable OpenGLRenderCommands() to handle the cube case]
[1:13:22][Blackboard: Mr. Cube]
[1:16:29][handmade_opengl.cpp: Enumerate the eight faces for the cube]
[1:19:50][Blackboard: Specifying the points for triangles in a counter-clockwise fashion]
[1:21:19][handmade_opengl.cpp: Introduce GLQuad()]
[1:23:21][Blackboard: Winding, and backface culling]
[1:26:09][handmade_opengl.cpp: Specify the eight faces of the cube for OpenGLRenderCommands() to pass to GLQuad()]
[1:33:41][handmade_opengl.cpp: Enable OpenGLRenderCommands() to generate the cube points]
[1:36:12][Run the game to see our first cube]
[1:36:48][handmade_entity.cpp: Make UpdateAndRenderEntities() pass the offset to PushCube() and run the game to see all the cubes]
[1:39:31][handmade_world_mode.cpp: Make AddStandardRoom() reduce the variance of the traversable position offsets and run the game to check it out]
[1:41:01][handmade_opengl.cpp: Set the cubes' colour to white, give them a texture and run the game to check it out]
[1:43:40][Demo the case in which a tree and a cube interpenetrate and Z-fight, and consider how to combat this]
[1:47:51][handmade_render_group.cpp: Re-enable PushBitmap() to perform shearing, and run the game]
[1:50:05][Q&A][:speech]
[1:51:25][@macielda][Any particular reason for using counter clockwise for front faces (as opposed to clockwise)?]
[1:52:00][Blackboard: Coordinate system right-handedness and counter-clockwise winding]
[1:56:23][@thesizik][A debug camera pan control might be a good idea]
[1:56:35][@coreactivities][Why have everything slightly tilted? Wouldn't it make more sense to sort the assets according to their bottom or, if you're using 3D space, go for an orthogonal camera and using the Z position for sorting?]
[1:57:09][Run the game to demo the visual interest of the tilting[ref
site="Molly Rocket"
page="Handmade Hero Art Progress"
url="https://mollyrocket.com/news_0040.html"]]
[2:01:28][Recommend Andrew Russell's blog on the sorting in River City Ransom[ref
site="Andrew Russell"
page="How 2.5D Sorting Works in River City Ransom: Underground"
url="http://andrewrussell.net/2016/06/how-2-5d-sorting-works-in-river-city-ransom-underground"]]
[2:06:41][@macielda][I noticed the camera in Handmade Hero is defined by Camera X, Y, Z and P. Can I get X, Y and Z from a Quaternion? Is that a good idea? I mean, if you had Quaternions on Handmade Hero would you define the camera using a Quaternion and P?]
[2:08:18][@macielda][What is the 'x' in b32x and u32x?]
[2:08:41][Blackboard: "Exactly n bits" vs "At least n bits"]
[2:13:47][@jezzi23][How much time and effort do you spend preparing for each episode (e.g. what you're going to do, and which problems you foresee running into)? Or is it just the years of experience that allow you to do this without preparation?]
[2:14:28][@macielda][Why b32x and not b1x or b8x? (I really don't know)]
[2:15:46][@dudeinbasement1][Q: Can you do cubic splines sometime?[ref
site="YouTube"
page="Witness Wednesday Part 10 - Interpolation"
url="https://www.youtube.com/watch?v=S2fz4BS2J3Y"]]
[2:17:00][Close it down][:speech]
[/video]