Why set preserveDrawingBuffer as true in example code but keep it as false

Hello,
In babylon’s source, when init BABYLON.Engine, if user not set option.preserveDrawingBuffer, babylonjs keep it as false, this operation is equal to theejs and webgl. However, almost all tutorials use the following code when init BABYLON.Engine :

var engine = new BABYLON.Engine(canvas, true, {preserveDrawingBuffer: true, stencil: true});

So, why recommended set preserveDrawingBuffer as true while keep its value as false in default. If I set preserveDrawingBuffer as false, are there any disadvantages?

preserveDrawingBuffer: false could improve performance by a tiny bit, but as the expense of some potential artifacts that you must handle yourself. See javascript - preserveDrawingBuffer false - is it worth the effort? - Stack Overflow and Scene's auto clear not working for eg.

preserveDrawingBuffer: true is easier to deal with, that’s why we use it in our examples.

2 Likes