Skip to content

Commit

Permalink
Extra checks in static mesh render
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdanggg2 committed Feb 1, 2025
1 parent 370525e commit edbc4ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Src/D3D9RenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3869,6 +3869,11 @@ void UD3D9RenderDevice::renderStaticMeshActor(FSceneNode* frame, AActor* actor,
UStaticMesh* mesh = Cast<UStaticMesh>(actor->Mesh);
if (!mesh)
return;

mesh->SMTris.Load();
if (!mesh->SMTris.Num()) {
return;
}

//dout << "rendering actor " << actor->GetName() << std::endl;
XMMATRIX actorMatrix = XMMatrixIdentity();
Expand Down Expand Up @@ -3967,7 +3972,9 @@ void UD3D9RenderDevice::renderStaticMeshActor(FSceneNode* frame, AActor* actor,
FLOAT fatness = (actor->Fatness / 16.0) - 8.0;

// Calculate normals
mesh->CalcSMNormals();
if (!mesh->SMNormals.Num()) {
mesh->CalcSMNormals();
}

XMMATRIX screenSpaceMat = actorMatrix * FCoordToDXMat(frame->Uncoords);

Expand Down

0 comments on commit edbc4ae

Please sign in to comment.