|
|
@ -1374,6 +1374,7 @@ namespace NifOsg
|
|
|
|
case Nif::NiTexturingProperty::DarkTexture:
|
|
|
|
case Nif::NiTexturingProperty::DarkTexture:
|
|
|
|
case Nif::NiTexturingProperty::BumpTexture:
|
|
|
|
case Nif::NiTexturingProperty::BumpTexture:
|
|
|
|
case Nif::NiTexturingProperty::DetailTexture:
|
|
|
|
case Nif::NiTexturingProperty::DetailTexture:
|
|
|
|
|
|
|
|
case Nif::NiTexturingProperty::DecalTexture:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Nif::NiTexturingProperty::GlossTexture:
|
|
|
|
case Nif::NiTexturingProperty::GlossTexture:
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1382,11 +1383,6 @@ namespace NifOsg
|
|
|
|
std::cerr << "NiTexturingProperty::GlossTexture in " << mFilename << " not currently used." << std::endl;
|
|
|
|
std::cerr << "NiTexturingProperty::GlossTexture in " << mFilename << " not currently used." << std::endl;
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case Nif::NiTexturingProperty::DecalTexture:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cerr << "NiTexturingProperty::DecalTexture in " << mFilename << " not currently used." << std::endl;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Warning: unhandled texture stage " << i << " in " << mFilename << std::endl;
|
|
|
|
std::cerr << "Warning: unhandled texture stage " << i << " in " << mFilename << std::endl;
|
|
|
@ -1454,6 +1450,21 @@ namespace NifOsg
|
|
|
|
// Set this texture to Off by default since we can't render it with the fixed-function pipeline
|
|
|
|
// Set this texture to Off by default since we can't render it with the fixed-function pipeline
|
|
|
|
stateset->setTextureMode(texUnit, GL_TEXTURE_2D, osg::StateAttribute::OFF);
|
|
|
|
stateset->setTextureMode(texUnit, GL_TEXTURE_2D, osg::StateAttribute::OFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (i == Nif::NiTexturingProperty::DecalTexture)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
osg::TexEnvCombine* texEnv = new osg::TexEnvCombine;
|
|
|
|
|
|
|
|
texEnv->setCombine_RGB(GL_INTERPOLATE);
|
|
|
|
|
|
|
|
texEnv->setSource0_RGB(GL_TEXTURE);
|
|
|
|
|
|
|
|
texEnv->setOperand0_RGB(GL_SRC_COLOR);
|
|
|
|
|
|
|
|
texEnv->setSource1_RGB(GL_PREVIOUS_ARB);
|
|
|
|
|
|
|
|
texEnv->setOperand1_RGB(GL_SRC_COLOR);
|
|
|
|
|
|
|
|
texEnv->setSource2_RGB(GL_TEXTURE);
|
|
|
|
|
|
|
|
texEnv->setOperand2_RGB(GL_SRC_ALPHA);
|
|
|
|
|
|
|
|
texEnv->setCombine_Alpha(GL_REPLACE);
|
|
|
|
|
|
|
|
texEnv->setSource0_Alpha(GL_PREVIOUS);
|
|
|
|
|
|
|
|
texEnv->setOperand0_Alpha(GL_SRC_ALPHA);
|
|
|
|
|
|
|
|
stateset->setTextureAttributeAndModes(texUnit, texEnv, osg::StateAttribute::ON);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch (i)
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1472,6 +1483,9 @@ namespace NifOsg
|
|
|
|
case Nif::NiTexturingProperty::DetailTexture:
|
|
|
|
case Nif::NiTexturingProperty::DetailTexture:
|
|
|
|
texture2d->setName("detailMap");
|
|
|
|
texture2d->setName("detailMap");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Nif::NiTexturingProperty::DecalTexture:
|
|
|
|
|
|
|
|
texture2d->setName("decalMap");
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|