Draw HUD Text With Glow

Hello

Is it possible to programmatically make text glowing on rendering?

I’ve found GlowInfo in FFontRenderInfo wich can be used with Canvas->DrawText() or in FCanvasTextItem drawing with canvas->DrawItem().

In documentation it is said:

Depth field glow parameters (only usable if font was imported with a depth field)

But I didn’t found any param in font import options:

Check Use Distance Field Alpha and see if it works.

I didn’t fully check it, don’t have access to compiler environment at the moment. But generated font that is imported with that boolean seems to be blurred and “tend” to glow already :slight_smile:

Will check soon and let you know.

Traced DrawText function, enabling distance field should work, as glowing rendered if distance field blend mode is enabled, which IS enabled once Use Distance Field Alpha is set to true.

Oh, sorry, i’m not sure, i still have not compiled engine after last GitHub fetch, have not had time.

From what i’ve seen in sources, it should work now, but i still have not tried, as i said. Take a look at FCanvasTextItem::Draw, maybe you can find out more than i did.

Regarding being blurred a lot, there is a distance field scale factor parameter on import settings, setting it bigger would result in less blurred image.

Well, Thanks! It almost works!

9137-2014-06-26+13-12-32+arialfont+.png

Font became soft on rendering. It’s not big problem.

But I couldn’t make it glowing.

FFontRenderInfo RenderInfo = canvas->CreateFontRenderInfo(true, false,
                                                  FColor::Red, FVector2D(15, 15));
Canvas->DrawText(Font, FText::FromString(Text),
					renderX, renderY,
					1, 1, RenderInfo);

Should I set some options to canvas?

So that should be Signed Distance Field technique behind this, which allows for glow rendering and so on.

Unfortunately, i didn’t manage to get it working.