本文整理汇总了C++中TextureParams::FindString方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureParams::FindString方法的具体用法?C++ TextureParams::FindString怎么用?C++ TextureParams::FindString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureParams
的用法示例。
在下文中一共展示了TextureParams::FindString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Reference<Material> MakeMaterial(const string &name,
const Transform &mtl2world,
const TextureParams &mp) {
Material *material = NULL;
if (name == "matte")
material = CreateMatteMaterial(mtl2world, mp);
else if (name == "plastic")
material = CreatePlasticMaterial(mtl2world, mp);
else if (name == "translucent")
material = CreateTranslucentMaterial(mtl2world, mp);
else if (name == "glass")
material = CreateGlassMaterial(mtl2world, mp);
else if (name == "mirror")
material = CreateMirrorMaterial(mtl2world, mp);
else if (name == "mix") {
string m1 = mp.FindString("namedmaterial1", "");
string m2 = mp.FindString("namedmaterial2", "");
Reference<Material> mat1 = graphicsState.namedMaterials[m1];
Reference<Material> mat2 = graphicsState.namedMaterials[m2];
if (!mat1) {
Error("Named material \"%s\" undefined. Using \"matte\"",
m1.c_str());
mat1 = MakeMaterial("matte", curTransform[0], mp);
}
if (!mat2) {
Error("Named material \"%s\" undefined. Using \"matte\"",
m2.c_str());
mat2 = MakeMaterial("matte", curTransform[0], mp);
}
material = CreateMixMaterial(mtl2world, mp, mat1, mat2);
}
else if (name == "metal")
material = CreateMetalMaterial(mtl2world, mp);
else if (name == "substrate")
material = CreateSubstrateMaterial(mtl2world, mp);
else if (name == "uber")
material = CreateUberMaterial(mtl2world, mp);
else if (name == "skin")
material = CreateSkinMaterial(mtl2world, mp);
else if (name == "skindj")
material = CreateSkinDJMaterial(mtl2world, mp);
else if (name == "subsurface")
material = CreateSubsurfaceMaterial(mtl2world, mp);
else if (name == "skinsubsurface")
material = CreateSkinSubsurfaceMaterial(mtl2world, mp);
else if (name == "kdsubsurface")
material = CreateKdSubsurfaceMaterial(mtl2world, mp);
else if (name == "measured")
material = CreateMeasuredMaterial(mtl2world, mp);
else if (name == "shinymetal")
material = CreateShinyMetalMaterial(mtl2world, mp);
else
Warning("Material \"%s\" unknown.", name.c_str());
mp.ReportUnused();
if (!material) Error("Unable to create material \"%s\"", name.c_str());
return material;
}
示例2: if
std::shared_ptr<Material> MakeMaterial(const std::string &name,
const TextureParams &mp) {
Material *material = nullptr;
if (name == "" || name == "none")
return nullptr;
else if (name == "matte")
material = CreateMatteMaterial(mp);
else if (name == "plastic")
material = CreatePlasticMaterial(mp);
else if (name == "translucent")
material = CreateTranslucentMaterial(mp);
else if (name == "glass")
material = CreateGlassMaterial(mp);
else if (name == "hair")
material = CreateHairMaterial(mp);
else if (name == "mirror")
material = CreateMirrorMaterial(mp);
else if (name == "mix") {
std::string m1 = mp.FindString("namedmaterial1", "");
std::string m2 = mp.FindString("namedmaterial2", "");
std::shared_ptr<Material> mat1 = graphicsState.namedMaterials[m1];
std::shared_ptr<Material> mat2 = graphicsState.namedMaterials[m2];
if (!mat1) {
Error("Named material \"%s\" undefined. Using \"matte\"",
m1.c_str());
mat1 = MakeMaterial("matte", mp);
}
if (!mat2) {
Error("Named material \"%s\" undefined. Using \"matte\"",
m2.c_str());
mat2 = MakeMaterial("matte", mp);
}
material = CreateMixMaterial(mp, mat1, mat2);
} else if (name == "metal")
material = CreateMetalMaterial(mp);
else if (name == "substrate")
material = CreateSubstrateMaterial(mp);
else if (name == "uber")
material = CreateUberMaterial(mp);
else if (name == "subsurface")
material = CreateSubsurfaceMaterial(mp);
else if (name == "kdsubsurface")
material = CreateKdSubsurfaceMaterial(mp);
else if (name == "fourier")
material = CreateFourierMaterial(mp);
else
Warning("Material \"%s\" unknown.", name.c_str());
if ((name == "subsurface" || name == "kdsubsurface") &&
(renderOptions->IntegratorName != "path" &&
(renderOptions->IntegratorName != "volpath")))
Warning(
"Subsurface scattering material \"%s\" used, but \"%s\" "
"integrator doesn't support subsurface scattering. "
"Use \"path\" or \"volpath\".",
name.c_str(), renderOptions->IntegratorName.c_str());
mp.ReportUnused();
if (!material) Error("Unable to create material \"%s\"", name.c_str());
return std::shared_ptr<Material>(material);
}