backend specularMap to PBRConfigMap alts.

left:
     addField( "specularMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
scripthook till last since that *will* break all current materials.
This commit is contained in:
AzaezelX 2019-10-16 15:51:02 -05:00
parent ec63be32e3
commit fe5a27906d
24 changed files with 95 additions and 100 deletions

View file

@ -390,7 +390,7 @@ void DeferredBumpFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
Parent::processPix( componentList, fd );
return;
}
else if (!fd.features[MFT_SpecularMap] )
else if (!fd.features[MFT_PBRConfigMap] )
{
Var *bumpSample = (Var *)LangElement::find( "bumpSample" );
if( bumpSample == NULL )
@ -421,7 +421,7 @@ ShaderFeature::Resources DeferredBumpFeatGLSL::getResources( const MaterialFeatu
return Parent::getResources( fd );
Resources res;
if(!fd.features[MFT_SpecularMap])
if(!fd.features[MFT_PBRConfigMap])
{
res.numTex = 1;
res.numTexReg = 1;
@ -464,7 +464,7 @@ void DeferredBumpFeatGLSL::setTexData( Material::StageData &stageDat,
passData.mTexSlot[texIndex++].texObject = stageDat.getTex(MFT_DetailNormalMap);
}
}
else if (!fd.features[MFT_Parallax] && !fd.features[MFT_SpecularMap] &&
else if (!fd.features[MFT_Parallax] && !fd.features[MFT_PBRConfigMap] &&
( fd.features[MFT_DeferredConditioner]) )
{
passData.mTexType[ texIndex ] = Material::Bump;

View file

@ -56,13 +56,13 @@ void DeferredSpecMapGLSL::processPix( Vector<ShaderComponent*> &componentList, c
}
// create texture var
Var *specularMap = new Var;
specularMap->setType( "sampler2D" );
specularMap->setName( "specularMap" );
specularMap->uniform = true;
specularMap->sampler = true;
specularMap->constNum = Var::getTexUnitNum();
LangElement *texOp = new GenOp( "tex2D(@, @)", specularMap, texCoord );
Var *pbrConfigMap = new Var;
pbrConfigMap->setType( "sampler2D" );
pbrConfigMap->setName( "PBRConfigMap" );
pbrConfigMap->uniform = true;
pbrConfigMap->sampler = true;
pbrConfigMap->constNum = Var::getTexUnitNum();
LangElement *texOp = new GenOp( "tex2D(@, @)", pbrConfigMap, texCoord );
Var *pbrConfig = (Var*)LangElement::find("PBRConfig");
if (!pbrConfig) pbrConfig = new Var("PBRConfig", "vec4");
@ -97,11 +97,11 @@ void DeferredSpecMapGLSL::setTexData( Material::StageData &stageDat,
RenderPassData &passData,
U32 &texIndex )
{
GFXTextureObject *tex = stageDat.getTex( MFT_SpecularMap );
GFXTextureObject *tex = stageDat.getTex(MFT_PBRConfigMap);
if ( tex )
{
passData.mTexType[ texIndex ] = Material::Standard;
passData.mSamplerNames[ texIndex ] = "specularMap";
passData.mSamplerNames[ texIndex ] = "PBRConfigMap";
passData.mTexSlot[ texIndex++ ].texObject = tex;
}
}