Skip to content

Commit

Permalink
Fix changing clear options when rendering depth (#924)
Browse files Browse the repository at this point in the history
fix changing clear options when rendering depth
  • Loading branch information
guycalledfrank authored May 3, 2017
1 parent 1b875f3 commit c3a1d26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scene/forward-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1939,9 +1939,9 @@ pc.extend(pc, function () {

// Set depth RT
var oldTarget = camera.renderTarget;
var oldClear = camera.getClearOptions();
var oldClear = camera._clearOptions;
camera.renderTarget = camera._depthTarget;
camera.setClearOptions(rgbaDepthClearOptions);
camera._clearOptions = rgbaDepthClearOptions;
this.setCamera(camera);

// Render
Expand Down Expand Up @@ -2007,7 +2007,7 @@ pc.extend(pc, function () {

// Set old rt
camera.renderTarget = oldTarget;
camera.setClearOptions(oldClear);
camera._clearOptions = oldClear;
} else {
if (camera._depthTarget) {
camera._depthTarget.destroy();
Expand Down

0 comments on commit c3a1d26

Please sign in to comment.