Download

Drawing unlit objects in front of everything else (solution)

I’ve been working on some custom manipulators which need to draw in front of everything else but I struggled to find a good solution online.

I’ve managed to work out a reliable way to do it so I thought I’d share.

Basically I offset the vertices toward the camera so they’re all stacked just in front of the clip plane.

As I’m using an unlit shader with faked directional lighting, there’s no visible difference other than the depth at which the object draws. This will look wrong if you’re using a lit shader.

The advantage of this over post-process effects is that it works in all of the editor windows so it’s perfect for custom manipulators in Blueprints.

I’m not sure whether it’s optimal in terms of performance, that’s not really a concern for me as none of what I’m doing will be rendered in the game.

Let me know what you think or if you have any improvements.

Sam