From 0f5ba17126be26819c847bc9db9290e917237b3d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 29 Oct 2019 22:11:59 -0500 Subject: [PATCH] needed mft_pbrconfigmap or _convifgvars and _matinfocflags set to default=true to trip the forward lit side, shifted the mft_skybox test on down below the checks for the presence of those features to be inserted, and removed them on out if a skybox. --- .../source/materials/materialFeatureTypes.cpp | 8 ++++---- .../materials/processedShaderMaterial.cpp | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Engine/source/materials/materialFeatureTypes.cpp b/Engine/source/materials/materialFeatureTypes.cpp index 5b325fc01..1b2a21837 100644 --- a/Engine/source/materials/materialFeatureTypes.cpp +++ b/Engine/source/materials/materialFeatureTypes.cpp @@ -43,10 +43,10 @@ ImplementFeatureType( MFT_DetailMap, MFG_Texture, 4.0f, true ); ImplementFeatureType( MFT_DiffuseColor, MFG_Texture, 5.0f, true ); ImplementFeatureType( MFT_DiffuseVertColor, MFG_Texture, 6.0f, true ); ImplementFeatureType( MFT_AlphaTest, MFG_Texture, 7.0f, true ); -ImplementFeatureType(MFT_InvertSmoothness, U32(-1), -1, true); -ImplementFeatureType( MFT_PBRConfigMap, MFG_Texture, 8.0f, false ); -ImplementFeatureType( MFT_PBRConfigVars, MFG_Texture, 8.0f, false ); -ImplementFeatureType( MFT_MatInfoFlags, MFG_Texture, 9.0f, false ); +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 ); diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index a427ce8bf..615df3406 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -385,14 +385,6 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum, fd.features.addFeature( MFT_CubeMap ); } - if (features.hasFeature(MFT_SkyBox)) - { - fd.features.addFeature(MFT_StaticCubemap); - fd.features.addFeature(MFT_CubeMap); - fd.features.addFeature(MFT_SkyBox); - - fd.features.removeFeature(MFT_ReflectionProbes); - } fd.features.addFeature( MFT_Visibility ); if ( lastStage && @@ -453,6 +445,17 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum, // Deferred Shading : Material Info Flags fd.features.addFeature(MFT_MatInfoFlags); + if (features.hasFeature(MFT_SkyBox)) + { + fd.features.addFeature(MFT_StaticCubemap); + fd.features.addFeature(MFT_CubeMap); + fd.features.addFeature(MFT_SkyBox); + + fd.features.removeFeature(MFT_ReflectionProbes); + fd.features.removeFeature(MFT_PBRConfigVars); + fd.features.removeFeature(MFT_MatInfoFlags); + } + if ( mMaterial->mAccuEnabled[stageNum] ) { mHasAccumulation = true;