Successful Multisampled Depth-Peeling
?
?

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:12Thank serge_rgb for fixing the offset bug in Milton, and determine to try CodeXL
0:12Thank serge_rgb for fixing the offset bug in Milton, and determine to try CodeXL
0:12Thank serge_rgb for fixing the offset bug in Milton, and determine to try CodeXL
1:35Try to run the game in CodeXL
1:35Try to run the game in CodeXL
1:35Try to run the game in CodeXL
6:13Inspect the history of OpenGL function calls
6:13Inspect the history of OpenGL function calls
6:13Inspect the history of OpenGL function calls
7:26Try without success to continue to the next frame, and determine to update the machine
7:26Try without success to continue to the next frame, and determine to update the machine
7:26Try without success to continue to the next frame, and determine to update the machine
10:37Read Mox's bug report on the depth buffer being disabled in ResolveMultisample()1
10:37Read Mox's bug report on the depth buffer being disabled in ResolveMultisample()1
10:37Read Mox's bug report on the depth buffer being disabled in ResolveMultisample()1
16:30handmade_opengl.cpp: Reduce the DepthThreshold in CompileResolveMultisample()
16:30handmade_opengl.cpp: Reduce the DepthThreshold in CompileResolveMultisample()
16:30handmade_opengl.cpp: Reduce the DepthThreshold in CompileResolveMultisample()
19:37handmade_opengl.cpp: Prevent ResolveMultisample() from disabling the entire depth buffer in favour of disabling depth testing only, and leaving depth writes on
19:37handmade_opengl.cpp: Prevent ResolveMultisample() from disabling the entire depth buffer in favour of disabling depth testing only, and leaving depth writes on
19:37handmade_opengl.cpp: Prevent ResolveMultisample() from disabling the entire depth buffer in favour of disabling depth testing only, and leaving depth writes on
20:56Compare our code with Mox's report2
20:56Compare our code with Mox's report2
20:56Compare our code with Mox's report2
23:31Run the game and try to toggle on multisampling
23:31Run the game and try to toggle on multisampling
23:31Run the game and try to toggle on multisampling
24:47win32_handmade.cpp: Switch to 960x540 and enable multisampling by default
24:47win32_handmade.cpp: Switch to 960x540 and enable multisampling by default
24:47win32_handmade.cpp: Switch to 960x540 and enable multisampling by default
26:08Run the game and inspect a screenshot to confirm that we get 1-to-2 pixels
26:08Run the game and inspect a screenshot to confirm that we get 1-to-2 pixels
26:08Run the game and inspect a screenshot to confirm that we get 1-to-2 pixels
27:26Run the game and point out our diagonal lines in the ground cube primitives
27:26Run the game and point out our diagonal lines in the ground cube primitives
27:26Run the game and point out our diagonal lines in the ground cube primitives
28:32handmade_opengl.cpp: Make CompileResolveMultisample() use all the samples and run the game to see that we're in a better place
28:32handmade_opengl.cpp: Make CompileResolveMultisample() use all the samples and run the game to see that we're in a better place
28:32handmade_opengl.cpp: Make CompileResolveMultisample() use all the samples and run the game to see that we're in a better place
31:03handmade_opengl.cpp: Try to restore the depth range testing in CompileResolveMultisample()
31:03handmade_opengl.cpp: Try to restore the depth range testing in CompileResolveMultisample()
31:03handmade_opengl.cpp: Try to restore the depth range testing in CompileResolveMultisample()
32:44Run the game to see some artifacts
32:44Run the game to see some artifacts
32:44Run the game to see some artifacts
33:40handmade_opengl.cpp: Revert CompileResolveMultisample() to set, but not only pick from, the minimum depth and run the game to see some artifacts during the peel where the primitives abut
33:40handmade_opengl.cpp: Revert CompileResolveMultisample() to set, but not only pick from, the minimum depth and run the game to see some artifacts during the peel where the primitives abut
33:40handmade_opengl.cpp: Revert CompileResolveMultisample() to set, but not only pick from, the minimum depth and run the game to see some artifacts during the peel where the primitives abut
36:35Consider the fact that we don't actually need multisampling here
36:35Consider the fact that we don't actually need multisampling here
36:35Consider the fact that we don't actually need multisampling here
39:03handmade_opengl.cpp: Try to make CompileResolveMultisample() only pick the minimum depth again
39:03handmade_opengl.cpp: Try to make CompileResolveMultisample() only pick the minimum depth again
39:03handmade_opengl.cpp: Try to make CompileResolveMultisample() only pick the minimum depth again
40:12handmade_opengl.cpp: Try turning off sRGB in CompileResolveMultisample() and run the game to determine that it is more correct with sRGB on
40:12handmade_opengl.cpp: Try turning off sRGB in CompileResolveMultisample() and run the game to determine that it is more correct with sRGB on
40:12handmade_opengl.cpp: Try turning off sRGB in CompileResolveMultisample() and run the game to determine that it is more correct with sRGB on
41:34Blackboard: Producing a premultiplied colour from a percent-coverage value of any given pixel in a primitive
41:34Blackboard: Producing a premultiplied colour from a percent-coverage value of any given pixel in a primitive
41:34Blackboard: Producing a premultiplied colour from a percent-coverage value of any given pixel in a primitive
43:49Blackboard: Storing each of those colour values in the peel
43:49Blackboard: Storing each of those colour values in the peel
43:49Blackboard: Storing each of those colour values in the peel
45:48handmade_opengl.cpp: Read how CompilePeelComposite() handles sRGB
45:48handmade_opengl.cpp: Read how CompilePeelComposite() handles sRGB
45:48handmade_opengl.cpp: Read how CompilePeelComposite() handles sRGB
47:30Blackboard: Considering the case with two triangles touching, that have the same colour value
47:30Blackboard: Considering the case with two triangles touching, that have the same colour value
47:30Blackboard: Considering the case with two triangles touching, that have the same colour value
49:06handmade_opengl.cpp: Consider the possibility that CompileResolveMultisample() is computing slightly different sample positions
49:06handmade_opengl.cpp: Consider the possibility that CompileResolveMultisample() is computing slightly different sample positions
49:06handmade_opengl.cpp: Consider the possibility that CompileResolveMultisample() is computing slightly different sample positions
53:12handmade_opengl.cpp: Make CompileResolveMultisample() set the InvSampleCount up front and add in that colour every time
53:12handmade_opengl.cpp: Make CompileResolveMultisample() set the InvSampleCount up front and add in that colour every time
53:12handmade_opengl.cpp: Make CompileResolveMultisample() set the InvSampleCount up front and add in that colour every time
53:58Run the game to see that it looks basically the same
53:58Run the game to see that it looks basically the same
53:58Run the game to see that it looks basically the same
55:11Wonder if we necessarily know how many samples there are in a pixel
55:11Wonder if we necessarily know how many samples there are in a pixel
55:11Wonder if we necessarily know how many samples there are in a pixel
56:49handmade_opengl.cpp: Double-check the CompilePeelComposite() code, and wonder if the framebuffer's recording of Z values couldn't also be involved in this
56:49handmade_opengl.cpp: Double-check the CompilePeelComposite() code, and wonder if the framebuffer's recording of Z values couldn't also be involved in this
56:49handmade_opengl.cpp: Double-check the CompilePeelComposite() code, and wonder if the framebuffer's recording of Z values couldn't also be involved in this
58:20handmade_opengl.cpp: Make CreateFramebuffer() use GL_DEPTH_COMPONENT32F in an effort to avoid quantisation errors
58:20handmade_opengl.cpp: Make CreateFramebuffer() use GL_DEPTH_COMPONENT32F in an effort to avoid quantisation errors
58:20handmade_opengl.cpp: Make CreateFramebuffer() use GL_DEPTH_COMPONENT32F in an effort to avoid quantisation errors
59:09Run the game to see no effect
59:09Run the game to see no effect
59:09Run the game to see no effect
1:00:16Closely inspect the diagonal artifact across the hero's face, and consider why that occurs
1:00:16Closely inspect the diagonal artifact across the hero's face, and consider why that occurs
1:00:16Closely inspect the diagonal artifact across the hero's face, and consider why that occurs
1:07:07Consult the documentation on glSampleCoverage3
1:07:07Consult the documentation on glSampleCoverage3
1:07:07Consult the documentation on glSampleCoverage3
1:09:25Read about Fixed-Function Primitive Assembly and Rasterization in the OpenGL 4.5 (Core Profile) spec4
1:09:25Read about Fixed-Function Primitive Assembly and Rasterization in the OpenGL 4.5 (Core Profile) spec4
1:09:25Read about Fixed-Function Primitive Assembly and Rasterization in the OpenGL 4.5 (Core Profile) spec4
1:15:31handmade_opengl.cpp: Disable multisampling, try to make OpenGLRenderCommands() enable GL_POLYGON_SMOOTH, run the game and see no smoothing
1:15:31handmade_opengl.cpp: Disable multisampling, try to make OpenGLRenderCommands() enable GL_POLYGON_SMOOTH, run the game and see no smoothing
1:15:31handmade_opengl.cpp: Disable multisampling, try to make OpenGLRenderCommands() enable GL_POLYGON_SMOOTH, run the game and see no smoothing
1:20:21Read about Pixel Ownership Test in the OpenGL 4.5 (Core Profile) spec5
1:20:21Read about Pixel Ownership Test in the OpenGL 4.5 (Core Profile) spec5
1:20:21Read about Pixel Ownership Test in the OpenGL 4.5 (Core Profile) spec5
1:22:12Run the game and wonder if the summation from depth peel to depth peel is not correct
1:22:12Run the game and wonder if the summation from depth peel to depth peel is not correct
1:22:12Run the game and wonder if the summation from depth peel to depth peel is not correct
1:23:22handmade_opengl.cpp: Try to make CompileResolveMultisample() hard set the alpha to 1, run the game and still see the summation error across the primitive boundary
1:23:22handmade_opengl.cpp: Try to make CompileResolveMultisample() hard set the alpha to 1, run the game and still see the summation error across the primitive boundary
1:23:22handmade_opengl.cpp: Try to make CompileResolveMultisample() hard set the alpha to 1, run the game and still see the summation error across the primitive boundary
1:25:35Blackboard: How the alpha summation is wrong
1:25:35Blackboard: How the alpha summation is wrong
1:25:35Blackboard: How the alpha summation is wrong
1:27:44handmade_opengl.cpp: Make CompileResolveMultisample() sum all the colours starting from the furthest depth
1:27:44handmade_opengl.cpp: Make CompileResolveMultisample() sum all the colours starting from the furthest depth
1:27:44handmade_opengl.cpp: Make CompileResolveMultisample() sum all the colours starting from the furthest depth
1:28:58Run the game to see artifacts where trees overlap, but not at the triangle primitive boundaries
1:28:58Run the game to see artifacts where trees overlap, but not at the triangle primitive boundaries
1:28:58Run the game to see artifacts where trees overlap, but not at the triangle primitive boundaries
1:31:16handmade_opengl.cpp: Set an AlphaThreshold in OpenGLRenderCommands() and run the game to see how that affects it
1:31:16handmade_opengl.cpp: Set an AlphaThreshold in OpenGLRenderCommands() and run the game to see how that affects it
1:31:16handmade_opengl.cpp: Set an AlphaThreshold in OpenGLRenderCommands() and run the game to see how that affects it
1:34:08handmade_opengl.cpp: Try preventing CompileResolveMultisample() from performing centroid sampling, and run the game to see that it's a lot nicer
1:34:08handmade_opengl.cpp: Try preventing CompileResolveMultisample() from performing centroid sampling, and run the game to see that it's a lot nicer
1:34:08handmade_opengl.cpp: Try preventing CompileResolveMultisample() from performing centroid sampling, and run the game to see that it's a lot nicer
1:36:33handmade_opengl.cpp: Fully remove centroid sampling and run the game to see that it's nice and smooth, but subtly wrong at some edges
1:36:33handmade_opengl.cpp: Fully remove centroid sampling and run the game to see that it's nice and smooth, but subtly wrong at some edges
1:36:33handmade_opengl.cpp: Fully remove centroid sampling and run the game to see that it's nice and smooth, but subtly wrong at some edges
1:41:14Blackboard: Multisampling colours with low alpha values
1:41:14Blackboard: Multisampling colours with low alpha values
1:41:14Blackboard: Multisampling colours with low alpha values
1:43:18handmade_opengl.cpp: Make CompileResolveMultisample() track both the min and max depth and halve that the range
1:43:18handmade_opengl.cpp: Make CompileResolveMultisample() track both the min and max depth and halve that the range
1:43:18handmade_opengl.cpp: Make CompileResolveMultisample() track both the min and max depth and halve that the range
1:44:06Run the game to see a lot less artifacts
1:44:06Run the game to see a lot less artifacts
1:44:06Run the game to see a lot less artifacts
1:44:46handmade_opengl.cpp: Make OpenGLRenderCommands() set AlphaThreshold to 0, run the game and now only see artifacts during peeling
1:44:46handmade_opengl.cpp: Make OpenGLRenderCommands() set AlphaThreshold to 0, run the game and now only see artifacts during peeling
1:44:46handmade_opengl.cpp: Make OpenGLRenderCommands() set AlphaThreshold to 0, run the game and now only see artifacts during peeling
1:48:26Q&A
🗩
1:48:26Q&A
🗩
1:48:26Q&A
🗩
1:48:51Close the "GLSL version / extension for sampler2DMS" and "Two small compiler warnings VS17" issues6
1:48:51Close the "GLSL version / extension for sampler2DMS" and "Two small compiler warnings VS17" issues6
1:48:51Close the "GLSL version / extension for sampler2DMS" and "Two small compiler warnings VS17" issues6
1:51:25Run the game to see that all is good
1:51:25Run the game to see that all is good
1:51:25Run the game to see that all is good
1:52:12uplinkcoder gl_polygon_smooth is not supported by many modern cards
🗪
1:52:12uplinkcoder gl_polygon_smooth is not supported by many modern cards
🗪
1:52:12uplinkcoder gl_polygon_smooth is not supported by many modern cards
🗪
1:52:35cubercaleb What about the type cast?
🗪
1:52:35cubercaleb What about the type cast?
🗪
1:52:35cubercaleb What about the type cast?
🗪
1:52:56nrec_ Hi, I'm new here, sorry if this has been asked before. Looks like you're doing an engine right now. Any idea about what the game would be?
🗪
1:52:56nrec_ Hi, I'm new here, sorry if this has been asked before. Looks like you're doing an engine right now. Any idea about what the game would be?
🗪
1:52:56nrec_ Hi, I'm new here, sorry if this has been asked before. Looks like you're doing an engine right now. Any idea about what the game would be?
🗪
1:56:42wasenabled As it appears you are nearing the end of the main engine dev, will you be adding in the non-Win32 layers too, or have others already done those?
🗪
1:56:42wasenabled As it appears you are nearing the end of the main engine dev, will you be adding in the non-Win32 layers too, or have others already done those?
🗪
1:56:42wasenabled As it appears you are nearing the end of the main engine dev, will you be adding in the non-Win32 layers too, or have others already done those?
🗪
1:59:05Wrap it up for the day with a reflection on how well the multisampling works, and thanks to mtsmox for reporting the bug
🗩
1:59:05Wrap it up for the day with a reflection on how well the multisampling works, and thanks to mtsmox for reporting the bug
🗩
1:59:05Wrap it up for the day with a reflection on how well the multisampling works, and thanks to mtsmox for reporting the bug
🗩