RenderTarget autoClear

Hi Corentin,

First of all, welcome to Babylon!

It doesn’t look like there’s a feature built in specifically for doing exactly that. However, judging by this if statement, it looks like adding an observer to the render target texture’s onClear observable will cause the texture to not be cleared.

I tested this by going to the “Custom Render Targets” example Playground and adding the following code on a new line at 62:

renderTarget.onClearObservable.add(()=>{});

I think this might work for your purpose. One caveat, though: this prevents the clearing of the depth buffer, too, so you’ll have to be mindful of that if the depth buffer will affect your future drawing.