shifts glowmap out of the composite and to it's own texture, as well as featureset. (GL port pending design finalization)

This commit is contained in:
AzaezelX 2019-11-01 19:29:31 -05:00
parent ac6fdf884e
commit d034895e8f
12 changed files with 180 additions and 198 deletions

View file

@ -128,7 +128,7 @@ Material::Material()
mSmoothnessChan[i] = 0;
mAOChan[i] = 1;
mMetalChan[i] = 2;
mGlowChan[i] = 3;
mAccuEnabled[i] = false;
mAccuScale[i] = 1.0f;
mAccuDirection[i] = 1.0f;
@ -325,8 +325,6 @@ void Material::initPersistFields()
addField("glowMap", TypeImageFilename, Offset(mGlowMapFilename, Material), MAX_STAGES,
"Metalness map. will be packed into the B channel of a packed 'specular' map");
addField("glowChan", TypeF32, Offset(mGlowChan, Material), MAX_STAGES,
"The input channel metalness maps use.");
addField("glowMul", TypeF32, Offset(mGlowMul, Material), MAX_STAGES,
"The input channel metalness maps use.");
addField("glow", TypeBool, Offset(mGlow, Material), MAX_STAGES,

View file

@ -256,7 +256,6 @@ public:
FileName mGlowMapFilename[MAX_STAGES];
StringTableEntry mGlowMapAssetId[MAX_STAGES];
AssetPtr<ImageAsset> mGlowMapAsset[MAX_STAGES];
F32 mGlowChan[MAX_STAGES];
F32 mGlowMul[MAX_STAGES];
/// A second normal map which repeats at the detail map
/// scale and blended with the base normal map.

View file

@ -47,7 +47,6 @@ ImplementFeatureType( MFT_InvertSmoothness, U32(-1), -1, true);
ImplementFeatureType( MFT_PBRConfigMap, MFG_Texture, 8.0f, true);
ImplementFeatureType( MFT_PBRConfigVars, MFG_Texture, 8.0f, true);
ImplementFeatureType( MFT_MatInfoFlags, MFG_Texture, 9.0f, true);
ImplementFeatureType( MFT_GlowMap, MFG_Texture, 10.0f, true );
ImplementFeatureType( MFT_NormalMap, MFG_Texture, 11.0f, true );
ImplementFeatureType( MFT_DetailNormalMap, MFG_Texture, 12.0f, true );
ImplementFeatureType( MFT_Imposter, U32(-1), -1, true );
@ -56,9 +55,10 @@ ImplementFeatureType( MFT_AccuMap, MFG_PreLighting, 2.0f, true );
ImplementFeatureType(MFT_ReflectionProbes, MFG_Lighting, 1.0f, true);
ImplementFeatureType( MFT_RTLighting, MFG_Lighting, 2.0f, true );
ImplementFeatureType( MFT_LightMap, MFG_Lighting, 3.0f, true );
ImplementFeatureType( MFT_ToneMap, MFG_Lighting, 4.0f, true );
ImplementFeatureType( MFT_VertLitTone, MFG_Lighting, 5.0f, false );
ImplementFeatureType( MFT_GlowMap, MFG_Lighting, 3.0f, true );
ImplementFeatureType( MFT_LightMap, MFG_Lighting, 4.0f, true );
ImplementFeatureType( MFT_ToneMap, MFG_Lighting, 5.0f, true );
ImplementFeatureType( MFT_VertLitTone, MFG_Lighting, 6.0f, false );
ImplementFeatureType( MFT_StaticCubemap, U32(-1), -1.0, true );
ImplementFeatureType( MFT_CubeMap, MFG_Lighting, 7.0f, true );
ImplementFeatureType( MFT_SubSurface, MFG_Lighting, 8.0f, true );
@ -104,7 +104,5 @@ ImplementFeatureType( MFT_ImposterVert, MFG_PreTransform, 1.0, false );
// Deferred Shading
ImplementFeatureType( MFT_isDeferred, U32(-1), -1, true );
ImplementFeatureType( MFT_SkyBox, MFG_Transform, 1.0f, false );
ImplementFeatureType( MFT_DeferredEmissive, MFG_Texture, 8.9f, false);
ImplementFeatureType( MFT_HardwareSkinning, MFG_Transform,-2.0, false );

View file

@ -192,5 +192,4 @@ DeclareFeatureType( MFT_HardwareSkinning );
DeclareFeatureType( MFT_isDeferred );
DeclareFeatureType( MFT_SkyBox );
DeclareFeatureType( MFT_MatInfoFlags );
DeclareFeatureType( MFT_DeferredEmissive );
#endif // _MATERIALFEATURETYPES_H_

View file

@ -487,14 +487,20 @@ void ProcessedMaterial::_setStageData()
inputKey[0] = mMaterial->mSmoothnessChan[i];
inputKey[1] = mMaterial->mAOChan[i];
inputKey[2] = mMaterial->mMetalChan[i];
inputKey[3] = mMaterial->mGlowChan[i];
inputKey[3] = 0;
mStages[i].setTex(MFT_PBRConfigMap, _createCompositeTexture(mMaterial->mRoughMapFilename[i], mMaterial->mAOMapFilename[i],
mMaterial->mMetalMapFilename[i], mMaterial->mGlowMapFilename[i],
mMaterial->mMetalMapFilename[i], "",
inputKey, profile));
if (!mStages[i].getTex(MFT_PBRConfigMap))
mMaterial->logError("Failed to load PBR Config map %s for stage %i", _getTexturePath(mMaterial->mPBRConfigMapFilename[i]).c_str(), i);
}
}
if (mMaterial->mGlowMapFilename[i].isNotEmpty())
{
mStages[i].setTex(MFT_GlowMap, _createTexture(mMaterial->mGlowMapFilename[i], &GFXStaticTextureProfile));
if (!mStages[i].getTex(MFT_GlowMap))
mMaterial->logError("Failed to load glow map %s for stage %i", _getTexturePath(mMaterial->mGlowMapFilename[i]).c_str(), i);
}
}
mMaterial->mCubemapData = dynamic_cast<CubemapData*>(Sim::findObject(mMaterial->mCubemapName));

View file

@ -437,8 +437,6 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
if (mStages[stageNum].getTex(MFT_PBRConfigMap))
{
fd.features.addFeature(MFT_PBRConfigMap);
if (mStages[stageNum].getTex(MFT_PBRConfigMap)->mHasTransparency)
fd.features.addFeature(MFT_GlowMap);
}
else
fd.features.addFeature(MFT_PBRConfigVars);