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 e621e362f4
commit 65cbf49c4a
24 changed files with 95 additions and 100 deletions

View file

@ -56,20 +56,20 @@ void DeferredSpecMapHLSL::processPix( Vector<ShaderComponent*> &componentList, c
}
// create texture var
Var *specularMap = new Var;
specularMap->setType( "SamplerState" );
specularMap->setName( "specularMap" );
specularMap->uniform = true;
specularMap->sampler = true;
specularMap->constNum = Var::getTexUnitNum();
Var * pbrConfigMap = new Var;
pbrConfigMap->setType( "SamplerState" );
pbrConfigMap->setName( "PBRConfigMap" );
pbrConfigMap->uniform = true;
pbrConfigMap->sampler = true;
pbrConfigMap->constNum = Var::getTexUnitNum();
Var* specularMapTex = new Var;
specularMapTex->setName("specularMapTex");
specularMapTex->setType("Texture2D");
specularMapTex->uniform = true;
specularMapTex->texture = true;
specularMapTex->constNum = specularMap->constNum;
LangElement *texOp = new GenOp(" @.Sample(@, @)", specularMapTex, specularMap, texCoord);
Var* pbrConfigMapTex = new Var;
pbrConfigMapTex->setName("PBRConfigMapTex");
pbrConfigMapTex->setType("Texture2D");
pbrConfigMapTex->uniform = true;
pbrConfigMapTex->texture = true;
pbrConfigMapTex->constNum = pbrConfigMap->constNum;
LangElement *texOp = new GenOp(" @.Sample(@, @)", pbrConfigMapTex, pbrConfigMap, texCoord);
Var * pbrConfig = (Var*)LangElement::find("pbrConfig");
if (!pbrConfig) pbrConfig = new Var("pbrConfig", "float4");
@ -103,11 +103,11 @@ void DeferredSpecMapHLSL::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;
}
}
@ -200,4 +200,4 @@ void DeferredEmissiveHLSL::processPix(Vector<ShaderComponent*> &componentList, c
}
output = new GenOp("@ = float4(@.rgb,0);", sceneColorVar, diffuseTargetVar);
}
}