Download

Mesh Distance Field is different on other computers

Hello,

I’m using DistanceToSurface for foam in our water shader, but the results are not consistent on different computers. Is there a way to force rebuild the mesh distance fields or is there a cvar or something I am missing?
Thanks in advance!

EDIT: Both PCs are on EPIC mode for all settings, and both support SM5

EDIT2:

So far I’ve tested it with 4 machines using the same build of the game.

Broken For:

  • AMD HD5880 - Driver Version 15.11
  • AMD HD6870 - Driver version 15.20 (latest supported version for this card)

Working For:

  • AMD r280 - Driver Version 15.30
  • AMD r290 - Driver version 16.30

This is what it looks like on PC 1 (and what it should look like):

This is what I see on PC2 (notice the artifacts on the water):

Enabling r.AOVisualizeGlobalDistanceField on PC1:

but on PC2 it’s completely not generating (all white):

Any help is appreciated :slight_smile:

What are the graphics cards on each computer?
Have you updated the drivers on each of them?

Hi jwatte,

PC1 is running on an AMD r9 270, and PC2 is AMD Radeon HD 6870 - both with the latest drivers.

Maybe it’s an ATI driver bug then. Do you have an NVIDIA card you could try putting in there? Or could you swap the cards and see if it follows the card or the machine?

Thanks for the reply :slight_smile:

I don’t have access to an NVidia card, and the other PC isn’t reasonably accessible to me.

I can maybe try this eventually, but I’d like to first try ‘force rebuilding’ the Global Distance Mesh field (especially on the landscape). I’ve searched around for how to do this and tried changing the landscape, but with no luck so far. Do you happen to know how to rebuild it?

Update (not yet resolved):

I have tried the game on another machine (through the editor), also running on an r9 200 series. Everything worked well here, it looks like it should.
I’ve also tried making a build from the machine with the bad result and playing it on another computer (this time running an even older AMD card). This one resulted in the same broken result.

Unfortunately, the results of these tests don’t do much to eliminate the possibility of driver issues OR potential cache problems, so I want to test the build on one of the r9 200 machines when I get a chance.

Also, I’ve managed to find out to delete the Derived Data Cache files (.ddc) in order to force a rebuild of the Distance Mesh Fields. I’ve started the rebuild, but it will take a few hours though so I don’t have results yet from this.

Update 2 (STILL BROKEN):

Rebuilding the DistanceMeshFields didn’t fix the problem and I’ve tested a build from the broken PC2 on PC1 and the water rendered right.

So what is happening here?
I have AMD drivers 15.20 on the broken PC2, but those are the last drivers supporting the card.

Is there a known issue with these drivers? Does the card not support the feature? and is there any way to detect this so I can change the material based on the hardware they’re running?

You may want to first send the game/scene to a friend that has either a different AMD card or an Nvidia one to try and isolate the problem. There are a lot of questions still unanswered. Is it a driver bug? And if so, is it a bug with just that generation of cards? Is it a problem on that one specific computer? Is it maybe the opposite, where it only works for you? These things can only be answered with a few more people testing your scene, you may want to ask around to see if anyone you know is willing to test it for you.

Thanks for the response Daniel,

Somehow, I don’t know anyone with a decent Nvidia card :\

So far I’ve tested it with 4 machines using the same build of the game.

Broken For:

  • AMD HD5880 - Driver Version 15.11
  • AMD HD6870 - Driver version 15.20 (latest supported version for this card)

Working For:

  • AMD r280 - Driver Version 15.30
  • AMD r290 - Driver version 16.30

Looking online, the HD6870 is a 6 year old card. I wonder if it might be a problem with that card and distance fields in general. Maybe test one of Epic’s example scenes that has DFAO enabled on it to see if it works on there. It’ll determine if the problem is just occurring in your project or not, it’s entirely possible that hardware that old may not support distance fields to begin with for some reason. Just a guess of course, I’m not too familiar with AMD’s older generations of hardware myself, just trying to narrow things down.

From your description I’d say 99% likely to be an AMD driver / hardware bug. I made a bug report for this so we can try to reproduce it and escalate with AMD if we can get it to happen. Even in the best case it takes many months to get a fix for a driver bug though.

btw you can disable the caching of the global distance field with ‘r.AOGlobalDistanceFieldPartialUpdates 0’. Then it will fully update every frame which costs a lot. I doubt that will affect it the bug you’re seeing, it would be the same on all hardware.

If you need a workaround for shipping your game, I’d go with disabling the building of global distance fields on AMD cards. FGPUDriverInfo can be used to determine whether you’re running on an AMD card, and UpdateGlobalDistanceFieldVolume can be modified to just clear the volume textures on an AMD card instead of running the compute shaders that compute the global distance field. Obviously this requires some programming =)

struct FGPUDriverInfo
{
// DirectX VendorId, 0 if not set, use functions below to set/get
uint32 VendorId;
// e.g. “NVIDIA GeForce GTX 680” or “AMD Radeon R9 200 / HD 7900 Series”
FString DeviceDescription;
// e.g. “NVIDIA” or “Advanced Micro Devices, Inc.”
FString ProviderName;

Thanks for the info Daniel.Wenograd & DanielW (coincidence or same person?). I have been taken off of this task for bit, but this should help tremendously when I get back to it :slight_smile:

It’s a coincidence, but I suspect one of us is the other’s evil twin. It’s the only explanation that makes sense.

Good luck with resolving the issue, if it’s an engine bug then it’s a bit out of my area of expertise.