I have found a temporary work-around which is to increase the “DistanceField Shadow Distance.”
This fix is not ideal however as the issue seems to be resolution dependent. The higher the resolution the larger the distance needs to be to counter the bug.
We are very shortly going to be releasing the game to the public, so I was wondering if there was a fix for this in 4.8/4.9, and if so, what change would that be so we can integrate that specific changelist before launch (If possible)
Thank you for the report. We have assigned one of our technicians to investigate your issue and they may post here with additional questions or comments.
If you would create another video with the same scene and go to view show > visualize > Mesh Distance fields and record if it is flickering there.
Also if you could show the AO Shadows.
Lastly what is your Mesh Distance Field set to. If those buildings are outside of that range then the computation by default switches back to cascading shadows that have a limited range on them.
I’ve created another video here.
This has the “DistanceField AO” visualization, and then the “Mesh Distance fields” visualization.
The Mesh Distance fields do indeed flicker. This is only on smaller meshes however.
Where is the value set for the “Mesh Distance Field?” Is that the resolution set per mesh? (Which is set to 1.0f on almost all our meshes) the DistanceFieldShadowDistance value set on the directional light? (30000.0f causes flickering ~60000.0f does not) or the OcclusionMaxDistance value set on the Skylight Actor? (Set to 600.0f, and cannot be changed.) Or is there another value somewhere that I’m missing?
In regards to the mesh distance fields this would be handled inside of your meshes on your LOD’s.
Steps to recreate :
1.) Locate a mesh that you are experiencing this issue with.
2.) Double click that object in your content browser to bring up that meshes information window.
3.) On the right side under Details there will be a LOD section.
4.) In that section there is another roll out menu for Build Settings.
5.) Down at the bottom there is a tab called Distance Field Resolution Scale.
6.) On the larger objects you may be able to get away with number like 3.0. ( I wouldn’t recommend going any higher as it increases draw time.)
7.) As an alternative you may eliminate the scale with a value of 0. This is usually done with grass and small foliage.
Many of these preferences work in optimization workflows and it will be different for different games.
Finding what works best for you will require some tweaking,
Cheers for the info, however this doesn’t fix the issue. (I tried setting objects to 3+ vales and generally having a play around with the value)
As mentioned above this isn’t so much an issue with the Mesh DistanceFields, but specifically with the DistanceField shadowing.
When the frustum size is changed (Particularly via a FOV change) the DistanceField shadowing breaks for a frame across the ENTIRETY of the scene. (Not just a specific set of meshes) This seems as though the Distance field shadows don’t get calculated correctly/at all before the initial render after the size changes.
DistanceField meshes are how DistanceField shadows are calculated.
There are limitations with everything including shadows and DistanceField.
If you could recreate this in a test project in a later build. Like 4.8. I know that the performance of DistanceField AO especially has been improved by up to five times in the preview of 4.9.
At this point this is not a bug because you are able to slightly improve this issue with a FOV change.
With the limitations of the current version of UE4 that you are using I would highly recommend testing this out and seeing if that fixes it.
I will be moving this thread from Bug reports to Rendering,
Firstly the issue is when you’re in PIE or game. The scrollwheel only moves the Editor camera forwards and backwards when not in PIE. (In your video you don’t seem to be in PIE mode)
The FOV change is inside the FirstPersonCharacter BP, which is:
Setting r.dfshadowScatterTileCulling to 0 does work for the 4.8.3 test project, however it completely breaks DF shadowing in our 4.7.6 game. Video of the results [here][3]
Were there any other possible work-arounds I could try in 4.7.6?
EDIT: We’ve just finished the initial upgrade to 4.8.2 (It’s been in the works for a while) and the r.dfshadowScatterTileCulling 0 change seems to cause all our speedtrees to start flickering in the distance.
Due to inactivity and tracking issues, I will be marking this thread as answered. If you would test the above mentioned post and see if anything is scaled non uniformly.
I was never able to recreate this issue even with speed tree models inside of the test you sent me.
If you are still experiencing this issue then please comment again and I will continue to investigate at that time.
We were in the middle of shipping, and have gone into support mode currently.
Answering your question: There are some items which are non-uniformly scaled in the scene, however the flicker/artifacts are also present on objects which are uniformly scaled as well.
Does this mean we can’t have ANY object in the scene which is non-uniformly scaled, or that flickering/artifacts should ONLY appear on the non-uniformly scaled objects?
Not necessarily. However, distance fields are calculated by a power of two. So the calculations will occur at 2, 4 ,6 respectively.
So if you have scaled your mesh to a power of say X = 1.3 Y = 2 and Z = 2 then the distance fields will essentially try to draw or calculate what value it’s closest to. Sometimes this can cause issue when calculating the distance field because UE4 is not sure which value to associate 1.3 to and therefore could cause artifacting and the graphical glitches that you are experiencing.
So I removed all non-uniformly scaled objects in the level (Foliage, etc)
And am still seeing the same issue when “r.dfshadowScatterTileCulling 0”
It seems it’s related to the number of objects in the level. the more meshes in the level, the larger the number of errors that occur (Even with uniformly scaled objects.)