2017 // Metal Rendering // Black Flashes and Lines on Static Meshes

Can confirm this is due to using the Xcode 9 - beta 2 as the default Xcode on a 2017 MBP.
There is definitely an issue with the integration of the Metal system, but I’m not savvy enough to figure out where it stems from.

What I do know:
Building the editor via Xcode results in errors in MetalRHI.cpp file.

Running the xcode-select -reset command via terminal and defaulting back to the current stable version of Xcode fixes this issue in UE4.

Hope this helps track a bug down!

Posting this as a bug report as it seems the issue existed on previous Mac builds and now has carried into the newest 2017 Touch Bar variations.

GPU-
AMD Radeon Pro 560.
Forced using dGPU, Intel internal card is off.

When I start a new First Person project with starter content, all meshes and material are fine. Everything renders as expected.

If I open any materials and the engine has to recompile the shaders, any re-compiled shaders look like these:

The flickering increases and moves around as I move around the viewport. Issues also appear in PIE.

I was able to turn off “Use as Occluder” and saw some relief, but it pretty quickly started again, even when “Use As Occluder” was turned off.

2 questions here:

  1. Is there a way to ensure it isn’t my GPU?
  2. What effect does turning off “Use as Occluder” have on a shipped game?

Thank you.

Thanks for reporting this.

It is due to a change in Apple’s Xcode 9 Beta ‘metal’ byte-code shader compiler versus the Xcode 8 version, even when providing the same Metal shader text and compilation options. This will be resolved in a future version of Xcode and/or UE4. Until then please use the current version of Xcode (8.3.3 at the time of writing) - this is the sort of thing Betas are released to find.

I have the same issue in Xcode 9 using 4.16.3

I tried using 4.17.1 but it was giving me other Xcode errors.

It has become very difficult since ~4.15 to navigate what works on how to use it on the macOs versions

Hey!

If you use the 4.17.1 from the launcher and then install the Xcode beta app, use the terminal command to reroute where UE looks for Xcode, you should be able to get iOS 11 and ue4 playing nicely.

Granted, now that the official ios / sdk 11 is out, I don’t think “beta” xcode is around anymore so you’ll have to use the official Xcode 9 version for ios11. I’m not sure Epic has updated to support the official release just yet, unless you’re willing to jump to 4.18 preview 1, which may break other features.

Ultimately, I was having this issue when UE4 was pointing to a beta version of Xcode that itself had metal bugs. Those have since been patched, and as long as you have the right version of Xcode matched with unreal, it should let you compile shaders without issue, albeit some time lag.

I’m using the official Xcode 9 version, but still have those issues. I’m not even using it for iOS but for macOS I have been having metal shaders issues for months. Have not find any solution yet.

You will need to upgrade to Unreal Engine 4.18 which includes a substantial refactoring of our Metal shader compiler to deal with the changes in Xcode 9’s Metal bytecode compiler.

Thanks for this response - much appreciated! Installing the preview now to see where it gets me

I can confirm that the Unreal Engine 4.18 preview does not have these issues!

Epic is amazing. Glad you’re back up and running

Hey Guys!

I’m having the same issue in UE4.19 using Windows. Can anyone help me?

Thx.