This is all dependent on your edge-detection algorithm really, it looks like you’re doing it based on final color, but you probably want to be using scene depth or something like that. There isn’t a scene emissive buffer - you might be able to use Scene Color if bloom hasn’t been applied at that stage.