Skip to content

Commit acc230b

Browse files
committed
basic example: whoops it was not clearing the depth buffer :)
1 parent 673f88f commit acc230b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ bool Render (Camera[] cameras, RenderLoop loop)
4141
// per-camera built-in shader variables).
4242
loop.SetupCameraProperties (camera);
4343

44+
// clear depth buffer
45+
var cmd = new CommandBuffer();
46+
cmd.ClearRenderTarget(true, false, Color.black);
47+
loop.ExecuteCommandBuffer(cmd);
48+
cmd.Release();
49+
4450
// Setup global lighting shader variables
4551
SetupLightShaderVariables (cull.visibleLights, loop);
4652

0 commit comments

Comments
 (0)