add an ignoreLighting entry to materials

by request:, flag to utterly ignore lighting in favor of the base texture
This commit is contained in:
AzaezelX 2023-02-14 20:57:44 -06:00
parent f903140d22
commit 57037080b2
15 changed files with 78 additions and 9 deletions

View file

@ -162,6 +162,7 @@ Material::Material()
mGlow[i] = false;
mReceiveShadows[i] = true;
mIgnoreLighting[i] = false;
mDetailScale[i].set(2.0f, 2.0f);
@ -347,6 +348,9 @@ void Material::initPersistFields()
"The 0 to 1 rolloff factor used in the subsurface scattering approximation.");
addField("receiveShadows", TypeBool, Offset(mReceiveShadows, Material), MAX_STAGES,
"Shadows being cast onto the material.");
addField("ignoreLighting", TypeBool, Offset(mIgnoreLighting, Material), MAX_STAGES,
"Enables emissive lighting for the material.");
addField("doubleSided", TypeBool, Offset(mDoubleSided, Material),

View file

@ -306,6 +306,7 @@ public:
bool mGlow[MAX_STAGES]; // entire stage glows
bool mReceiveShadows[MAX_STAGES];
bool mIgnoreLighting[MAX_STAGES];
Point2I mCellIndex[MAX_STAGES];
Point2I mCellLayout[MAX_STAGES];

View file

@ -1200,7 +1200,9 @@ void ProcessedShaderMaterial::_setShaderConstants(SceneRenderState * state, cons
// Deferred Shading: Determine Material Info Flags
S32 matInfoFlags =
(mMaterial->mReceiveShadows[stageNum] ? 1 : 0) | //ReceiveShadows
(mMaterial->mSubSurface[stageNum] ? 1 << 2 : 0); //subsurface
(mMaterial->mSubSurface[stageNum] ? 1 << 2 : 0)| //subsurface
(mMaterial->mIgnoreLighting[stageNum] ? 1 << 3 : 0); //IgnoreLighting
mMaterial->mMatInfoFlags[stageNum] = matInfoFlags / 255.0f;
shaderConsts->setSafe(handles->mMatInfoFlagsSC, mMaterial->mMatInfoFlags[stageNum]);
if( handles->mAccuScaleSC->isValid() )