A licensee has reported that the ZoomFactor variable inside of the DrawPoint function is being calculated incorrectly. It currently is calculated using the lesser of the projection matrix's horizontal or vertical scale. Later in the function when the point is being drawn, horizontal values are used in either case. This causes points to grow in size when the viewport is taller than it is wide.
This is where the ZoomFactor is calculated
Engine\Source\Runtime\Renderer\Private\DynamicPrimitiveDrawing.inl:
bool bIsPerspective = (ViewInfo->ViewMatrices.GetProjectionMatrix().M[3][3] < 1.0f) ? true : false; if( !bIsPerspective ) { const float ZoomFactor = FMath::Min<float>(View->ViewMatrices.GetProjectionMatrix().M[0][0], View->ViewMatrices.GetProjectionMatrix().M[1][1]); ScaledPointSize = ScaledPointSize / ZoomFactor; }
This is where the point is drawn:
Engine\Source\Runtime\Engine\Private\BatchedElements.cpp
// Generate vertices for the point such that the post-transform point size is constant. const uint32 ViewportMajorAxis = ViewportSizeX;//FMath::Max(ViewportSizeX, ViewportSizeY); const FVector WorldPointX = CameraX * Point.Size / ViewportMajorAxis * TransformedPosition.W; const FVector WorldPointY = CameraY * -Point.Size / ViewportMajorAxis * TransformedPosition.W;
The licensee proposes that this can be fixed by changing the following line:
const float ZoomFactor = FMath::Min<float>(View->ViewMatrices.ProjMatrix.M[0][0], View->ViewMatrices.ProjMatrix.M[1][1]);
to
const float ZoomFactor = View->ViewMatrices.ProjMatrix.M[0][0];
Regression?: No
This was present in 4.13 as well
Code issue - N/A
I am not able to find world outliner how to enable it?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
How does UMG set overlapping layouts?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
How can i modify the param name in EQS node
What method is used to fill polygonal regions when drawing spline mesh at run time?
Bullet replication problem. The players sees each other but does not see the bullet
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-42157 in the post.