Skip to content

Commit

Permalink
ReflectorNode: Force autoClear (mrdoob#30199)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag authored Dec 24, 2024
1 parent 309d347 commit 3e6034a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nodes/utils/ReflectorNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,17 @@ class ReflectorBaseNode extends Node {

const currentRenderTarget = renderer.getRenderTarget();
const currentMRT = renderer.getMRT();
const currentAutoClear = renderer.autoClear;

renderer.setMRT( null );
renderer.setRenderTarget( renderTarget );
renderer.autoClear = true;

renderer.render( scene, virtualCamera );

renderer.setMRT( currentMRT );
renderer.setRenderTarget( currentRenderTarget );
renderer.autoClear = currentAutoClear;

material.visible = true;

Expand Down

0 comments on commit 3e6034a

Please sign in to comment.