Now that Distance Field Shadows are working properly with Instanced Static Meshes, I’ve enabled them in our project. It makes the game look so much better AND improves performance. So big props go out to everybody involved in this feature!
That said, we’re hitting a problem straight away with generating Mesh Distance Fields - they don’t appear to be built by our build machine.
It seems to me that Mesh Distance Fields are being generated on each machine when the editor is opened - and the generated Mesh Distance Field data isn’t somewhere where it can be added to source control. The problem is that the build machine never actually opens the editor, instead it runs the “BuildCookRun” command using the AutomationTool (using the AutomationToolLauncher). This builds our game in the “Shipping” build configuration and then packages it for us.
The command, in case it’s useful, looks like this (taken from our Python build script):
automation_tool_launcher = os.path.join(dotnet_dir, "AutomationToolLauncher.exe")
command_args = [
automation_tool_launcher,
"BuildCookRun",
"-nocompileeditor",
"-nop4",
"-project=%s" % (game_uproject),
"-cook",
"-allmaps",
"-stage",
"-archive",
"-archivedirectory=%s" % (packaged_dir),
"-package",
"-WindowsNoEditor",
"-clientconfig=Development",
"-ue4exe=UE4Editor-Cmd.exe",
"-pak",
"-targetplatform=Win64",
"-build",
"-utf8output"
]
Anyway, then end result is that the game built by the build machine has no shadows because the Mesh Distance Fields aren’t being generated. But it’s totally fine (and looks great!) if we run a development build on our own machines. I haven’t (yet!) tried packaging the game from one of our development builds, I’ll update this post with my findings when the build has finished.