Browse Source

Update processedShaderMaterial.cpp

requires extra safety when the diffusemap asset is null, this is something that will be fixed by the material asset refactor
marauder2k7 9 tháng trước cách đây
mục cha
commit
79e046d379
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      Engine/source/materials/processedShaderMaterial.cpp

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

@@ -875,6 +875,12 @@ void ProcessedShaderMaterial::setTextureStages( SceneRenderState *state, const S
          case Material::TexTarget:
             {
                texTarget = rpd->mTexSlot[i].texTarget;
+               if (!mMaterial->getDiffuseMapAsset(0).notNull())
+               {
+                  GFX->setTexture(i, NULL);
+                  break;
+               }
+
                texObject = mMaterial->getDiffuseMapAsset(0)->getTexture(&GFXStaticTextureSRGBProfile);
                if ( !texTarget )
                {