本文整理汇总了C++中PointLight::preCalc方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLight::preCalc方法的具体用法?C++ PointLight::preCalc怎么用?C++ PointLight::preCalc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLight
的用法示例。
在下文中一共展示了PointLight::preCalc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
void
Scene::preCalc()
{
Objects::iterator it;
for (it = m_objects.begin(); it != m_objects.end(); it++)
{
Object* pObject = *it;
pObject->preCalc();
}
Lights::iterator lit;
float total_wattage = 0.f;
for (lit = m_lights.begin(); lit != m_lights.end(); lit++)
{
PointLight* pLight = *lit;
pLight->preCalc();
total_wattage += pLight->wattage();
}
m_bvh.build(&m_objects);
delete g_global_illum_map;
g_global_illum_map = new Photon_map(m_global_photons);
delete g_caustics_map;
g_caustics_map = new Photon_map(m_caustics_photons);
g_caustics_map->setCaustics(true);
printf("Caustics map:\n");
sampleMap(g_caustics_map, m_caustics_photons, total_wattage);
printf("Global illum map:\n");
sampleMap(g_global_illum_map, m_global_photons, total_wattage);
}
示例2:
void
Scene::preCalc()
{
Objects::iterator it;
for (it = m_objects.begin(); it != m_objects.end(); it++)
{
Object* pObject = *it;
pObject->preCalc();
}
Lights::iterator lit;
for (lit = m_lights.begin(); lit != m_lights.end(); lit++)
{
PointLight* pLight = *lit;
pLight->preCalc();
}
m_bvh.build(&m_objects);
}