Small workaround and fix to ensure line fade (alpha) displays correctly (#6733)

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
monroegm-disable-blank-issue-2
Tom Hulton-Harrop 4 years ago committed by GitHub
parent 98b0f206a0
commit 1a8b7aeb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -184,6 +184,10 @@ namespace AzToolsFramework
const float halfGridSquareCount = float(gridSquareCount) * 0.5f;
const float halfGridSize = halfGridSquareCount * squareSize;
const float fadeLineLength = cl_viewportFadeLineDistanceScale * squareSize;
// ensure AuxGeomDraw::OpacityType::Translucent render state is set
debugDisplay.SetAlpha(0.5f);
for (size_t lineIndex = 0; lineIndex <= gridSquareCount; ++lineIndex)
{
const float lineOffset = -halfGridSize + (lineIndex * squareSize);

@ -348,14 +348,7 @@ namespace AZ::AtomBridge
void AtomDebugDisplayViewportInterface::SetAlpha(float a)
{
m_rendState.m_color.SetA(a);
if (a < 1.0f)
{
m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Opaque;
}
else
{
m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Translucent;
}
m_rendState.m_opacityType = a < 1.0f ? AZ::RPI::AuxGeomDraw::OpacityType::Translucent : AZ::RPI::AuxGeomDraw::OpacityType::Opaque;
}
void AtomDebugDisplayViewportInterface::DrawQuad(

Loading…
Cancel
Save