mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
fix sun corona
by locking in the material feature variation to ensure it uses vertex lighting due to colorization, as well as a few other switches, and applying an explicit vs default stateblock blend do similar with moon so you don't have to set that to explicitly translucent either
This commit is contained in:
parent
674a7a0212
commit
d54de2a349
2 changed files with 23 additions and 1 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include "materials/baseMatInstance.h"
|
||||
#include "materials/sceneData.h"
|
||||
#include "math/util/matrixSet.h"
|
||||
#include "materials/materialFeatureTypes.h"
|
||||
|
||||
|
||||
IMPLEMENT_CO_NETOBJECT_V1(Sun);
|
||||
|
|
@ -454,7 +455,21 @@ void Sun::_initCorona()
|
|||
|
||||
if (mCoronaMaterialAsset.notNull())
|
||||
{
|
||||
mCoronaMatInst = MATMGR->createMatInstance(mCoronaMaterialAsset->getMaterialDefinitionName(), MATMGR->getDefaultFeatures(), getGFXVertexFormat<GFXVertexPCT>());
|
||||
FeatureSet features = MATMGR->getDefaultFeatures();
|
||||
features.removeFeature(MFT_RTLighting);
|
||||
features.removeFeature(MFT_Visibility);
|
||||
features.removeFeature(MFT_ReflectionProbes);
|
||||
features.addFeature(MFT_isBackground);
|
||||
features.addFeature(MFT_VertLit);
|
||||
|
||||
mCoronaMatInst = MATMGR->createMatInstance(mCoronaMaterialAsset->getMaterialDefinitionName(), features, getGFXVertexFormat<GFXVertexPCT>());
|
||||
|
||||
GFXStateBlockDesc desc;
|
||||
desc.setBlend(true);
|
||||
desc.setAlphaTest(true);
|
||||
desc.setZReadWrite(true, false);
|
||||
mCoronaMatInst->addStateBlockDesc(desc);
|
||||
mCoronaMatInst->init(features, getGFXVertexFormat<GFXVertexPCT>());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue