Inconsistent VT resolution when baking with rendering targets

Following up on my previous question about Drawing VT materials to render targets. The console commands mentioned in the previous thread help however there are still a number of issues.

  • if you don’t open the material in the material editor before rending to texture it the output textures will be empty textures
  • despite increasing MaterialBaking.VTWarmupFrames CVar to as high as 120 most attempts to render to texture will be low res and blurry
  • Once in a while the material will render to texture at the appropriate resolution but it’s very infrequent and it’s not clear why it works when it does. (I’ve not been able to get successful positive repro steps for the correct behavior)

This question was created in reference to: [Draw Material to Render Target blurry when using Streaming Virtual [Content removed]

[Attachment Removed]

Steps to Reproduce
See repro steps in attached thread

[Attachment Removed]

Apologies for the delay, I’m setting up a repro case to see what could be the issue with Skeletal Mesh Bake Materials functionality.

[Attachment Removed]

Hey Alex, one of my colleagues has managed to get this working. The issue appeared to be setting the virtual texture warm up frames was working but the logic wasn’t waiting before it started rendering the material to texture. To fix this we:

  • Moved the logic from a scripted asset action to an editor utility widget (something about it running as part of the engine’s UI when it was an asset action)
  • Added delays before rendering material to texture begins
  • force all of the textures used by the material to be loaded before rendering begins

[Attachment Removed]

Thanks for following up, I wasn’t able to replicate the issue with the Skeletal Mesh Editor > Asset > Bake Materials route and a simple Material that sampled an SVT, glad you arrived at a solution and hopefully it will help someone else who runs into a similar issue!

[Attachment Removed]