How can I render a static mesh in the corner of the screen?

I would like to render a static mesh in the corner of the screen, similar to the X-Y-Z widget shown in the bottom left of the editor viewports. Ultimately I just want the engine to multiply the vertices positions by my own transformation matrices. From what I can tell, materials only let you access the vertex shader through the World Position Offset node, and I dont think I can put the mesh in screen-space using that. Does this mean I would need to implement my own vertex factory, or resort to using something in the UMG / Slate UI pass?

There are a few ways to do this.

The simplest is to make your object a child node of the active camera node.

The next simplest is to set up a camera that renders the object to a render target, and the paste the render target texture in the corner.

The third way would be to use “custom depth stencil” render pass shenanigans. Most of the tutorials for this is on “how to render object outlines,” but it can be used for a bunch of other effects, too (including compass roses and other such overlays.)

Thank you, the solution of just making the object a child node of the camera node does work, and then I just adjust it’s position on screen like so:


I was wondering, how could I do the equivalent of setting the object as a child of the camera node, but do that inside of the material instead? I’m not sure which matrix I need to apply to my actor position in order to get the same effect.

I’m not sure you can, because object culling happens before the shader, and thus you can’t successfully use an arbitrary matrix in the shader. (At least not without also making the bounds be essentially infinite)

Is there any quick and easy way to remap perspective with this method?
IE you can offset the mesh to the bottom corner of the screen, but it will have the perspective of the camera. Can the mesh appear to have the perspective of being rendered in the center while positioned on the far left?
(Without using render targets for performance considerations)