Frequent crashes with Nanite Tessellation in UE 5.4.2 (Assertion failed: !RasterizerPass.ClusterComputeShader.IsNull())

Hi everyone :blush:,

After extensive testing and troubleshooting, I finally found a solution that works, at least on the test map I used to isolate the problem. Here’s a detailed breakdown of my findings and solution:

Steps Taken and Findings:

  1. Initial Hypothesis: Landscape Tessellation

    • Initially, I removed all meshes from the map and kept only the landscape with tessellation enabled. Surprisingly, the crashes stopped. This indicated that the issue might not be with the landscape tessellation itself but rather with specific meshes or materials.
  2. Isolating the Problematic Meshes

    • I reverted the changes and started removing actors and meshes from the scene one by one until the crashes stopped. This process helped isolate the problematic elements.
  3. Identifying the Culprit

  4. Validating the Solution

    • I reverted to the original scene setup before removing elements and applied the same shader fix. The crashes ceased entirely, and further testing (10x editor open/close cycles) confirmed stability.

Conclusion:

It appears that a shader error on the tree leaves, combined with enabled landscape tessellation, was causing the frequent crashes. While this solution worked for my test map, it may not be a universal fix for all projects. The takeaway here is to maintain clean and error-free materials in your project.

Automating Material Error Detection:

To prevent similar issues in the future, I wrote a quick Python script to recompile all materials in the project. This script helps identify any materials with errors, which can then be fixed to enhance overall project stability.

import unreal

asset_registry = unreal.AssetRegistryHelpers.get_asset_registry()
material_class_path = unreal.TopLevelAssetPath("/Script/Engine.Material")
assets_data = asset_registry.get_assets_by_path("/Game/", recursive=True, include_only_on_disk_assets=False)

for asset_data in assets_data:
    if asset_data.asset_class_path.package_name == material_class_path.package_name and asset_data.asset_class_path.asset_name == material_class_path.asset_name:
        material = unreal.EditorAssetLibrary.load_asset(asset_data.package_name)
        if material:
            unreal.MaterialEditingLibrary.recompile_material(material)

Running this script might take some time for large projects, but it’s worth it to catch and fix any material errors that could cause crashes.

I hope this helps anyone facing similar issues. If you have any further suggestions or solutions, please share them!

Thank you in advance!
Thomas Winged

3 Likes