浏览代码

Merge pull request #1782 from Unity-Technologies/WarningForCookieWithoutMipmap

Added a warning for 128x128 cookie  texture without mipmaps
/main
GitHub 6 年前
当前提交
50098f9d
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 16
      com.unity.render-pipelines.core/CoreRP/Textures/TextureCache.cs

16
com.unity.render-pipelines.core/CoreRP/Textures/TextureCache.cs


{
}
bool TextureHasMipmaps(Texture texture)
{
var crt = texture as CustomRenderTexture;
if (texture is Texture2D)
return ((Texture2D)texture).mipmapCount > 1;
else if (crt is CustomRenderTexture)
return ((CustomRenderTexture)texture).useMipMap;
return false;
}
public override void TransferToSlice(CommandBuffer cmd, int sliceIndex, Texture texture)
{
var mismatch = (m_Cache.width != texture.width) || (m_Cache.height != texture.height);

}
else
{
cmd.CopyTexture(texture, 0, m_Cache, sliceIndex);
if (TextureHasMipmaps(texture))
cmd.CopyTexture(texture, 0, m_Cache, sliceIndex);
else
Debug.LogWarning("The texture '" + texture + "' should have mipmaps to be handeled by the cookie texture array");
}
}

正在加载...
取消
保存