mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +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
|
|
@ -59,7 +59,7 @@ void ShaderConstHandles::init( GFXShader *shader, Vector<CustomShaderFeatureData
|
|||
mDiffuseColorSC = shader->getShaderConstHandle("$diffuseMaterialColor");
|
||||
mTexMatSC = shader->getShaderConstHandle(ShaderGenVars::texMat);
|
||||
mToneMapTexSC = shader->getShaderConstHandle(ShaderGenVars::toneMap);
|
||||
mSpecularColorSC = shader->getShaderConstHandle(ShaderGenVars::specularColor);
|
||||
mPBRConfigSC = shader->getShaderConstHandle(ShaderGenVars::pbrConfig);
|
||||
mSmoothnessSC = shader->getShaderConstHandle(ShaderGenVars::smoothness);
|
||||
mMetalnessSC = shader->getShaderConstHandle(ShaderGenVars::metalness);
|
||||
mAccuScaleSC = shader->getShaderConstHandle("$accuScale");
|
||||
|
|
@ -443,16 +443,16 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
// Without realtime lighting and on lower end
|
||||
// shader models disable the specular map.
|
||||
if ( !fd.features[ MFT_RTLighting ] || shaderVersion == 2.0 )
|
||||
fd.features.removeFeature( MFT_SpecularMap );
|
||||
fd.features.removeFeature( MFT_PBRConfigMap );
|
||||
|
||||
// If we have a specular map then make sure we
|
||||
// have per-pixel specular enabled.
|
||||
if( fd.features[ MFT_SpecularMap ] )
|
||||
if( fd.features[ MFT_PBRConfigMap ] )
|
||||
{
|
||||
// Check for an alpha channel on the specular map. If it has one (and it
|
||||
// has values less than 255) than the artist has put the gloss map into
|
||||
// the alpha channel.
|
||||
if( mStages[stageNum].getTex( MFT_SpecularMap )->mHasTransparency )
|
||||
if( mStages[stageNum].getTex( MFT_PBRConfigMap )->mHasTransparency )
|
||||
fd.features.addFeature( MFT_GlossMap );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue