Skip to content

Located line in Unreal Engine source code

Conclusion:

If !ViewFamily.EngineShowFlags.IndirectLightingCache ||, in file: ./Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp Line 1319,

is correct, a view is rich if is missing the EngineShowFlags.IndirectLightingCache.

alt text

Then something needs to fix in FPositionOnlyDepthDrawingPolicy in file ./Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp;

In file./Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp Line 512,

one of paramter VertexDeclaration should take the blame for this bug. Because if I replace this VertexDeclaration with FMeshDrawingPolicy::GetVertexDeclaration() which directly use method in the base class of FPositionOnlyDepthDrawingPolicy, blink stops.

alt text


Deduction:

If !ViewFamily.EngineShowFlags.IndirectLightingCache ||, in file: ./Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp Line 1319,

is correct.
If set Result.bStaticRelevance = true; in File ./Engine/Source/Runtime/Engine/Private/StaticMeshRender.cpp Line 1225, blink starts no matter what value Result.bDynamicRelevance is.
Located in File /Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp Line 1755 function ComputeAndMarkRelevanceForViewParallel triggers this bug.

Because if bStaticRelevance = true in StaticMeshRender.cpp, this will lead to RelevantStaticPrimitives.AddPrim(BitIndex); in SceneVisibility.cpp#Line1495 when ComputeRelevance is called.

And then after function MarkRelevant is called which makes MarkMasks[StaticMesh.Id] = MarkMask;.

But in the end, it is static method static void ComputeAndMarkRelevanceForViewParallel fired this two functions, ComputeRelevance and MarkRelevant.

So in the ComputeAndMarkRelevanceForViewParallel, if this bit, StaticMeshOccluderMap_Word |= (MaskMask & EMarkMaskBits::StaticMeshOccluderMapMask) ? Mask : 0;, sets, will lead to the bug.


=> Blink stops if remove Line 931,
bDirty |= Scene->PositionOnlyDepthDrawList.DrawVisible(RHICmdList, View, DrawRenderState, View.StaticMeshOccluderMap, View.StaticMeshBatchVisibility);, in file ./Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp;
=> Which leaves us a policy,
FPositionOnlyDepthDrawingPolicy in the same file DepthRendering.cpp.

=> Finally, return FBoundShaderStateInput(VertexDeclaration, VertexShader->GetVertexShader(), FHullShaderRHIRef(), FDomainShaderRHIRef(), FPixelShaderRHIRef(), FGeometryShaderRHIRef());

In file./Engine/Source/Runtime/Renderer/Private/DepthRendering.cpp

Line 512, one of paramter VertexDeclaration should take the blame for this bug. Because if I replace this VertexDeclaration with FMeshDrawingPolicy::GetVertexDeclaration() which directly use method in the base class of FPositionOnlyDepthDrawingPolicy, blink stops.


Older

I have located one possible line which could lead to this problem. In file: ./Engine/Source/Runtime/Engine/Private/PrimitiveDrawingUtils.cpp Line 1319: !ViewFamily.EngineShowFlags.IndirectLightingCache || in method bool IsRichView(const FSceneViewFamily& ViewFamily);

When I change this line into ViewFamily.EngineShowFlags.IndirectLightingCache || which force IsRichView to true if IndirectLightingCache is set or move ViewFamily.EngineShowFlags.IndirectLightingCache || into next IF block, rebuild UE4.15 with Xcode. And blink stops.

Why a view is rich if is missing the EngineShowFlags.IndirectLightingCache? Shouldn’t be reversed? Isn’t IndirectLightingCache a rich view feature?

And still, it won’t solve the collateral damage mentioned in the last answer this page. After I rebuild lights, blinks starts again.

Another Question: what happens after I click build light only?

Published inUnrealEngine

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

http://next.sh/wp-content/smilies/icon_confused.gif 
http://next.sh/wp-content/smilies/icon_cool.gif 
http://next.sh/wp-content/smilies/icon_cry.gif 
http://next.sh/wp-content/smilies/icon_eek.gif 
http://next.sh/wp-content/smilies/icon_evil.gif 
http://next.sh/wp-content/smilies/icon_exclaim.gif 
http://next.sh/wp-content/smilies/icon_idea.gif 
http://next.sh/wp-content/smilies/icon_mad.gif 
http://next.sh/wp-content/smilies/icon_mrgreen.gif 
http://next.sh/wp-content/smilies/icon_neutral.gif 
http://next.sh/wp-content/smilies/icon_question.gif 
http://next.sh/wp-content/smilies/icon_razz.gif 
http://next.sh/wp-content/smilies/icon_redface.gif 
http://next.sh/wp-content/smilies/icon_rolleyes.gif 
http://next.sh/wp-content/smilies/icon_sad.gif 
http://next.sh/wp-content/smilies/icon_smile.gif 
http://next.sh/wp-content/smilies/icon_arrow.gif 
http://next.sh/wp-content/smilies/icon_biggrin.gif 
http://next.sh/wp-content/smilies/icon_surprised.gif 
http://next.sh/wp-content/smilies/icon_twisted.gif 
http://next.sh/wp-content/smilies/10.gif 
http://next.sh/wp-content/smilies/102.gif 
http://next.sh/wp-content/smilies/103.gif 
http://next.sh/wp-content/smilies/106.gif 
http://next.sh/wp-content/smilies/108.gif 
http://next.sh/wp-content/smilies/20.gif 
http://next.sh/wp-content/smilies/26.gif 
http://next.sh/wp-content/smilies/37.gif 
http://next.sh/wp-content/smilies/99.gif