浏览代码

HDRenderPipeline: Fully qualified name for UnityEngine.Graphics to avoid namespace conflict

/main
sebastienlagarde 7 年前
当前提交
06524b75
共有 2 个文件被更改,包括 10 次插入10 次删除
  1. 14
      ScriptableRenderPipeline/Core/TextureCache.cs
  2. 6
      ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs

14
ScriptableRenderPipeline/Core/TextureCache.cs


if (mismatch)
{
if (!Graphics.ConvertTexture(texture, 0, m_Cache, sliceIndex))
if (!UnityEngine.Graphics.ConvertTexture(texture, 0, m_Cache, sliceIndex))
{
Debug.LogErrorFormat(texture, "Unable to convert texture \"{0}\" to match renderloop settings ({1}x{2} {3})",
texture.name, m_Cache.width, m_Cache.height, m_Cache.format);

{
Graphics.CopyTexture(texture, 0, m_Cache, sliceIndex);
UnityEngine.Graphics.CopyTexture(texture, 0, m_Cache, sliceIndex);
}
}

for (int f = 0; f < 6; f++)
{
if (!Graphics.ConvertTexture(texture, f, m_Cache, 6 * sliceIndex + f))
if (!UnityEngine.Graphics.ConvertTexture(texture, f, m_Cache, 6 * sliceIndex + f))
{
failed = true;
break;

else
{
for (int f = 0; f < 6; f++)
Graphics.CopyTexture(texture, f, m_Cache, 6 * sliceIndex + f);
UnityEngine.Graphics.CopyTexture(texture, f, m_Cache, 6 * sliceIndex + f);
}
}
}

for (int m = 0; m < m_NumPanoMipLevels; m++)
{
m_CubeBlitMaterial.SetInt(m_CubeMipLevelPropName, Mathf.Min(m_NumMipLevels - 1, m));
Graphics.SetRenderTarget(m_StagingRTs[m]);
Graphics.Blit(null, m_CubeBlitMaterial, 0);
UnityEngine.Graphics.SetRenderTarget(m_StagingRTs[m]);
UnityEngine.Graphics.Blit(null, m_CubeBlitMaterial, 0);
Graphics.CopyTexture(m_StagingRTs[m], 0, 0, m_CacheNoCubeArray, sliceIndex, m);
UnityEngine.Graphics.CopyTexture(m_StagingRTs[m], 0, 0, m_CacheNoCubeArray, sliceIndex, m);
}
}

6
ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs


int offset = 0;
for (int i = 0; i < 6; ++i)
{
Graphics.SetRenderTarget(m_SkyboxCubemapRT, 0, (CubemapFace)i);
UnityEngine.Graphics.SetRenderTarget(m_SkyboxCubemapRT, 0, (CubemapFace)i);
temp.ReadPixels(new Rect(0, 0, resolution, resolution), offset, 0);
temp.Apply();
offset += resolution;

// Temporarily disabled until proper API reaches trunk
Graphics.Blit(temp, tempRT, new Vector2(1.0f, -1.0f), new Vector2(0.0f, 0.0f));
UnityEngine.Graphics.Blit(temp, tempRT, new Vector2(1.0f, -1.0f), new Vector2(0.0f, 0.0f));
Graphics.SetRenderTarget(null);
UnityEngine.Graphics.SetRenderTarget(null);
Object.DestroyImmediate(temp);
Object.DestroyImmediate(tempRT);

正在加载...
取消
保存