本文整理汇总了C++中IDriver::setAmbientColor方法的典型用法代码示例。如果您正苦于以下问题:C++ IDriver::setAmbientColor方法的具体用法?C++ IDriver::setAmbientColor怎么用?C++ IDriver::setAmbientColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDriver
的用法示例。
在下文中一共展示了IDriver::setAmbientColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildScene
//.........这里部分代码省略.........
// Copy map to get info on shapes.
lightDesc.UserShapeMap= igShapeMap;
// Setup Shadow and overSampling.
lightDesc.Shadow= _Options.bShadow;
lightDesc.OverSampling= NLMISC::raiseToNextPowerOf2(_Options.nOverSampling);
clamp(lightDesc.OverSampling, 0U, 32U);
if(lightDesc.OverSampling==1)
lightDesc.OverSampling= 0;
// Setup LightDirection.
lightDesc.LightDirection= igSunDirection.normed();
// For interiors ig, disable Sun contrib according to ig.
lightDesc.DisableSunContribution= !ig->getRealTimeSunContribution();
// If View SurfaceLighting enabled
if(_Options.bTestSurfaceLighting)
{
// Setup a CSurfaceLightingInfo
slInfo.CellSurfaceLightSize= _Options.SurfaceLightingCellSize;
NLMISC::clamp(slInfo.CellSurfaceLightSize, 0.001f, 1000000.f);
slInfo.CellRaytraceDeltaZ= _Options.SurfaceLightingDeltaZ;
slInfo.ColIdentifierPrefix= "col_";
slInfo.ColIdentifierSuffix= "_";
}
// Light Ig.
CIgLighterLib::lightIg(maxInstanceLighter, *ig, *igOut, lightDesc, slInfo, "");
// Close the lighter.
maxInstanceLighter.closeMaxLighter();
// Swap pointer and release unlighted one.
swap(ig, igOut);
delete igOut;
}
// Add all models to the scene
ig->addToScene(scene, &driver);
// Unfreeze all objects from HRC.
ig->unfreezeHRC();
}
// *******************
// * Launch
// *******************
// ExportLighting?
if ( _Options.bExportLighting )
{
// Take the ambient of the scene as the ambient of the sun.
CRGBA sunAmb= getAmbientColor (tvTime);
// Disable Global ambient light
driver.setAmbientColor (CRGBA::Black);
scene.setAmbientGlobal(CRGBA::Black);
// setup lighting and sun, if any light added. Else use std OpenGL front lighting
scene.enableLightingSystem(true);
// Setup sun.
scene.setSunAmbient(sunAmb);
scene.setSunDiffuse(igSunColor);
scene.setSunSpecular(igSunColor);
scene.setSunDirection(igSunDirection);
}
else
{
/*
// Setup ambient light
driver.setAmbientColor (getAmbientColor (tvTime));
scene.setAmbientGlobal (getAmbientColor (tvTime));
// Build light vector
std::vector<CLight> vectLight;
getLights (vectLight, tvTime);
// Light in the scene ?
if (!vectLight.empty())
{
// Use old Driver Light mgt.
scene.enableLightingSystem(false);
scene.setSunAmbient(CRGBA::Black);
scene.setSunDiffuse(igSunColor);
scene.setSunSpecular(igSunColor);
scene.setSunDirection(igSunDirection);
// Insert each lights
for (uint light=0; light<vectLight.size(); light++)
{
driver.enableLight (light);
driver.setLight (light, vectLight[light]);
}
}
*/
}
_Options.FeedBack = NULL;
}