Explorar o código

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 hai 9 meses
pai
achega
79e046d379
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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 )
                {