Where does Unreal determine the LOD to render?

Hey there,

I’m currently looking for the code that determines the LOD to actually render based on the screensize defined for an LOD and the actual screen size of the object depending on the objects bounding box. Like in the static mesh editor, in case LOD is set to auto, unreal changes the displayed LOD based on the camera distance to the object. I looked around the code, found FStaticMeshEditor, FStaticMeshEditorViewportClient. I found all the overlay stuff like the text, display of normals/tangents/bitangents etc, but im unable to find the code segment that determines the LOD to display based on the setting “auto”.
Also been to UStaticMeshComponent, UStaticMesh, UStaticMesh::RenderData->LODResources.

Can anybody help out here?

Ok, seems I found it.

SceneManagement.h
ComputeStaticMeshLOD(…)
ComputeLODForMeshes(…)

Have you found a way to force a particular object to max LOD? Been looking for that for a while …

This should work but it does nothing (apparently),


UStaticMeshComponent->SetForcedLodModel(1);

[USER=“129723”]Jocko Jonson[/USER]

Are you sure it doesn’t work? It’s evaluated in two places and should work:



FStaticMeshSceneProxy::GetLODMask(const FSceneView* View) const
FStaticMeshSceneProxy::DrawStaticElements(FStaticPrimitiveDrawInterface* PDI)


What version of Unreal are you on?

Latest version. Even tried calling it every frame in the Tick() function and it doesn’t seem to do anything. :frowning:

Do you use a custom engine?
Are you sure your mesh has LOD setup? Screenshot of static mesh editor.