mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-01 19:43:49 +00:00
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:
parent
e621e362f4
commit
65cbf49c4a
24 changed files with 95 additions and 100 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue