Răsfoiți Sursa

Merge pull request #1554 from Azaezel/MagicalSkyBox

from @rextimmy automatically adds a sky feature to  skies. (render so…
Anis 9 ani în urmă
părinte
comite
25e8cf4711

+ 1 - 0
Engine/source/environment/skyBox.cpp

@@ -608,6 +608,7 @@ void SkyBox::_initMaterial()
    FeatureSet features = MATMGR->getDefaultFeatures();
    features.removeFeature( MFT_RTLighting );
    features.removeFeature( MFT_Visibility );
+   features.addFeature(MFT_SkyBox);
 
    // Now initialize the material.
    mMatInstance->init(features, getGFXVertexFormat<GFXVertexPNT>());

+ 0 - 6
Engine/source/materials/materialDefinition.cpp

@@ -210,9 +210,6 @@ Material::Material()
    
    mDirectSoundOcclusion = 1.f;
    mReverbSoundOcclusion = 1.0;
-
-   // Deferred Shading
-   mIsSky = false;
 }
 
 void Material::initPersistFields()
@@ -420,9 +417,6 @@ void Material::initPersistFields()
    addField("dynamicCubemap", TypeBool, Offset(mDynamicCubemap, Material),
       "Enables the material to use the dynamic cubemap from the ShapeBase object its applied to." );
 
-   addField("isSky", TypeBool, Offset(mIsSky, Material),
-       "Sky support. Alters draw dimensions." );
-
    addGroup( "Behavioral" );
 
       addField( "showFootprints", TypeBool, Offset( mShowFootprints, Material ),

+ 0 - 1
Engine/source/materials/materialDefinition.h

@@ -295,7 +295,6 @@ public:
    bool mDynamicCubemap;
 
    // Deferred Shading
-   bool mIsSky;
    F32 mMatInfoFlags[MAX_STAGES];
    bool mTranslucent;   
    BlendOp mTranslucentBlendOp;

+ 1 - 1
Engine/source/materials/materialFeatureTypes.cpp

@@ -97,7 +97,7 @@ ImplementFeatureType( MFT_ImposterVert, MFG_PreTransform, 1.0, false );
 
 // Deferred Shading
 ImplementFeatureType( MFT_isDeferred, U32(-1), -1, true );
-ImplementFeatureType( MFT_SkyBox, MFG_Transform, 1.0f, true );
+ImplementFeatureType( MFT_SkyBox, MFG_Transform, 1.0f, false );
 ImplementFeatureType( MFT_DeferredEmptySpec, MFG_Texture, 8.01f, false );
 
 ImplementFeatureType( MFT_DeferredSpecMap, MFG_Texture, 8.2f, false );

+ 1 - 1
Engine/source/materials/processedShaderMaterial.cpp

@@ -341,7 +341,7 @@ void ProcessedShaderMaterial::_determineFeatures(  U32 stageNum,
        fd.features.addFeature( MFT_CubeMap );
    }
 
-   if (mMaterial->mIsSky)
+   if (features.hasFeature(MFT_SkyBox))
    {
       fd.features.addFeature(MFT_CubeMap);
       fd.features.addFeature(MFT_SkyBox);