Description

This was found as a result of Licensees doing a Code Review of the Engine code. Here's the code snippet in question. It seems to be missing a line similar to Vertex->TangentY = InTangentY;.: 

int32 FDynamicMeshBuilder::AddVertex(
	const FVector& InPosition,
	const FVector2D& InTextureCoordinate,
	const FVector& InTangentX,
	const FVector& InTangentY,
	const FVector& InTangentZ,
	const FColor& InColor
	)
{
	int32 VertexIndex = VertexBuffer->Vertices.Num();
	FDynamicMeshVertex* Vertex = new(VertexBuffer->Vertices) FDynamicMeshVertex;
	Vertex->Position = InPosition;
	Vertex->TextureCoordinate[0] = InTextureCoordinate;
	Vertex->TangentX = InTangentX;
	Vertex->TangentZ = InTangentZ;
	Vertex->TangentZ.Vector.W = GetBasisDeterminantSignByte( InTangentX, InTangentY, InTangentZ );
	Vertex->Color = InColor;

	return VertexIndex;
}

This was tested in //UE4/Release-4.25 @ CL 14854745 and the code looks the same there, so not a Regression.
 

 

Steps to Reproduce
  1. Open the UE4.sln file
  2. In the Solution Explorer search for DynamicMeshBuilder.cpp
  3. Open DynamicMeshBuilder.cpp
  4. Ctrl+F to search for the AddVertex function

RESULT:

The InTangentY variable is declared but never given a value

EXPECTED:

Like the InTangentX and InTangentY variables, InTangentY would have a value passed to it

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-109991 in the post.

1
Login to Vote

Non-Issue
ComponentUE - Graphics Features
Affects Versions4.25plus4.26
Target Fix5.0
CreatedMar 4, 2021
ResolvedSep 1, 2021
UpdatedApr 27, 2022