本文整理汇总了C++中mhwrender::MRenderer::setLightRequiresShadows方法的典型用法代码示例。如果您正苦于以下问题:C++ MRenderer::setLightRequiresShadows方法的具体用法?C++ MRenderer::setLightRequiresShadows怎么用?C++ MRenderer::setLightRequiresShadows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mhwrender::MRenderer
的用法示例。
在下文中一共展示了MRenderer::setLightRequiresShadows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//.........这里部分代码省略.........
// Get the actually Maya light node
MStatus status = MStatus::kFailure;
MDagPath lightPath = lightInfo->lightPath(&status);
if (status != MStatus::kSuccess || !lightPath.isValid())
continue;
// Would be good to have an API method here to indicate if it
// casts shadows
MIntArray intVals;
// Check if light is enabled, and emits any lighting
MHWRender::MLightParameterInformation::StockParameterSemantic semantic =
MHWRender::MLightParameterInformation::kLightEnabled;
if (MStatus::kSuccess == lightInfo->getParameter( semantic, intVals ))
{
if (intVals.length())
{
if (intVals[0] == 0)
continue;
}
}
semantic = MHWRender::MLightParameterInformation::kEmitsDiffuse;
if (MStatus::kSuccess == lightInfo->getParameter( semantic, intVals ))
{
if (intVals.length())
{
if (intVals[0] == 0)
continue;
}
}
semantic = MHWRender::MLightParameterInformation::kEmitsSpecular;
if (MStatus::kSuccess == lightInfo->getParameter( semantic, intVals ))
{
if (intVals.length())
{
if (intVals[0] == 0)
continue;
}
}
// Check if local shadows are enabled.
semantic = MHWRender::MLightParameterInformation::kShadowOn;
if (MStatus::kSuccess == lightInfo->getParameter( semantic, intVals ))
{
if (intVals.length())
{
if (intVals[0] == 0)
continue;
}
}
// Check if the shadow is "dirty"
bool shadowIsDirty = false;
semantic = MHWRender::MLightParameterInformation::kShadowDirty;
if (MStatus::kSuccess == lightInfo->getParameter( semantic, intVals ))
{
if (intVals.length())
{
if (intVals[0] == 0)
// continue;
shadowIsDirty = intVals[0] != 0 ? true : false ;
}
}
// Check the light list to prune, if not already pruned
bool prune = false;
if (lightingMode != MHWRender::MDrawContext::kSelectedLights)
{
if (mLightList && mLightList->length())
{
prune = !mLightList->hasItem(lightInfo->lightPath());
}
}
static bool debugShadowRequests = false;
// Set that we require shadows for this light
if (!prune)
{
if (debugShadowRequests)
fprintf(stderr, "QUEUE light shadows for %s, shadowDirty = %d\n",
lightPath.fullPathName().asChar(), shadowIsDirty);
theRenderer->setLightRequiresShadows( lightPath.node(), true );
}
// Set that we DON'T require shadows for this light
else
{
if (debugShadowRequests)
fprintf(stderr, "DEQUEUE light shadows for %s, shadowDirty = %d\n",
lightPath.fullPathName().asChar(), shadowIsDirty);
theRenderer->setLightRequiresShadows( lightPath.node(), false );
}
}
return MStatus::kSuccess;
}