среда, 22 июня 2016 г.

How to make text facing a camera in Unreal Engine

Hi, I've found a pretty easy way to do that by writing a shader.

If you deal with a text-in-a-wolrd in Unreal it's most likely that you use the TextRenderComponent. It uses a text material and here we begin. All we need is to change this material.

TextRender Properties

The idea is to use WorldPositionOffset, to set mesh vertices facing a camera in a vertex pass. And we are lucky, because this function is already exist and named "AlignMeshToTheCamera". 

Take a look at my Material:

Set basis vectors as you like, and enjoy.