UVEditor: Fix issue where selection triangles would disappear in and out of view as the camera moved. This fix adjusts the TranslucentSortPriority of the selection TriangleSet to keep it above the 2D wireframe mesh below.

#rb michael.balzer
#rnx
#preflight 61a6a9c3003ada03045f80c2

#ROBOMERGE-AUTHOR: nathan.mitchell
#ROBOMERGE-SOURCE: CL 18340472 in //UE5/Release-5.0/... via CL 18340481
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18340485 by nathan mitchell in ue5-release-engine-test branch]
This commit is contained in:
nathan mitchell
2021-12-01 11:59:56 -05:00
parent e7bad85c0d
commit 5a3c35420f
2 changed files with 20 additions and 7 deletions
@@ -296,6 +296,9 @@ void UMeshSelectionMechanic::Setup(UInteractiveTool* ParentToolIn)
ClearCurrentSelection();
TriangleSet = NewObject<UTriangleSetComponent>();
// We are setting the TranslucencySortPriority here to handle the UV editor's use case in 2D
// where multiple translucent layers are drawn on top of each other but still need depth sorting.
TriangleSet->TranslucencySortPriority = VisualizationStyle.TriangleDepthBias;
TriangleSetMaterial = ToolSetupUtil::GetCustomTwoSidedDepthOffsetMaterial(GetParentTool()->GetToolManager(),
VisualizationStyle.TriangleColor, VisualizationStyle.TriangleDepthBias, VisualizationStyle.TriangleOpacity);
@@ -392,6 +395,12 @@ void UMeshSelectionMechanic::SetVisualizationStyle(const FMeshSelectionMechanicS
{
VisualizationStyle = StyleIn;
if (TriangleSet) {
// We are setting the TranslucencySortPriority here to handle the UV editor's use case in 2D
// where multiple translucent layers are drawn on top of each other but still need depth sorting.
TriangleSet->TranslucencySortPriority = VisualizationStyle.TriangleDepthBias;
}
if (TriangleSetMaterial) {
TriangleSetMaterial->SetVectorParameterValue(TEXT("Color"), VisualizationStyle.TriangleColor);
TriangleSetMaterial->SetScalarParameterValue(TEXT("Opacity"), VisualizationStyle.TriangleOpacity);