mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 14:55:39 +00:00
emissive to recivesShadows
now we've got a glow mask and multiplier, ditch the emissive flag in favor of a proper recivesShadows
This commit is contained in:
parent
54a2235128
commit
645f88d4af
20 changed files with 70 additions and 114 deletions
|
|
@ -384,8 +384,7 @@ bool MatInstance::processMaterial()
|
|||
mUsesHardwareSkinning = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||
|
||||
mIsForwardLit = ( custMat && custMat->mForwardLit ) ||
|
||||
( !finalFeatures.hasFeature( MFT_IsEmissive ) &&
|
||||
finalFeatures.hasFeature( MFT_ForwardShading ) );
|
||||
( finalFeatures.hasFeature( MFT_ForwardShading ) );
|
||||
|
||||
mIsHardwareSkinned = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ Material::Material()
|
|||
mVertColor[i] = false;
|
||||
|
||||
mGlow[i] = false;
|
||||
mEmissive[i] = false;
|
||||
mReceiveShadows[i] = true;
|
||||
|
||||
mDetailScale[i].set(2.0f, 2.0f);
|
||||
|
||||
|
|
@ -345,7 +345,7 @@ void Material::initPersistFields()
|
|||
addField("subSurfaceRolloff", TypeF32, Offset(mSubSurfaceRolloff, Material), MAX_STAGES,
|
||||
"The 0 to 1 rolloff factor used in the subsurface scattering approximation.");
|
||||
|
||||
addField("emissive", TypeBool, Offset(mEmissive, Material), MAX_STAGES,
|
||||
addField("receiveShadows", TypeBool, Offset(mReceiveShadows, Material), MAX_STAGES,
|
||||
"Enables emissive lighting for the material.");
|
||||
|
||||
addField("doubleSided", TypeBool, Offset(mDoubleSided, Material),
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ public:
|
|||
F32 mSeqSegSize[MAX_STAGES];
|
||||
|
||||
bool mGlow[MAX_STAGES]; // entire stage glows
|
||||
bool mEmissive[MAX_STAGES];
|
||||
bool mReceiveShadows[MAX_STAGES];
|
||||
|
||||
Point2I mCellIndex[MAX_STAGES];
|
||||
Point2I mCellLayout[MAX_STAGES];
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ ImplementFeatureType( MFT_IsBC3nm, U32(-1), -1, true );
|
|||
ImplementFeatureType( MFT_IsBC5nm, U32(-1), -1, true);
|
||||
ImplementFeatureType( MFT_IsTranslucent, U32(-1), -1, true );
|
||||
ImplementFeatureType( MFT_IsTranslucentZWrite, U32(-1), -1, true );
|
||||
ImplementFeatureType( MFT_IsEmissive, U32(-1), -1, true );
|
||||
ImplementFeatureType( MFT_DiffuseMapAtlas, U32(-1), -1, true );
|
||||
ImplementFeatureType( MFT_NormalMapAtlas, U32(-1), -1, true );
|
||||
ImplementFeatureType( MFT_InterlacedDeferred, U32(-1), -1, true );
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ DeclareFeatureType( MFT_AlphaTest );
|
|||
DeclareFeatureType( MFT_NormalMap );
|
||||
DeclareFeatureType( MFT_RTLighting );
|
||||
|
||||
DeclareFeatureType( MFT_IsEmissive );
|
||||
DeclareFeatureType( MFT_SubSurface );
|
||||
DeclareFeatureType( MFT_LightMap );
|
||||
DeclareFeatureType( MFT_ToneMap );
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ BaseMatInstance * MaterialManager::createMeshDebugMatInstance(const LinearColorF
|
|||
debugMat = allocateAndRegister( meshDebugStr );
|
||||
|
||||
debugMat->mDiffuse[0] = meshColor;
|
||||
debugMat->mEmissive[0] = true;
|
||||
debugMat->mReceiveShadows[0] = false;
|
||||
}
|
||||
|
||||
BaseMatInstance *debugMatInstance = NULL;
|
||||
|
|
|
|||
|
|
@ -353,15 +353,10 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
if ( mMaterial->mAlphaTest )
|
||||
fd.features.addFeature( MFT_AlphaTest );
|
||||
|
||||
if (mMaterial->mEmissive[stageNum])
|
||||
{
|
||||
fd.features.addFeature(MFT_IsEmissive);
|
||||
}
|
||||
else
|
||||
if (mMaterial->isTranslucent())
|
||||
{
|
||||
fd.features.addFeature(MFT_RTLighting);
|
||||
if (mMaterial->isTranslucent())
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
}
|
||||
|
||||
if ( mMaterial->mAnimFlags[stageNum] )
|
||||
|
|
@ -1204,8 +1199,8 @@ void ProcessedShaderMaterial::_setShaderConstants(SceneRenderState * state, cons
|
|||
|
||||
// Deferred Shading: Determine Material Info Flags
|
||||
S32 matInfoFlags =
|
||||
(mMaterial->mEmissive[stageNum] ? 1 : 0) | //emissive
|
||||
(mMaterial->mSubSurface[stageNum] ? 2 : 0); //subsurface
|
||||
(mMaterial->mReceiveShadows[stageNum] ? 1 : 0) | //ReceiveShadows
|
||||
(mMaterial->mSubSurface[stageNum] ? 1 << 2 : 0); //subsurface
|
||||
mMaterial->mMatInfoFlags[stageNum] = matInfoFlags / 255.0f;
|
||||
shaderConsts->setSafe(handles->mMatInfoFlagsSC, mMaterial->mMatInfoFlags[stageNum]);
|
||||
if( handles->mAccuScaleSC->isValid() )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue