Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only msaa #93

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/mayaHydra/mayaPlugin/renderOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion test/testUtils/mtohUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ def setUp(self):
# Maya is not closed/reset between each test of a test suite,
# so open a new file before each test to minimize leftovers
# from previous tests.
cmds.file(new=True, force=True)
cmds.file(new=True, force=True)
cmds.setAttr("hardwareRenderingGlobals.multiSampleEnable", True)

def setHdStormRenderer(self):
self.activeEditor = cmds.playblast(activeEditor=1)
cmds.modelEditor(
self.activeEditor, e=1,
rendererOverrideName=HD_STORM_OVERRIDE)
cmds.setAttr("hardwareRenderingGlobals.multiSampleEnable", True)
cmds.refresh(f=1)
self.delegateId = cmds.mayaHydra(renderer=HD_STORM,
sceneDelegateId="MayaHydraSceneDelegate")
Expand Down
Loading