本文整理汇总了C++中Pass::SetIsSM3方法的典型用法代码示例。如果您正苦于以下问题:C++ Pass::SetIsSM3方法的具体用法?C++ Pass::SetIsSM3怎么用?C++ Pass::SetIsSM3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pass
的用法示例。
在下文中一共展示了Pass::SetIsSM3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BeginLoad
bool Technique::BeginLoad(Deserializer& source)
{
passes_.Clear();
SetMemoryUse(sizeof(Technique));
SharedPtr<XMLFile> xml(new XMLFile(context_));
if (!xml->Load(source))
return false;
XMLElement rootElem = xml->GetRoot();
if (rootElem.HasAttribute("sm3"))
isSM3_ = rootElem.GetBool("sm3");
String globalVS = rootElem.GetAttribute("vs");
String globalPS = rootElem.GetAttribute("ps");
String globalVSDefines = rootElem.GetAttribute("vsdefines");
String globalPSDefines = rootElem.GetAttribute("psdefines");
// End with space so that the pass-specific defines can be appended
if (!globalVSDefines.Empty())
globalVSDefines += ' ';
if (!globalPSDefines.Empty())
globalPSDefines += ' ';
bool globalAlphaMask = false;
if (rootElem.HasAttribute("alphamask"))
globalAlphaMask = rootElem.GetBool("alphamask");
unsigned numPasses = 0;
XMLElement passElem = rootElem.GetChild("pass");
while (passElem)
{
if (passElem.HasAttribute("name"))
{
StringHash nameHash(passElem.GetAttribute("name"));
Pass* newPass = CreatePass(nameHash);
++numPasses;
if (passElem.HasAttribute("sm3"))
newPass->SetIsSM3(passElem.GetBool("sm3"));
// Append global defines only when pass does not redefine the shader
if (passElem.HasAttribute("vs"))
{
newPass->SetVertexShader(passElem.GetAttribute("vs"));
newPass->SetVertexShaderDefines(passElem.GetAttribute("vsdefines"));
}
else
{
newPass->SetVertexShader(globalVS);
newPass->SetVertexShaderDefines(globalVSDefines + passElem.GetAttribute("vsdefines"));
}
if (passElem.HasAttribute("ps"))
{
newPass->SetPixelShader(passElem.GetAttribute("ps"));
newPass->SetPixelShaderDefines(passElem.GetAttribute("psdefines"));
}
else
{
newPass->SetPixelShader(globalPS);
newPass->SetPixelShaderDefines(globalPSDefines + passElem.GetAttribute("psdefines"));
}
if (passElem.HasAttribute("lighting"))
{
String lighting = passElem.GetAttributeLower("lighting");
newPass->SetLightingMode((PassLightingMode)GetStringListIndex(lighting.CString(), lightingModeNames,
LIGHTING_UNLIT));
}
if (passElem.HasAttribute("blend"))
{
String blend = passElem.GetAttributeLower("blend");
newPass->SetBlendMode((BlendMode)GetStringListIndex(blend.CString(), blendModeNames, BLEND_REPLACE));
}
if (passElem.HasAttribute("depthtest"))
{
String depthTest = passElem.GetAttributeLower("depthtest");
if (depthTest == "false")
newPass->SetDepthTestMode(CMP_ALWAYS);
else
newPass->SetDepthTestMode((CompareMode)GetStringListIndex(depthTest.CString(), compareModeNames, CMP_LESS));
}
if (passElem.HasAttribute("depthwrite"))
newPass->SetDepthWrite(passElem.GetBool("depthwrite"));
if (passElem.HasAttribute("alphamask"))
newPass->SetAlphaMask(passElem.GetBool("alphamask"));
else
newPass->SetAlphaMask(globalAlphaMask);
}
else
LOGERROR("Missing pass name");
passElem = passElem.GetNext("pass");
}
// Calculate memory use now
//.........这里部分代码省略.........