Comments about what's going on
This commit is contained in:
parent
e212a338d7
commit
cb8afac46f
1 changed files with 3 additions and 0 deletions
|
@ -168,6 +168,7 @@ public class Renderer: NSObject, MTKViewDelegate {
|
|||
buffer.label = "Metaballs Command Buffer"
|
||||
var didEncode = false
|
||||
|
||||
// Render the per-pixel metaballs
|
||||
if let pipeline = pixelPipeline,
|
||||
let encoder = buffer.makeRenderCommandEncoder(descriptor: renderPass) {
|
||||
encoder.label = "Pixel Render"
|
||||
|
@ -181,6 +182,8 @@ public class Renderer: NSObject, MTKViewDelegate {
|
|||
didEncode = true
|
||||
}
|
||||
|
||||
// Render the marching squares version over top of the pixel version.
|
||||
// We need our own render pass descriptor that specifies that we load the results of the previous pass to make this render pass appear on top of the other.
|
||||
let pass = renderPass.copy() as! MTLRenderPassDescriptor
|
||||
pass.colorAttachments[0].loadAction = .load
|
||||
if let pipeline = marchingSquaresPipeline,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue