Grass doesn’t render in certain conditions (depending on AI character visibility)
RenderDoc shows no trace of grass when it’s not rendered
traverse function in FHierarchicalStaticMeshSceneProxy::GetDynamicMeshElement always gets called even when grass fails to show up
User wants to know what prevents mesh from showing up even if it’s added by GetDynamicMeshElements
Key Observations Made:
foliage.RebuildFoliageTrees command fixes the issue - this was the crucial clue
Only 2 out of 20 HISM components are affected - not a global issue
Directly tied to AI character actor visibility - toggle visibility = instant hide/show grass
The 2 affected HISM components are completely unrelated to the AI character - no parent-child relationship
Traverse function is called and adds instances - but nothing renders in RenderDoc
HISMCOcclusionBounds don’t change when issue occurs - bounds are intact
Theories We Investigated and Ruled Out:
Theory 1: Engine Show Flags Issue
Premise: View->Family->EngineShowFlags.InstancedGrass was being disabled
What we tested: Added logging in GetViewRelevance to check show flags
Why it’s wrong: Only 2 out of 20 HISM components affected, not all grass globally
Evidence: Global show flags would affect all grass, not just specific components
Theory 2: HISM Data Structure Corruption
Premise: InstanceReorderTable, NumBuiltInstances, or ClusterTree corruption
What we tested: Added debugging in BuildTreeIfOutdated to check data integrity
Why it’s wrong: Issue is immediate (toggle visibility = instant hide/show), not gradual corruption
Evidence: Data corruption would require rebuilding, not instant visibility changes
Theory 3: Material/Shader Compilation Issues
Premise: Grass material compilation problems or shader errors
What we tested: Checked for material compilation status and shader errors
Why it’s wrong: foliage.RebuildFoliageTrees fixes it without recompiling materials
Evidence: Shader issues wouldn’t be fixed by rebuilding the tree
Theory 4: Frustum/Occlusion Culling Issues
Premise: CullNode, OcclusionResults, or frustum culling preventing rendering
What we tested: Analyzed culling logic in Traverse and CullNode functions
Why it’s wrong: User confirmed Traverse is called and adds instances, but nothing renders
Evidence: Culling issues would prevent Traverse from being called at all
Theory 5: LOD/Distance Culling Issues
Premise: FinalCullDistance, LODPlanes, or distance calculations culling grass
What we tested: Examined LOD calculation logic and distance culling
Why it’s wrong: Immediate visibility toggle suggests it’s not distance-based
Evidence: Distance culling wouldn’t be instantly toggled by actor visibility
Theory 6: Global Rendering Pipeline Issues
Premise: Render state, depth testing, or GPU issues affecting rendering
What we tested: Checked render state and GPU-related issues
Why it’s wrong: Only affects 2 specific HISM components, not all rendering
Evidence: Global rendering issues would affect all components, not just 2
What We Know For Certain:
Traverse is called - mesh elements are added to collector
Nothing appears in RenderDoc - elements are added but not rendered
foliage.RebuildFoliageTrees fixes it - Running this command fixes it, but when restarting the editor the issue comes back. Even saving the level doesn’t work, we have to manually call it again during runtime to make it go away temporarily.
Only 2 out of 20 HISM components affected - not global issue. There are 20 components on 1 actor. And only 2 of the 20 HISM components have this flicker issue
Directly tied to AI character actor visibility - immediate toggle effect
Components are completely unrelated to AI character - no parent-child relationship
HISMCOcclusionBounds don’t change - bounds are intact, issue is not in tree structure