浏览代码

Added option to use MSAA backbuffer and benefit from hasMultipleSampleAutoResolve. Changed MSAA to MSAASampleCount

/RenderPassXR_Sandbox
Felipe Lira 7 年前
当前提交
18eb7834
共有 2 个文件被更改,包括 17 次插入3 次删除
  1. 18
      Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
  2. 2
      Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs

18
Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


m_CameraRTProperty = Shader.PropertyToID("_CameraRT");
m_ShadowMapRTID = new RenderTargetIdentifier(m_ShadowMapProperty);
m_CameraRTID = new RenderTargetIdentifier(m_CameraRTProperty);
// Let engine know we have MSAA on for cases where we support MSAA backbuffer
if (QualitySettings.antiAliasing != m_Asset.MSAASampleCount)
QualitySettings.antiAliasing = m_Asset.MSAASampleCount;
Shader.globalRenderPipeline = "LightweightPipeline";
}

if (camera.activeTexture == null)
{
cmd.GetTemporaryRT(m_CameraRTProperty, Screen.width, Screen.height, kCameraDepthBufferBits,
FilterMode.Bilinear, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default, m_Asset.MSAA);
FilterMode.Bilinear, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default, m_Asset.MSAASampleCount);
cmd.SetRenderTarget(m_CameraRTID);
}
else

private bool GetRenderToIntermediateTarget(Camera camera)
{
bool allowMSAA = camera.allowMSAA && m_Asset.MSAA > 1;
bool allowMSAA = camera.allowMSAA && m_Asset.MSAASampleCount > 1 && !PlatformSupportsMSAABackBuffer();
}
private bool PlatformSupportsMSAABackBuffer()
{
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_TVOS || UNITY_SAMSUNGTV
return true;
#else
return false;
#endif
}
}
}

2
Assets/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs


private set { m_EnableAmbientProbe = value; }
}
public int MSAA
public int MSAASampleCount
{
get { return (int)m_MSAA; }
set { m_MSAA = (MSAAQuality)value; }

正在加载...
取消
保存