Need help with a sobel edge post process effect :(

That most likely is the kernel you are messing with, and the values should already be tuned pretty well to calculate the sobel differences. If you change these values then the original content will slowly slide into the edge channel, and you don’t want to do that. This actually is the reason the black content start to appear.