当前位置: 首页>>代码示例>>C++>>正文


C++ IDriver::setAmbientColor方法代码示例

本文整理汇总了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;
}
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:export_scene.cpp


注:本文中的IDriver::setAmbientColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。