Camera clearing issue with Render Textures when upgrading from LWRP to URP

I just upgraded our project from 2019.2 to the 2019.3 beta, and I’ve noticed an issue with a camera rendering to a render texture.

It does not matter what “Background Type” I set (Skybox, Solid Color, Don’t Care), the camera never clears before rendering.

The only way I managed to actually get it to clear is to enable “Render Post-processing” on the camera. This results in another problem which is that this camera is created through code, and I can’t figure out how to enable this camera option through my script.

I’d love to add some screenshots, but since upgrading Unity turns completely gray when I take a screenshot of it.

The solution was quite simple, all I had to do was this.

var cameraData = gameObject.AddComponent<UniversalAdditionalCameraData>();
cameraData.renderPostProcessing = true;