本文整理汇总了C++中Shader::Illum方法的典型用法代码示例。如果您正苦于以下问题:C++ Shader::Illum方法的具体用法?C++ Shader::Illum怎么用?C++ Shader::Illum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shader
的用法示例。
在下文中一共展示了Shader::Illum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShadeWithBackground
void plPassMtl::ShadeWithBackground(ShadeContext &sc, Color background, bool useVtxAlpha /* = true */)
{
#if 1
// old
#if 0
Color lightCol,rescol, diffIllum0;
RGBA mval;
Point3 N0,P;
BOOL bumped = FALSE;
int i;
if (gbufID)
sc.SetGBufferID(gbufID);
if (sc.mode == SCMODE_SHADOW) {
float opac = 0.0;
for (i=0; i < NumSubTexmaps(); i++) {
if (SubTexmapOn(i)) {
hsMaxLayerBase *hsmLay = (hsMaxLayerBase *)GetSubTexmap(i);
opac += hsmLay->GetOpacity(t);
}
}
float f = 1.0f - opac;
sc.out.t = Color(f,f,f);
return;
}
N0 = sc.Normal();
P = sc.P();
#endif
TimeValue t = sc.CurTime();
Color color(0, 0, 0);
float alpha = 0.0;
// Evaluate Base layer
Texmap *map = fLayersPB->GetTexmap(kPassLayBase);
if (map && ( map->ClassID() == LAYER_TEX_CLASS_ID
|| map->ClassID() == STATIC_ENV_LAYER_CLASS_ID ) )
{
plLayerTex *layer = (plLayerTex*)map;
AColor evalColor = layer->EvalColor(sc);
color = evalColor;
alpha = evalColor.a;
}
// Evaluate Top layer, if it's on
if (fLayersPB->GetInt(kPassLayTopOn))
{
Texmap *map = fLayersPB->GetTexmap(kPassLayTop);
if (map && ( map->ClassID() == LAYER_TEX_CLASS_ID
|| map->ClassID() == STATIC_ENV_LAYER_CLASS_ID
|| map->ClassID() == ANGLE_ATTEN_LAYER_CLASS_ID) )
{
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer*)map;
AColor evalColor = layer->EvalColor(sc);
// Blend layers
if( !layer->DiscardColor() )
{
int blendType = fLayersPB->GetInt(kPassLayBlend);
switch (blendType)
{
case kBlendAdd:
color += evalColor * evalColor.a;
break;
case kBlendAlpha:
color = (1.0f - evalColor.a) * color + evalColor.a * evalColor;
break;
case kBlendMult:
color *= evalColor;
break;
default: // No blend...
color = evalColor;
break;
}
}
if( !layer->DiscardAlpha() )
{
int alphaType = fLayersPB->GetInt(kPassLayOutputBlend);
switch( alphaType )
{
case kAlphaMultiply:
alpha *= evalColor.a;
break;
case kAlphaAdd:
alpha += evalColor.a;
break;
case kAlphaDiscard:
default:
break;
}
}
}
}
#if 1
//.........这里部分代码省略.........