浏览代码

Added a warning for 128x128 cookie texture without mipmaps

/main
Antoine Lelievre 6 年前
当前提交
8012ce85
共有 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");
}
}

正在加载...
取消
保存