I’m trying to render some guidelines on top of blocks that are being placed, much like what the editor does while in editing mode. How can I draw over the top of other static mesh actors like this? I’m concerned that if I use a camera trick, it may not be very efficient. I’m not concerned about lighting.
You’ll want to look into how to setup and use custom depth. This should enable you to set something like that up.
I’ve seem tutorials like this one link text that talk about using custom depth for an outline, or a solid color. How can I make an arbitrary mesh show on top?
I read that you can create a new material and check “Disable Depth Test” in the Translucency panel. Every mesh with this material should be rendered on top, but I havn’t tried it so far.
And if you want this feature just for the editor, you can try setting bUseEditorCompositing of your PrimitiveComponent to true. I think this is the way they draw the handels in the editor. But again, I’ve never tried it
“Disable Depth Test” seems to work as described, but it draws parts of itself over itself. It also draws in front of the first person character’s arms, which is not something I specified, but it does bother me after seeing that.
Unreal uses the technique for the Gizmo actor in the VR editor. All Gizmo components can be found in EngineContent/VREditor/TransformGizmo.
The specific material is: TranslucentTransformGizmoMaterial
I’ve had luck using depth test to do this but I’m trying to render meshes with reflective materials which are not in the translucent domain so all those material properties go away and I can’t tick that box. It’s a weird use case, I have metallic text parented to the camera as it moves through the scene but since it’s 3D, it intersects with geo and gets hidden. Moving it close to camera and scaling it down doesn’t work because depth of field makes it blurry. I thought I saw some way to disable depth of field per material but can’t find that. Maybe there’s a way to do this with composure or some depth test pass. I’m lost for now.