We are getting nasty artifacts from distance field AO on our city model and I would like to disable DFAO but leave distance fields enabled, but there doesn’t seem to be an “Enable Distance Field Ambient Occlusion” switch in the
Skylight where I would expect it. Is there a simple way to turn off DFAO without disabling distance fields in the project?
either put the following line in your engine.ini:
r.DistanceFieldAO=0
or run the console in the editor and type in:
r.DistanceFieldAO 0
2 Likes
Heya, in case anybody comes across this. The above won’t work. It would disable mesh distance sampling in materials. The correct way is to turn cast shadows off on your Sky Light. Simple solution but I had to dig through the source to find it.
Relevant soure code “Engine\Source\Runtime\Renderer\Private\IndirectLightRendering.cpp” Line 1890
extern int32 GDistanceFieldAOApplyToStaticIndirect;
if (Scene->SkyLight->bCastShadows
&& !GDistanceFieldAOApplyToStaticIndirect
&& ShouldRenderDistanceFieldAO()
&& ShouldRenderDistanceFieldLighting()
&& ViewFamily.EngineShowFlags.AmbientOcclusion
&& !bReflectionCapture)
{
bApplySkyShadowing = true;
FDistanceFieldAOParameters Parameters(Scene->SkyLight->OcclusionMaxDistance, Scene->SkyLight->Contrast);
RenderDistanceFieldLighting(GraphBuilder, SceneTextures, Parameters, DynamicBentNormalAOTexture, false, false);
}