Created
June 20, 2018 23:21
-
-
Save ayamflow/411553359fb491439f3ea41d851408b2 to your computer and use it in GitHub Desktop.
Threejs - Rendering 2 scenes on top of each other without breaking render targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Need to toggle the autoClear flag to avoid breaking rendering to RenderTarget | |
function update(dt) { | |
renderer.render(scene, camera); | |
renderer.autoClear = false; | |
renderer.clearDepth(); | |
renderer.render(orthoScene, orthoCamera); | |
renderer.autoClear = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment