I spawned a terrain and added a material. Black areas appeared when i was painting the second layer.