4.9 Horrible DFAO artifacts

Hi Epic,

Just tried 4.9 Preview. Lots of interesting new features, however I’m having a major problem with the improvements to the DFAO. Here are some screens:

This is on default ThirdPersonMap - Sun off, Skylight set to movable. Also, an example from the clean map. This does not seem like much of improvement to me :frowning: Is there any way to fall back to the old clean way somewhere in configs, or will this be addressed in the final release?

Thanks!

Hi BrickTop,

What you’re seeing here is an artifact of scaling a mesh non-uniformly. The template maps for something like Third-Person or First Person template may not be the best examples to test some of the Distance Field features.

If you select the wall mesh in the third person template you’ll see that this goes against the recommended use of Distance Fields. Currently that wall mesh is a non-uniformly scaled cube mesh. It’s Scaled 30x0.5x4 in the XYZ.

If you scale a mesh by more than 2x in any direction non-uniformly you’ll start to see these kinds of artifacts cropping up.

It’s best to troubleshoot these kinds of things by using the Show > Visualize > Mesh Distance Fields. This is the ideal view for seeing the distance fields that will generate shadows and AO.

Here’s a look at the wall next to the mesh scaled back to it’s original size in the mesh distance field view.

For the second image, the same would be true here as well if you’re using a scaled mesh for the floor. Try using the Floor_400x400 static mesh in Starter Content along with some of the props to look at the Distance Field AO and Mes Distance Fields views. Also, you can adjust settings for your AO in your Skylight under Distance Field Ambient Occlusion tab to get better results.

As a reference, this information can be found in the Distance Field AO documentation as well. #limitations

I hope this helps.

Hi ,

Thank you very much for your reply. I do know that non uniformly scaled meshes are better avoided with DFAO. But I don’t think that’s the only thing to blame here. First of all, I’ve done the exact same thing on exact same map in all the previous versions and results were never this bad. Second - I’ve made side by side comparison screenshots for you between 4.8 and 4.9:

The scale of all the objects is uniform, and in case of walls at 1,1,1. It should be pretty obvious what I’m trying to point out here, if you look at two screenshots. Mostly it’s these horrible “streaks” in 4.9 that are the problem. Though in 4.8 it may be a bit more splotchy, but at least splotches are more uniform and "rounded’ in shape making them less noticeable.

Again, if this is the way it’s gonna stay, is there any way to tweak configs to get results closer to 4.8? I really would like to keep using newer versions of the engine, but if DFAO is going to stay this way, I’d have to be stuck with 4.7 or 4.8 :frowning:

Thanks for any help.

Those artifacts look like side effects from the optimizations made for DFAO in 4.9. I did not see any like that in the content I tested but maybe I did not test well enough.

Some cvars to try
r.AOGlobalDistanceField 0
r.AOUseSurfaceCache 1

That should get you back to the 4.8 method (surface cache). I will have a look and see if I can solve these artifacts.

Hey ,

Thanks a LOT for your help. r.AOGlobalDistanceField 0 gets rid of those streaks perfectly! And now DFAO definitely looks better than in any of the previous versions. It’s much smoother and also the “shimmering” is gone. Combined with SSAO or HBAO (hopefully we’ll see that integrated in the official build some time soon), it provides great results!

As for r.AOUseSurfaceCache 1 - that’s an instant crash for me, so cannot give you feedback whether this helps in any way.

Anyway, thanks again and maybe you can set r.AOGlobalDistanceField 0 by default, so other people won’t run into this issue (although maybe it does something important, just still has some issues).

Cheers!

Well it’s super expensive without the global distance field, like 5x more expensive if you make a forest of trees =)

So, this cvar controls only the distant DFAO? Maybe you can find some solution to fix those artifacts, after all this is still only Preview 1. I know that what I am showing is a pretty extreme case (flat surfaces, overcast), but if you are not making sunny forests, situations like this can occur :slight_smile: It looks really nice and clean with it disabled, but if we can have it also 5x faster - would be great, of course.

With materials and normal maps you will not notice that artifacts :slight_smile:

Mine doesn’t look that broken. I setup a similar scene to yours.

What video card are you running? Clearly the global distance field is broken in yours. Can you do me a favor and post screenshots of

Show->Visualize->Mesh Distance Fields
Then type ‘r.AOVisualizeGlobalDistanceField 1’

Should look like this

I fixed the ‘r.AOUseSurfaceCache 1’ crash, that should be in the next 4.9 preview. I also found a bug where moving a small object like the cube will accumulate AO artifacts, that is also fixed now. Neither of those explain your results though.

