from @rextimmy new isbackground shader feature. used the same z=w trick we've done before to force things to render behind everything else. applied to fog

This commit is contained in:
AzaezelX 2020-07-14 14:08:12 -05:00
parent dda0cc9aa7
commit 454192ed02
8 changed files with 15 additions and 4 deletions

View file

@ -575,8 +575,10 @@ void SkyBox::_initRender()
mFogBandMat->mDoubleSided = true;
mFogBandMat->mEmissive[0] = true;
FeatureSet features = MATMGR->getDefaultFeatures();
features.addFeature(MFT_isBackground);
mFogBandMatInst = mFogBandMat->createMatInstance();
mFogBandMatInst->init( MATMGR->getDefaultFeatures(), getGFXVertexFormat<GFXVertexPC>() );
mFogBandMatInst->init(features, getGFXVertexFormat<GFXVertexPC>() );
}
void SkyBox::onStaticModified( const char *slotName, const char *newValue )
@ -609,6 +611,7 @@ void SkyBox::_initMaterial()
FeatureSet features = MATMGR->getDefaultFeatures();
features.removeFeature( MFT_RTLighting );
features.removeFeature( MFT_Visibility );
features.addFeature(MFT_isBackground);
features.addFeature(MFT_SkyBox);
// Now initialize the material.