Debugging Z Transform and Bias
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next timestamp
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 and Index Controls

a
w
s
d
h j k l


Esc Close menu / unfocus timestamp

Quotes and References Menus and Index

Enter Jump to timestamp

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:12Recap and set the stage for the day
0:12Recap and set the stage for the day
0:12Recap and set the stage for the day
4:26Determine to fix the "glGetString(GL_EXTENSIONS) fails with error GL_INVALID_ENUM issue"1
4:26Determine to fix the "glGetString(GL_EXTENSIONS) fails with error GL_INVALID_ENUM issue"1
4:26Determine to fix the "glGetString(GL_EXTENSIONS) fails with error GL_INVALID_ENUM issue"1
6:28handmade_opengl.cpp: Make OpenGLGetInfo() use glGetIntergerv() and glGetStringi() rather than glGetString()2
6:28handmade_opengl.cpp: Make OpenGLGetInfo() use glGetIntergerv() and glGetStringi() rather than glGetString()2
6:28handmade_opengl.cpp: Make OpenGLGetInfo() use glGetIntergerv() and glGetStringi() rather than glGetString()2
13:26handmade_opengl.cpp: Pull in GL_NUM_EXTENSIONS and glGetStringi() from corearb.h3
13:26handmade_opengl.cpp: Pull in GL_NUM_EXTENSIONS and glGetStringi() from corearb.h3
13:26handmade_opengl.cpp: Pull in GL_NUM_EXTENSIONS and glGetStringi() from corearb.h3
14:54win32_handmade.cpp: Pull in glGetStringi() from corearb.b4
14:54win32_handmade.cpp: Pull in glGetStringi() from corearb.b4
14:54win32_handmade.cpp: Pull in glGetStringi() from corearb.b4
17:18Run the game, step through OpenGLGetInfo() and close that issue
17:18Run the game, step through OpenGLGetInfo() and close that issue
17:18Run the game, step through OpenGLGetInfo() and close that issue
18:25Run the game and consider what we have to do
18:25Run the game and consider what we have to do
18:25Run the game and consider what we have to do
20:16handmade_world_mode.cpp: Make PlayWorld() always make rooms above and below us
20:16handmade_world_mode.cpp: Make PlayWorld() always make rooms above and below us
20:16handmade_world_mode.cpp: Make PlayWorld() always make rooms above and below us
22:40Run the game to see that our zoom isn't working, and investigate why
22:40Run the game to see that our zoom isn't working, and investigate why
22:40Run the game to see that our zoom isn't working, and investigate why
23:16handmade_world_mode.cpp: Make PlayWorld() only make one room
23:16handmade_world_mode.cpp: Make PlayWorld() only make one room
23:16handmade_world_mode.cpp: Make PlayWorld() only make one room
23:58Run the game, try to switch to the debug camera and hit the assert in RecanonicalizeCoord()
23:58Run the game, try to switch to the debug camera and hit the assert in RecanonicalizeCoord()
23:58Run the game, try to switch to the debug camera and hit the assert in RecanonicalizeCoord()
26:26Step through UpdateAndRenderWorld() to see what's going on
26:26Step through UpdateAndRenderWorld() to see what's going on
26:26Step through UpdateAndRenderWorld() to see what's going on
28:54handmade_render_group.cpp: Make Unproject() correctly compute the ProbeZ
28:54handmade_render_group.cpp: Make Unproject() correctly compute the ProbeZ
28:54handmade_render_group.cpp: Make Unproject() correctly compute the ProbeZ
29:58Blackboard: Camera transform matrix
29:58Blackboard: Camera transform matrix
29:58Blackboard: Camera transform matrix
31:31handmade_render_group.cpp: Make Unproject() grab the Z row out of the camera projection matrix
31:31handmade_render_group.cpp: Make Unproject() grab the Z row out of the camera projection matrix
31:31handmade_render_group.cpp: Make Unproject() grab the Z row out of the camera projection matrix
33:26Run the game and step in to Unproject() to inspect the ProbeZ
33:26Run the game and step in to Unproject() to inspect the ProbeZ
33:26Run the game and step in to Unproject() to inspect the ProbeZ
38:00Run the game and step through Unproject() more carefully
38:00Run the game and step through Unproject() more carefully
38:00Run the game and step through Unproject() more carefully
39:45handmade_render_group.cpp: Make Unproject() compute the ProbeZ using the correct CameraZ
39:45handmade_render_group.cpp: Make Unproject() compute the ProbeZ using the correct CameraZ
39:45handmade_render_group.cpp: Make Unproject() compute the ProbeZ using the correct CameraZ
40:31Run the game and step into Unproject() to find that we have a more correct ProbeZ, but a busted ClipZ
40:31Run the game and step into Unproject() to find that we have a more correct ProbeZ, but a busted ClipZ
40:31Run the game and step into Unproject() to find that we have a more correct ProbeZ, but a busted ClipZ
41:46Blackboard: Our combined projection matrix
41:46Blackboard: Our combined projection matrix
41:46Blackboard: Our combined projection matrix
42:44handmade_render_group.cpp: Make Unproject() compute the ProbeZ fully correct
42:44handmade_render_group.cpp: Make Unproject() compute the ProbeZ fully correct
42:44handmade_render_group.cpp: Make Unproject() compute the ProbeZ fully correct
43:04Run the game to see that we get a better ClipZ, just not exactly what we'd expect
43:04Run the game to see that we get a better ClipZ, just not exactly what we'd expect
43:04Run the game to see that we get a better ClipZ, just not exactly what we'd expect
48:28Run the game and step through PerspectiveProjection() to see how it is building the matrix
48:28Run the game and step through PerspectiveProjection() to see how it is building the matrix
48:28Run the game and step through PerspectiveProjection() to see how it is building the matrix
50:31handmade_math.h: Make PerspectiveProjection() perform a full transform in the tests
50:31handmade_math.h: Make PerspectiveProjection() perform a full transform in the tests
50:31handmade_math.h: Make PerspectiveProjection() perform a full transform in the tests
51:31Run the game and step in to PerspectiveProjection() to inspect the results of the tests
51:31Run the game and step in to PerspectiveProjection() to inspect the results of the tests
51:31Run the game and step in to PerspectiveProjection() to inspect the results of the tests
53:14Run the game and step through SetCameraTransform() to see how that is working
53:14Run the game and step through SetCameraTransform() to see how that is working
53:14Run the game and step through SetCameraTransform() to see how that is working
55:00handmade_render_group.h: Introduce render_transform struct, and make render_group contain one each for the game and camera
55:00handmade_render_group.h: Introduce render_transform struct, and make render_group contain one each for the game and camera
55:00handmade_render_group.h: Introduce render_transform struct, and make render_group contain one each for the game and camera
56:03handmade_render_group.cpp: Make the necessary functions take this render_transform
56:03handmade_render_group.cpp: Make the necessary functions take this render_transform
56:03handmade_render_group.cpp: Make the necessary functions take this render_transform
1:03:12handmade_render_group.cpp: Make SetCameraTransform() build the correct transform matrix
1:03:12handmade_render_group.cpp: Make SetCameraTransform() build the correct transform matrix
1:03:12handmade_render_group.cpp: Make SetCameraTransform() build the correct transform matrix
1:06:26Run the game to see that the central debug rectangle is stable, and continue to investigate Unproject()
1:06:26Run the game to see that the central debug rectangle is stable, and continue to investigate Unproject()
1:06:26Run the game to see that the central debug rectangle is stable, and continue to investigate Unproject()
1:11:29handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the near clip plane
1:11:29handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the near clip plane
1:11:29handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the near clip plane
1:13:23Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:13:23Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:13:23Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:15:22handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the far clip plane
1:15:22handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the far clip plane
1:15:22handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() right at the far clip plane
1:15:42Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:15:42Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:15:42Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:16:01handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() at 0.8
1:16:01handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() at 0.8
1:16:01handmade_world_mode.cpp: Force UpdateAndRenderWorld() to call Unproject() at 0.8
1:16:18Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:16:18Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:16:18Run the game and step in to Unproject() to inspect the ProbeZ and ClipZ
1:16:37"It's the inverse-square law kicking our butts"α
1:16:37"It's the inverse-square law kicking our butts"α
1:16:37"It's the inverse-square law kicking our butts"α
1:16:51handmade_math.h: Try to make PerspectiveProjection() move the near clip plane out
1:16:51handmade_math.h: Try to make PerspectiveProjection() move the near clip plane out
1:16:51handmade_math.h: Try to make PerspectiveProjection() move the near clip plane out
1:17:40Run the game and step in to Unproject() to inspect the ClipZ
1:17:40Run the game and step in to Unproject() to inspect the ClipZ
1:17:40Run the game and step in to Unproject() to inspect the ClipZ
1:18:26todo.txt: Fix Z buffer to be better resolution
1:18:26todo.txt: Fix Z buffer to be better resolution
1:18:26todo.txt: Fix Z buffer to be better resolution
1:18:444coder feature request: TODO list formatting
1:18:444coder feature request: TODO list formatting
1:18:444coder feature request: TODO list formatting
1:21:56Consider getting our Z story sorted out and return to debugging the problem with multiple stacked screens
1:21:56Consider getting our Z story sorted out and return to debugging the problem with multiple stacked screens
1:21:56Consider getting our Z story sorted out and return to debugging the problem with multiple stacked screens
1:22:45Run the game to find our camera encased in some degenerate geometry
1:22:45Run the game to find our camera encased in some degenerate geometry
1:22:45Run the game to find our camera encased in some degenerate geometry
1:23:22handmade_world_mode.cpp: Make PlayWorld() set DoorDirection to 2
1:23:22handmade_world_mode.cpp: Make PlayWorld() set DoorDirection to 2
1:23:22handmade_world_mode.cpp: Make PlayWorld() set DoorDirection to 2
1:23:41Run the game and determine that the problem only occurs when the floors are generated to the camera
1:23:41Run the game and determine that the problem only occurs when the floors are generated to the camera
1:23:41Run the game and determine that the problem only occurs when the floors are generated to the camera
1:24:32handmade_render_group.cpp: Make PushBitmap() reduce the ZBias
1:24:32handmade_render_group.cpp: Make PushBitmap() reduce the ZBias
1:24:32handmade_render_group.cpp: Make PushBitmap() reduce the ZBias
1:24:55Run the game, zoom out and determine that our bias is being applied incorrectly
1:24:55Run the game, zoom out and determine that our bias is being applied incorrectly
1:24:55Run the game, zoom out and determine that our bias is being applied incorrectly
1:25:31handmade_opengl.cpp: Investigate how the VertexCode is applying the ZBias
1:25:31handmade_opengl.cpp: Investigate how the VertexCode is applying the ZBias
1:25:31handmade_opengl.cpp: Investigate how the VertexCode is applying the ZBias
1:29:46handmade_opengl.cpp: Try making OpenGLRenderCommands() pass GL_DEPTH_COMPONENT32F to glTexImage2DMultisample()
1:29:46handmade_opengl.cpp: Try making OpenGLRenderCommands() pass GL_DEPTH_COMPONENT32F to glTexImage2DMultisample()
1:29:46handmade_opengl.cpp: Try making OpenGLRenderCommands() pass GL_DEPTH_COMPONENT32F to glTexImage2DMultisample()
1:29:54Run the game to see the same behaviour, and consider it not to be a precision issue
1:29:54Run the game to see the same behaviour, and consider it not to be a precision issue
1:29:54Run the game to see the same behaviour, and consider it not to be a precision issue
1:32:04handmade_opengl.cpp: Try commenting out the ZVertex.z biasing
1:32:04handmade_opengl.cpp: Try commenting out the ZVertex.z biasing
1:32:04handmade_opengl.cpp: Try commenting out the ZVertex.z biasing
1:32:23Run the game to see that all of the stuff seems pretty consistent
1:32:23Run the game to see that all of the stuff seems pretty consistent
1:32:23Run the game to see that all of the stuff seems pretty consistent
1:34:56handmade_world_mode.cpp: Try increasing the far clip plane
1:34:56handmade_world_mode.cpp: Try increasing the far clip plane
1:34:56handmade_world_mode.cpp: Try increasing the far clip plane
1:36:43Run the game and watch the incorrect clipping behaviour
1:36:43Run the game and watch the incorrect clipping behaviour
1:36:43Run the game and watch the incorrect clipping behaviour
1:37:42handmade_math.h: Tweak the near and far clip plane in PerspectiveProjection()
1:37:42handmade_math.h: Tweak the near and far clip plane in PerspectiveProjection()
1:37:42handmade_math.h: Tweak the near and far clip plane in PerspectiveProjection()
1:38:54Try to find a source for the standard projection perspective matrix
1:38:54Try to find a source for the standard projection perspective matrix
1:38:54Try to find a source for the standard projection perspective matrix
1:43:48Run the game to see some projection wonkiness
1:43:48Run the game to see some projection wonkiness
1:43:48Run the game to see some projection wonkiness
1:46:06handmade_render_group.cpp: Try turning off the ZBias in PushBitmap()
1:46:06handmade_render_group.cpp: Try turning off the ZBias in PushBitmap()
1:46:06handmade_render_group.cpp: Try turning off the ZBias in PushBitmap()
1:46:25Run the game to see that everything is sorting as expected
1:46:25Run the game to see that everything is sorting as expected
1:46:25Run the game to see that everything is sorting as expected
1:48:45Consider that the ZBias is pre-transformed and appears to be being applied in clip space
1:48:45Consider that the ZBias is pre-transformed and appears to be being applied in clip space
1:48:45Consider that the ZBias is pre-transformed and appears to be being applied in clip space
1:51:45Moment of realisation: Our ZMaxTransform.z depends on the w value to counter-divide it
1:51:45Moment of realisation: Our ZMaxTransform.z depends on the w value to counter-divide it
1:51:45Moment of realisation: Our ZMaxTransform.z depends on the w value to counter-divide it
1:52:58Blackboard: Computing ClipZ
1:52:58Blackboard: Computing ClipZ
1:52:58Blackboard: Computing ClipZ
1:55:32handmade_opengl.cpp: Make VertexCode compute a ModifiedZ for use in the gl_Position computation
1:55:32handmade_opengl.cpp: Make VertexCode compute a ModifiedZ for use in the gl_Position computation
1:55:32handmade_opengl.cpp: Make VertexCode compute a ModifiedZ for use in the gl_Position computation
1:56:25Run the game to see that that was exactly what we needed, and consider how to handle blocks obscuring other blocks
1:56:25Run the game to see that that was exactly what we needed, and consider how to handle blocks obscuring other blocks
1:56:25Run the game to see that that was exactly what we needed, and consider how to handle blocks obscuring other blocks
2:01:04Blackboard: How the sprites are being generated aligned with the camera
2:01:04Blackboard: How the sprites are being generated aligned with the camera
2:01:04Blackboard: How the sprites are being generated aligned with the camera
2:02:02handmade_render_group.cpp: Enable PushBitmap() to draw the Upright sprites actually standing upright
2:02:02handmade_render_group.cpp: Enable PushBitmap() to draw the Upright sprites actually standing upright
2:02:02handmade_render_group.cpp: Enable PushBitmap() to draw the Upright sprites actually standing upright
2:03:02Run the game to see what that looks like
2:03:02Run the game to see what that looks like
2:03:02Run the game to see what that looks like
2:04:07handmade_render_group.cpp: Play with how PushBitmap() combines the upright and camera-facing styles
2:04:07handmade_render_group.cpp: Play with how PushBitmap() combines the upright and camera-facing styles
2:04:07handmade_render_group.cpp: Play with how PushBitmap() combines the upright and camera-facing styles
2:07:10Run the game to admire our trees
2:07:10Run the game to admire our trees
2:07:10Run the game to admire our trees
2:09:17Q&A
🗩
2:09:17Q&A
🗩
2:09:17Q&A
🗩
2:10:22charlemaynemtg I am a fairly amateur programmer. I have dabbled in Java, flavors of C, Python, and Ruby while I was in university. My question is, how would you suggest with progressing your proficiency in a particular language? Is it best to follow tutorials?
🗪
2:10:22charlemaynemtg I am a fairly amateur programmer. I have dabbled in Java, flavors of C, Python, and Ruby while I was in university. My question is, how would you suggest with progressing your proficiency in a particular language? Is it best to follow tutorials?
🗪
2:10:22charlemaynemtg I am a fairly amateur programmer. I have dabbled in Java, flavors of C, Python, and Ruby while I was in university. My question is, how would you suggest with progressing your proficiency in a particular language? Is it best to follow tutorials?
🗪
2:15:47hej1993 What is Z transform?
🗪
2:15:47hej1993 What is Z transform?
🗪
2:15:47hej1993 What is Z transform?
🗪
2:17:52macielda How many draw calls with the profiler open?
🗪
2:17:52macielda How many draw calls with the profiler open?
🗪
2:17:52macielda How many draw calls with the profiler open?
🗪
2:18:08abarishu A few streams ago you showed a function that tells OpenGL to call us back with messages. Do you think it can help debug OpenGL issues instead of sticking glGetError after every call?
🗪
2:18:08abarishu A few streams ago you showed a function that tells OpenGL to call us back with messages. Do you think it can help debug OpenGL issues instead of sticking glGetError after every call?
🗪
2:18:08abarishu A few streams ago you showed a function that tells OpenGL to call us back with messages. Do you think it can help debug OpenGL issues instead of sticking glGetError after every call?
🗪
2:19:13areriff When the new assets gonna be ready?
🗪
2:19:13areriff When the new assets gonna be ready?
🗪
2:19:13areriff When the new assets gonna be ready?
🗪
2:19:35hholst80 Scenario is that Handmade Hero is expanding to three programmers and two need to understand the architecture you have designed. How would you recommend that they get into the code and understand the architecture? What would you need to do to prepare the system for such a scenario?
🗪
2:19:35hholst80 Scenario is that Handmade Hero is expanding to three programmers and two need to understand the architecture you have designed. How would you recommend that they get into the code and understand the architecture? What would you need to do to prepare the system for such a scenario?
🗪
2:19:35hholst80 Scenario is that Handmade Hero is expanding to three programmers and two need to understand the architecture you have designed. How would you recommend that they get into the code and understand the architecture? What would you need to do to prepare the system for such a scenario?
🗪
2:25:09ronpaulvevo I know you don't really like OOP design, but can you provide some ways you might take advantage of OOP design in Handmade Hero?
🗪
2:25:09ronpaulvevo I know you don't really like OOP design, but can you provide some ways you might take advantage of OOP design in Handmade Hero?
🗪
2:25:09ronpaulvevo I know you don't really like OOP design, but can you provide some ways you might take advantage of OOP design in Handmade Hero?
🗪
2:30:59"Don't OOP. OOC"β
2:30:59"Don't OOP. OOC"β
2:30:59"Don't OOP. OOC"β
2:35:06"What are the chances that there's one way to always write code?"γ
2:35:06"What are the chances that there's one way to always write code?"γ
2:35:06"What are the chances that there's one way to always write code?"γ
2:35:52siltnamis What do you think about "const correctness"? How often do you use const?
🗪
2:35:52siltnamis What do you think about "const correctness"? How often do you use const?
🗪
2:35:52siltnamis What do you think about "const correctness"? How often do you use const?
🗪
2:38:35mrpapillon1 const is mainly for teams
🗪
2:38:35mrpapillon1 const is mainly for teams
🗪
2:38:35mrpapillon1 const is mainly for teams
🗪
2:40:58Wrap it up
🗩
2:40:58Wrap it up
🗩
2:40:58Wrap it up
🗩