Download

Material to override emissive colors

So this has been a common question of mine. I’ve made a basic outline material, however it draws over any emission I have so if there is a glow and an outline conflicting with each other it looks pretty ugly. There’s the source of the emission, an outline overwriting it completely, then I want to detect if the pixel I am working has any emission applied to it, so I am able to say “Ok, just leave this pixel be, don’t draw the outline over it”. I’ve looked through the scenetexture node, and found nothing.

The shuriken isn’t really important since I can just exclude it from the custom depth, just an extreme example. The cylinder is the prime example, as I just want the non-emissive portion to be outlined while the emissive section overwrites the outline. Thanks.

assuming your outline is done in a postprocess, isn’t there a scene emissive buffer you can also access and use it to lerp and control where not to draw the outline?

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.