Hi there,
while messing around, with occlusion queries i discovered that Niagara systems stopped working when we disabled occlusions using r.AllowOcclusionQueries 0.
Digging a bit i found that UpdateComponentLastRenderTime is never called from FRelevancePacket::ComputeRelevance due to PrimitiveDefinitelyUnoccludedMap being initialized with 0 and never updated.
Can you guys confirm my fix is the right way to get correct Niagara rendering without occlusion queries ? It’s working but i’m not 100% certain it won’t have dramatic sides effects i didn’t notice.
// Update the last component render time only if we know for certain the primitive is un-occluded. //@CYA EDIT when occlusions are disabled use PrimitiveVisibilityMap instead of PrimitiveDefinitelyUnoccludedMap const bool bUnOccluded = View.PrimitiveVisibilityMap[BitIndex] && (!GOcclusionCullEnabled || View.PrimitiveDefinitelyUnoccludedMap[BitIndex]); if (bUnOccluded || View.Family->EngineShowFlags.Wireframe) //@CYA END { const bool bUpdateLastRenderTimeOnScreen = true; PrimitiveSceneInfo->UpdateComponentLastRenderTime(CurrentWorldTime, bUpdateLastRenderTimeOnScreen); }
Regards
Cø
Hi [mention removed],
Thanks for reporting the issue. I’ve confirmed that it’s occurring in version 5.5. I’ll test it against the latest internal work from the Epic devs to see if it has already been resolved.
If it has, I’ll reach out to Epic to identify the exact commit that includes the fix so you can integrate it on your end.
If it hasn’t been addressed yet, I’ll report it to Epic so they can prioritize a fix. We’ll also provide a link to the public bug tracker so you can monitor its progress.
Best regards,
Joan
Hi Joan,
we’re gonna ship on 5.5 so i’m fine with my custom hotfix for now, i’m glad the issue is fixed for our other projects that will upgrade to 5.6.
Regards.
Posting to keep the ticket open and following up as we’re now running with my custom change for a while and saw no regression on Niagara culling.
Hi [mention removed],
I can confirm you that this issue appears to be resolved in the latest version of the Unreal Engine source code. It should already be addressed in UE 5.6. I’ve also reviewed the code snippet you provided, and it remains unchanged in the most recent version, which suggests the fix likely originated elsewhere in the engine.
Regarding your solution, it looks correct. Incorporating a check against the
VisibilityMap to determine if an object is unoccluded before updating the primitive’s last render time looks like a safe approach.
If you’d prefer to identify the exact changelist (CL) where this was fixed so you can add it directly to your engine, I can reach out to Epic for clarification. However, based on your code, the workaround seems safe.
Best regards,
Joan