Hi ,

Cool to hear about the fixes :slight_smile: Those ghosting artifacts were there ever since DFAO got introduced, but I ignored them since it clearly states in docs that DFAO is not meant for moving objects.

The video card the previous sceens were taken on is GTX 460. I am at the different machine now with GTX 660. The results here are even worse with r.AOGlobalDistanceField 1

I tried to make screenshots as self explanatory as possible:

Visualize on:

Ouch! Something is really broken here. And the thing is - this is the second machine that does this (well, 660 is even worse than 460). But maybe the screens will help you identify what is so horribly broken. I can probably get away with shutting GlobalDF off (although, there indeed is around 4-6 fps difference), but it could be that other people may run into this. Also shipping something with this on is risky - as far as I understand DFAO does not get “baked” during build process but rather depends on user’s GPU (I may be completely wrong here).

Cheers!

One more update. After reopening the level, I’m back to just the “streaks” on GTX660:

Definitely, still looks very wrong in visualize mode.

Haha, don’t you see what this is? :rolleyes: It’s the demo level of the third person template! So the global distance field never was rebuild after you placed your own meshes in the scene and deleted the template ones. That’s quite strange but it surely helps to find the issue :slight_smile:

Nice catch, . It does look like a demo level, BUT this is not the third person template level, it’s completely new and clean map. It looks that somehow distance fields carried over an did not update. As I mentioned, it was fixed when I saved/reloaded level. It’s still strange indeed, maybe can figure out what’s the matter.

One thing that’s going on here is that if you do ‘r.aoglobaldistancefield 0’ and then make any changes to the scene, or load a different map, then re-enable it - the contents of the global distance field will be wrong as it wasn’t updated correctly. That’s what’s being shown in this one.

&d=1438217964

I should probably make a cvar that disables the use of the global distance field, but still updates it, so you can toggle it’s use without these problems.

This one shows the artifact nicely, even though the visualize mode looks correct. We’re testing on those GPU’s here to see if we can get the same behavior. Thanks for the screenshots and info - this is exactly what the preview builds are for.

Ok, that makes sense now, why it did not update.

Hope you guys can fix the problem with those streaks as having global distance field on does improve performance quite a bit. Please let us know if you do!

Hi Bricktop, I have been working with on the issue that you are seeing. We have tested on a few different cards and are having a hard time replicating the artifacts that you are seeing. Would you possibly be able to upload your project to dropbox or google drive and share it with me? I would like to make sure that all of the settings are exactly the same across all of the tested cards.

Thank you very much for helping us work out this problem.

Hi ,

There project I am using is just a clean ThirdPersonTemplate. To replicate the level I am using, here are the steps:

  1. Create new Level (Default)
  2. Shut down the sun
  3. Add Movable Skylight
  4. Replicate the default floor mesh (SM_Template_Map_Floor) a few times.

That’s it, everything else is at default settings.

On the other note, I’ve just tried 4.9 preview 2. The streaks are still present, but only on the strongly non uniform scaled meshes, which is to be expected with global distance field, I suppose (r.AOGlobalDistanceField 0 gets rid of that). However, it seems to be better than preview 1.

AO in Preview 2 appears to be looking a bit more “splotchy”, though. Also I’ve noticed a pretty bad “ghosting” happening while moving the camera sometimes. I’ve just double checked that in 4.8 and it wasn’t there. Even using r.AOGlobalDistanceField 0 and r.AOUseSurfaceCache 1 (which said should get me back to 4.8 setup), doesn’t fix that. I will try to make a video later to show this effect. This is even noticeable at character’s feet while walking, which is really strange, since DFAO is not supposed to be affecting skeletal meshes (nor skeletal meshes’s contact with static meshes??)

Well, hopefully we can fix these issues. I will up the video later today.

Thanks for help.

Hello again,

So, here’s the video. Sorry if the quality is bad, but it should be enough to see what I mean. Look at character’s feet and also at the boxes, when the camera is being turned. This is something I haven’t seen in 4.8

Another interesting thing - I think I’ve found out why you cannot replicate the “streaks”. Basically, they seem to be carried over from the previously opened level. If I open the test level first, there’s no streaks. However if I open ThirdPersonTemplate, set it up to use DFAO (there are some really bad streaks, caused by non uniformly scaled meshes), and then reopen test level, the sreaks appear. It seems, like DFAO just doesn’t update completely.

It doesn’t seem like a huge deal, but may be worth looking into.

Hope it helps, and thanks ahead for any info on the “ghosting”.