NiagaraRenderableMesh falsely warns on Cook with nanite fallback disabled

Hello,

we’re being spammed by niagara warning about missing fallbacks meshs for nanite meshes while Cooking.

Said log comes from NiagaraMeshRendererProperties.cpp line 260 and looks like (btw system name is always “None” but it’s not my issue there)

> LogNiagara: Warning: NiagaraRenderableMesh does not have a fallback mesh. Enable Nanite fallback mesh to fix this issue. System: None, Mesh: StaticMesh <mesh path>

NiagaraMeshRendererPropertiesInternal::IsStaticMeshSafeToUse is using HasNaniteFallbackMesh to detect & warn about missing fallbacks (wich is nice to pinpoint errors).

But this calls goes down to FStaticMeshRenderData::HasNaniteFallbackMesh that check bForceGenerateNaniteFallbackMesh, while cooking this value is never initialized as FStaticMeshRenderData::InitResources is not called.

I modified the code like this to prevent being misleaded about real asset settings error

bool FStaticMeshRenderData::HasNaniteFallbackMesh(EShaderPlatform ShaderPlatform) const
{
  checkf(HasValidNaniteData(), TEXT("Should only call HasNaniteFallbackMesh(...) if HasValidNaniteData() returns true."));
 
#if WITH_EDITORONLY_DATA
  // fallback meshes are always available in editor
  // so here we emulate the value for the requested platform
  if (AreNaniteFallbackMeshesEnabledForPlatform(ShaderPlatform))
  {
    return true;
  }
//@CYA EDIT while cooking bForceGenerateNaniteFallbackMesh is not initialized but bHasNaniteFallbackMesh has a valid value
  return bForceGenerateNaniteFallbackMesh || bHasNaniteFallbackMesh;
//@CYA END
#else
  return bHasNaniteFallbackMesh;
#endif
}

Is that change valid or did i broke something under the hood ?

A better fix would be to find the right place to update bForceGenerateNaniteFallbackMesh value when InitResources is not called but i’m not sure where to add this.

Regards

[Attachment Removed]

Steps to Reproduce

  1. disable nanite fallbacks for current platform
  2. create a nanite mesh, force nanite fallback enabled for it
  3. create a niagara system using the given mesh
  4. cook your project
  5. the log will warn “NiagaraRenderableMesh does not have a fallback mesh. Enable Nanite fallback mesh to fix this issue.”
    [Attachment Removed]

already found out the edit should check about cooking as everything always return true in editor with my previous fix

//@CYA EDIT while cooking bForceGenerateNaniteFallbackMesh is not initialized but bHasNaniteFallbackMesh has a valid value
	return bForceGenerateNaniteFallbackMesh || (IsRunningCookCommandlet() && bHasNaniteFallbackMesh);
//@CYA END

[Attachment Removed]

Hi Colas,

Thanks for the report, I’m not 100% sure if we should be fixing this only inside Niagara or not, so I’m going to pass it onto Tiago to confirm.

Thanks,

Stu

[Attachment Removed]

Hi Colas!

This was indeed an issue on the validation code for this condition. I’ve submitted a change to fix it: https://github.com/EpicGames/UnrealEngine/commit/72e0fc477d0f6f2a45ccae5e2a3dc4ca9010846d

Cheers,

Tiago

[Attachment Removed]

Hi Tiago,

thanks for letting us know about the official fix, i’m glad i won’t have to port this engine edit to 5.8 later in 2026 !

You can safely close this question.

Regards

[Attachment Removed]