Initial Slate SDF generation takes long enough to appear as a hang for the user.

Using the Slate SDF feature released with 5.6 there is a noticeable delay on first load of the main menu. Is there some way to front load the SDF generation tasks such that the splash movies are still playing while they are generating?

[Attachment Removed]

Steps to Reproduce
Have a main menu with a decent amount of text using two or more different fonts that have SDF generation enabled.

[Attachment Removed]

Hi,

Are you using MSDF? Are you seeing a full hitch, or is the text just popping in? Our approach is to generate a placeholder using approximate SDF and then do the generation on a worker thread in the background, so you might see some frame time improvement by adjusting down the Single-Channel Distance Field Resolution on your font. If you see popping as the placeholders are replaced with the final generated glyphs, you could raise SlateSdfText.GeneratorPoolSize to spawn more worker threads and see if that helps.

I’m not sure how much luck you’ll have pre-running the generation under a blocking load screen (since the game thread is blocked and the font atlas isn’t thread-safe) but if you’re doing any sort of streaming load then you could display the text under a load screen and prepopulate the atlas that way. I’ve seen some projects elect for a two-phase load where a blocking load screen (displaying a movie or simple Slate widget) handles the main level load and the level pops up a UMG load screen to do some final loading while the game thread is unblocked, so that could give you opportunity to draw the text underneath and trigger SDF generation.

Best,

Cody

[Attachment Removed]

Yea. We’re using MSDF. It’s not a full hitch. Just to the user it appears that way because they cant see anything.

I will try a secondary game-thread loading widget. How do I detect if the SDF generation is complete?

[Attachment Removed]

Hi,

We don’t currently have an event to notify when generation is complete, so you’d need to make engine changes to support that. There’s an SdfTaskToAtlasData map in FSlateFontCache that may be a good starting point, it should track any dispatched generation tasks so you could add some code there to broadcast out an event when it’s empty. Alternatively, it may be easier to just go wide with the task pool by bumping up the pool size and delaying for a short period, as I wouldn’t expect it to take more than a few frames to complete.

[Attachment Removed]