本文整理汇总了C++中Primitive::GetTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ Primitive::GetTexture方法的具体用法?C++ Primitive::GetTexture怎么用?C++ Primitive::GetTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Primitive
的用法示例。
在下文中一共展示了Primitive::GetTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalnDiffusion
Color Raytracer::CalnDiffusion( Collider* collider , int* hash, int rc, Color weight) {
Primitive* pri = collider->GetPrimitive();
Color color = pri->GetMaterial()->color;
if (pri->GetMaterial()->texture != NULL)
{
if (pri->getName() == 0)
color = color * pri->GetTexture(collider->C);
else
color = color * pri->GetTexture(Vector3(collider->u, collider->v, 0));
}
Color ret = color * scene->GetBackgroundColor() * pri->GetMaterial()->diff;
for ( Light* light = scene->GetLightHead() ; light != NULL ; light = light->GetNext() )
ret += color * light->GetIrradiance( collider , scene->GetPrimitiveHead() , scene->GetCamera()->GetShadeQuality() , hash );
if (camera->GetAlgorithm() == "PM")
ret += color * photonmap->GetIrradiance( collider , camera->GetSampleDist() , camera->GetSamplePhotons() );
if (camera->GetAlgorithm() == "PPM" || camera->GetAlgorithm() == "SPPM") {
Hitpoint hitpoint;
hitpoint.pos = collider->C;
hitpoint.dir = collider->I;
hitpoint.N = collider->N;
hitpoint.primitive = collider->GetPrimitive();
hitpoint.rc = rc;
hitpoint.weight = weight * color;
hitpoint.R2 = photonmap->GetRadius2(collider, camera->GetSampleDist(), camera->GetSamplePhotons());
hitpointMap->Store(hitpoint);
}
return ret;
}