Adnan
Adnan

Reputation: 934

What is the reason for having both preserveDrawingBuffer and autoClear renderer properties?

The renderer will clear its output before rendering even if autoClear is set to false due to the fact that the constructor property preserveDrawingBuffer is set to false by default.

Both of these properties can control whether or not the renderer clears before rendering output. They both also conflict with each other (if one is false, the other must be true, or vice versa).

Is there a reason for having two properties of the renderer doing the same thing?

Upvotes: 2

Views: 766

Answers (1)

WestLangley
WestLangley

Reputation: 104783

They are separate issues.

renderer.autoClear = false is appropriate if you have multiple render passes, or if you are doing post-processing with THREE.EffectComposer and BloomPass, for example.

preserveDrawingBuffer is required if, for example, if you require persistence for some reason.

EDIT: preserveDrawingBuffer = true is not required to take a screenshot.

three.js r.87

Upvotes: 1

Related Questions