From 41517e9ec2bb4d710a1118c81b513caeff950c99 Mon Sep 17 00:00:00 2001 From: Rakesh R Date: Sat, 2 Mar 2024 22:06:55 -0500 Subject: [PATCH] only msaa --- lib/mayaHydra/mayaPlugin/renderOverride.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/mayaHydra/mayaPlugin/renderOverride.cpp b/lib/mayaHydra/mayaPlugin/renderOverride.cpp index 2a9b938e25..d56d4db218 100644 --- a/lib/mayaHydra/mayaPlugin/renderOverride.cpp +++ b/lib/mayaHydra/mayaPlugin/renderOverride.cpp @@ -624,6 +624,26 @@ MStatus MtohRenderOverride::Render( // Set Purpose tags SetRenderPurposeTags(delegateParams); + + // Maya's default MSAA toggle is set to off and that of Hydra's is on + // This code will change the default rendered look and might cause + // some of our unit test to fail. + // Set MSAA as per Maya AntiAliasing settings + if (_isUsingHdSt) + { + // Maya's MSAA toggle settings + bool isMultiSampled = framecontext->getPostEffectEnabled(MHWRender::MFrameContext::kAntiAliasing); + + // Set MSAA on Color Buffer + HdAovDescriptor colorAovDesc = _taskController->GetRenderOutputSettings(HdAovTokens->color); + colorAovDesc.multiSampled = isMultiSampled; + _taskController->SetRenderOutputSettings(HdAovTokens->color, colorAovDesc); + + // Set MSAA of Depth buffer + HdAovDescriptor depthAovDesc = _taskController->GetRenderOutputSettings(HdAovTokens->depth); + depthAovDesc.multiSampled = isMultiSampled; + _taskController->SetRenderOutputSettings(HdAovTokens->depth, depthAovDesc); + } _taskController->SetFreeCameraMatrices( GetGfMatrixFromMaya(